diff --git a/.github/workflows/docs-test.yml b/.github/workflows/docs-test.yml index 7f4d742a4a..4882cefaef 100644 --- a/.github/workflows/docs-test.yml +++ b/.github/workflows/docs-test.yml @@ -63,4 +63,25 @@ jobs: fail_on_error: true vale_flags: '--minAlertLevel=error' env: - GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file + GITHUB_TOKEN: ${{ github.token }} + + eslint: + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2.3.5 + with: + fetch-depth: 0 + + - name: Install dependencies + uses: ./.github/actions/cache-deps + with: + extension: eslint-docs + + - name: Run Eslint + run: yarn lint:docs \ No newline at end of file diff --git a/docs/.babelrc b/docs/.babelrc new file mode 100644 index 0000000000..eb9156a908 --- /dev/null +++ b/docs/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + "@babel/preset-react" + ] +} \ No newline at end of file diff --git a/docs/.eslintignore b/docs/.eslintignore new file mode 100644 index 0000000000..7a3c85e25d --- /dev/null +++ b/docs/.eslintignore @@ -0,0 +1 @@ +!docs/content \ No newline at end of file diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js new file mode 100644 index 0000000000..27a5e1fad2 --- /dev/null +++ b/docs/.eslintrc.js @@ -0,0 +1,121 @@ +module.exports = { + root: true, + parser: "@babel/eslint-parser", + parserOptions: { + requireConfigFile: false, + ecmaFeatures: { + experimentalDecorators: true, + }, + }, + plugins: ["prettier", "markdown"], + extends: [ + "eslint:recommended", + "google", + "plugin:prettier/recommended", + "plugin:markdown/recommended", + "plugin:react/recommended", + "plugin:react/jsx-runtime", + ], + settings: { + react: { + version: "detect" + } + }, + rules: { + "no-undef": "off", + "no-unused-expressions": "off", + "no-unused-vars": "off", + "no-unused-labels": "off", + "no-console": "off", + curly: ["error", "all"], + "new-cap": "off", + "require-jsdoc": "off", + "no-unused-expressions": "off", + "no-unused-vars": "off", + camelcase: "off", + "no-invalid-this": "off", + "max-len": [ + "error", + { + code: 75, + }, + ], + semi: ["error", "never"], + quotes: [ + "error", + "double", + { + allowTemplateLiterals: true, + }, + ], + "comma-dangle": [ + "error", + { + arrays: "always-multiline", + objects: "always-multiline", + imports: "always-multiline", + exports: "always-multiline", + functions: "never", + }, + ], + "object-curly-spacing": ["error", "always"], + "arrow-parens": ["error", "always"], + "linebreak-style": 0, + "no-confusing-arrow": [ + "error", + { + allowParens: false, + }, + ], + "space-before-function-paren": [ + "error", + { + anonymous: "always", + named: "never", + asyncArrow: "always", + }, + ], + "space-infix-ops": "off", + "eol-last": ["error", "always"], + "react/prop-types": "off", + "react/jsx-no-undef": "off" + }, + env: { + es6: true, + node: true, + }, + ignorePatterns: [ + 'docs/content/references/**', + 'docs/content/advanced/backend/subscribers/events-list.md' + ], + overrides: [ + { + files: ["docs/content/**/*.md", "docs/content/**/*.mdx"], + processor: "markdown/markdown", + }, + { + files: [ + "docs/content/**/*.md/*.js", + "docs/content/**/*.mdx/*.js", + "docs/content/**/*.md/*.jsx", + "docs/content/**/*.mdx/*.jsx", + ], + }, + { + files: [ + "docs/content/**/*.md/*.ts", + "docs/content/**/*.mdx/*.ts", + "docs/content/**/*.md/*.tsx", + "docs/content/**/*.mdx/*.tsx", + ], + plugins: ["@typescript-eslint/eslint-plugin"], + extends: ["plugin:@typescript-eslint/recommended"], + parser: "@typescript-eslint/parser", + rules: { + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + }, + }, + ], +} diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index 891a86a516..1cb1236186 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -108,100 +108,166 @@ tags: sessions. - name: App description: App endpoints that allow handling apps in Medusa. - x-resourceId: OAuth - name: Batch Job description: Batch Job endpoints that allow handling batch jobs in Medusa. - x-resourceId: batch_job - name: Claim description: Claim endpoints that allow handling claims in Medusa. - x-resourceId: claim_order - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Customer Group description: Customer Group endpoints that allow handling customer groups in Medusa. - x-resourceId: customer_group - name: Discount description: Discount endpoints that allow handling discounts in Medusa. - x-resourceId: discount - name: Discount Condition description: >- Discount Condition endpoints that allow handling discount conditions in Medusa. - x-resourceId: discount_condition - name: Draft Order description: Draft Order endpoints that allow handling draft orders in Medusa. - x-resourceId: draft-order - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Invite description: Invite endpoints that allow handling invites in Medusa. - x-resourceId: invite - name: Note description: Note endpoints that allow handling notes in Medusa. - x-resourceId: note - name: Notification description: Notification endpoints that allow handling notifications in Medusa. - x-resourceId: notification - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Price List description: Price List endpoints that allow handling price lists in Medusa. - x-resourceId: price_list - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Tag description: Product Tag endpoints that allow handling product tags in Medusa. - x-resourceId: product_tag - name: Product Type description: Product Types endpoints that allow handling product types in Medusa. - x-resourceId: product_type - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Sales Channel description: Sales Channel endpoints that allow handling sales channels in Medusa. - x-resourceId: sales_channel - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Shipping Profile description: >- Shipping Profile endpoints that allow handling shipping profiles in Medusa. - x-resourceId: shipping_profile - name: Store description: Store endpoints that allow handling stores in Medusa. - x-resourceId: store - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap - name: Tax Rate description: Tax Rate endpoints that allow handling tax rates in Medusa. - x-resourceId: tax_rate - name: Upload description: Upload endpoints that allow handling uploads in Medusa. - name: User description: User endpoints that allow handling users in Medusa. - x-resourceId: user servers: - url: 'https://api.medusa-commerce.com/admin' paths: + /apps/authorizations: + post: + operationId: PostApps + summary: Generate Token for App + description: Generates a token for an application. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostAppsReq' + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/apps/authorizations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "application_name": "example", + "state": "ready", + "code": "token" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + $ref: '#/components/schemas/OAuth' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /apps: + get: + operationId: GetApps + summary: List Applications + description: Retrieve a list of applications. + x-authenticated: true + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/apps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + type: array + items: + $ref: '#/components/schemas/OAuth' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /auth: post: operationId: PostAuth @@ -259,7 +325,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -356,7 +422,1457 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency + x-authenticated: true + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currencies: + type: array + items: + $ref: '#/components/schemas/Currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '/currencies/{code}': + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCurrenciesCurrencyReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.update(code, { + includes_tax: true + }) + + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currency: + $ref: '#/components/schemas/Currency' + '/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-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: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the collection + object: + type: string + description: The type of object the removal was executed on + default: product-collection + removed_products: + description: The IDs of the products removed from the collection + type: array + items: + description: The ID of a Product to add to the Product Collection. + type: string + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /collections: + post: + operationId: PostCollections + summary: Create a Collection + description: Creates a Product Collection. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCollectionsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.create({ + title: 'New Collection' + }) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + 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 + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/collections/{id}': + delete: + operationId: DeleteCollectionsCollection + summary: Delete a Collection + description: Deletes a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // 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: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Collection + object: + type: string + description: The type of the object that was deleted. + default: product-collection + deleted: + type: boolean + description: Whether the collection was deleted successfully or not. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Collection + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // 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: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/customer-groups/{id}/customers/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/CustomerGroup' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.removeCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/CustomerGroup' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customer-groups: + post: + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. + x-authenticated: true + parameters: [] + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.create({ + name: 'VIP' + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/CustomerGroup' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. + get: + operationId: GetCustomerGroups + summary: List Customer Groups + description: Retrieve a list of customer groups. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching customer group names. + schema: + type: string + - in: query + name: offset + description: How many groups to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: order + description: the field used to order the customer groups. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by the customer group ID + schema: + oneOf: + - type: string + description: customer group ID + - type: array + description: multiple customer group IDs + items: + type: string + - type: object + properties: + lt: + type: string + description: filter by IDs less than this ID + gt: + type: string + description: filter by IDs greater than this ID + lte: + type: string + description: filter by IDs less than or equal to this ID + gte: + type: string + description: filter by IDs greater than or equal to this ID + - in: query + name: name + style: form + explode: false + description: Filter by the customer group name + schema: + type: array + description: multiple customer group names + items: + type: string + description: customer group name + - in: query + name: created_at + description: Date comparison for when resulting customer groups were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting customer groups were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: limit + description: Limit the number of customer groups returned. + schema: + type: integer + default: 10 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each customer + groups of the result. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + 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 + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/customer-groups/{id}': + delete: + operationId: DeleteCustomerGroupsCustomerGroup + summary: Delete a Customer Group + description: Deletes a CustomerGroup. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer Group + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.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 Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted customer group. + object: + type: string + description: The type of the object that was deleted. + default: customer_group + deleted: + type: boolean + description: >- + Whether the customer group was deleted successfully or + not. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/CustomerGroup' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customer_group: + $ref: '#/components/schemas/CustomerGroup' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/customer-groups/{id}/customers': + get: + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of customers in a customer group + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.listCustomers(customer_group_id) + + .then(({ customers }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + customers: + type: array + items: + $ref: '#/components/schemas/Customer' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '400': $ref: '#/components/responses/400_error' '401': @@ -419,7 +1935,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -482,7 +1998,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -505,42 +2021,7 @@ paths: content: application/json: schema: - type: object - required: - - type - - context - properties: - type: - type: string - description: The type of batch job to start. - example: product-export - context: - type: object - description: >- - Additional infomration regarding the batch to be used for - processing. - example: - shape: - prices: - - region: null - currency_code: eur - dynamicImageColumnCount: 4 - dynamicOptionColumnCount: 2 - list_config: - skip: 0 - take: 50 - order: - created_at: DESC - relations: - - variants - - variant.prices - - images - dry_run: - type: boolean - description: >- - Set a batch job in dry_run mode to get some information on - what will be done without applying any modifications. - default: false + $ref: '#/components/schemas/AdminPostBatchesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -587,7 +2068,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -880,7 +2361,7 @@ paths: batch_jobs: type: array items: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' count: type: integer description: The total number of items available @@ -952,1651 +2433,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/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: - type: object - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - x-codeSamples: - - lang: 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: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - collection: - $ref: '#/components/schemas/product_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - 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: - type: object - required: - - product_ids - properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "product_ids": [ - "prod_01G1G5V2MBA328390B5AXJ610F" - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the collection - object: - type: string - description: The type of object the removal was executed on - default: product-collection - removed_products: - description: The IDs of the products removed from the collection - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /collections: - post: - operationId: PostCollections - summary: Create a Collection - description: Creates a Product Collection. - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - title - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.collections.create({ - title: 'New Collection' - }) - - .then(({ collection }) => { - console.log(collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "title": "New Collection" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - collection: - $ref: '#/components/schemas/product_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - collections: - type: array - items: - $ref: '#/components/schemas/product_collection' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/collections/{id}': - delete: - operationId: DeleteCollectionsCollection - summary: Delete a Collection - description: Deletes a Product Collection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Collection. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // 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: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Collection - object: - type: string - description: The type of the object that was deleted. - default: product-collection - deleted: - type: boolean - description: Whether the collection was deleted successfully or not. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Product Collection - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // 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: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - collection: - $ref: '#/components/schemas/product_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - 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: - 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 - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - Collection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - collection: - $ref: '#/components/schemas/product_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /currencies: - get: - operationId: GetCurrencies - summary: List Currency - description: Retrieves a list of Currency - x-authenticated: true - parameters: - - in: query - name: code - description: Code of the currency to search for. - schema: - type: string - - in: query - name: includes_tax - description: Search for tax inclusive currencies. - schema: - type: boolean - - in: query - name: order - description: order to retrieve products in. - schema: - type: string - - in: query - name: offset - description: How many products to skip in the result. - schema: - type: number - default: '0' - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: number - default: '20' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.list() - - .then(({ currencies, count, offset, limit }) => { - console.log(currencies.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies' \ - - --header 'Authorization: Bearer {api_token}' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - currencies: - type: array - items: - $ref: '#/components/schemas/currency' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '/currencies/{code}': - post: - operationId: PostCurrenciesCurrency - summary: Update a Currency - description: Update a Currency - x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The code of the Currency. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.update(code, { - includes_tax: true - }) - - .then(({ currency }) => { - console.log(currency.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies/{code}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "includes_tax": true - }' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - currency: - $ref: '#/components/schemas/currency' - '/customer-groups/{id}/customers/batch': - post: - operationId: PostCustomerGroupsGroupCustomersBatch - summary: Add Customers - description: 'Adds a list of customers, represented by id''s, to a customer group.' - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to add - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.addCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) - - .then(({ customer_group }) => { - 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 Group - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - delete: - operationId: DeleteCustomerGroupsGroupCustomerBatch - summary: Remove Customers - description: 'Removes a list of customers, represented by id''s, from a customer group.' - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.removeCustomers(customer_group_id, { - customer_ids: [ - { - id: customer_id - } - ] - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "customer_ids": [ - { - "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" - } - ] - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /customer-groups: - post: - operationId: PostCustomerGroups - summary: Create a Customer Group - description: Creates a CustomerGroup. - x-authenticated: true - parameters: [] - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.create({ - name: 'VIP' - }) - - .then(({ customer_group }) => { - console.log(customer_group.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "VIP" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - type: string - description: Name of the customer group - metadata: - type: object - description: Metadata for the customer. - get: - operationId: GetCustomerGroups - summary: List Customer Groups - description: Retrieve a list of customer groups. - x-authenticated: true - parameters: - - in: query - name: q - description: Query used for searching customer group names. - schema: - type: string - - in: query - name: offset - description: How many groups to skip in the result. - schema: - type: integer - default: 0 - - in: query - name: order - description: the field used to order the customer groups. - schema: - type: string - - in: query - name: discount_condition_id - description: The discount condition id on which to filter the customer groups. - schema: - type: string - - in: query - name: id - style: form - explode: false - description: Filter by the customer group ID - schema: - oneOf: - - type: string - description: customer group ID - - type: array - description: multiple customer group IDs - items: - type: string - - type: object - properties: - lt: - type: string - description: filter by IDs less than this ID - gt: - type: string - description: filter by IDs greater than this ID - lte: - type: string - description: filter by IDs less than or equal to this ID - gte: - type: string - description: filter by IDs greater than or equal to this ID - - in: query - name: name - style: form - explode: false - description: Filter by the customer group name - schema: - type: array - description: multiple customer group names - items: - type: string - description: customer group name - - in: query - name: created_at - description: Date comparison for when resulting customer groups were created. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: updated_at - description: Date comparison for when resulting customer groups were updated. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: limit - description: Limit the number of customer groups returned. - schema: - type: integer - default: 10 - - in: query - name: expand - description: >- - (Comma separated) Which fields should be expanded in each customer - groups of the result. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Group - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer_groups: - type: array - items: - $ref: '#/components/schemas/customer_group' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/customer-groups/{id}': - delete: - operationId: DeleteCustomerGroupsCustomerGroup - summary: Delete a Customer Group - description: Deletes a CustomerGroup. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Customer Group - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.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 Group - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted customer group. - object: - type: string - description: The type of the object that was deleted. - default: customer_group - deleted: - type: boolean - description: >- - Whether the customer group was deleted successfully or - not. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Group - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - 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: - type: object - properties: - name: - description: Name of the customer group - type: string - metadata: - description: Metadata for the customer. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Group - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customer_group: - $ref: '#/components/schemas/customer_group' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/customer-groups/{id}/customers': - get: - operationId: GetCustomerGroupsGroupCustomers - summary: List Customers - description: Retrieves a list of customers in a customer group - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the customer group. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.customerGroups.listCustomers(customer_group_id) - - .then(({ customers }) => { - console.log(customers.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Customer Group - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - customers: - type: array - items: - $ref: '#/components/schemas/customer' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /apps/authorizations: - post: - operationId: PostApps - summary: Generate Token for App - description: Generates a token for an application. - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - application_name - - state - - code - properties: - application_name: - type: string - description: Name of the application for the token to be generated for. - state: - type: string - description: State of the application. - code: - type: string - description: The code for the generated token. - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/apps/authorizations' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "application_name": "example", - "state": "ready", - "code": "token" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /apps: - get: - operationId: GetApps - summary: List Applications - description: Retrieve a list of applications. - x-authenticated: true - x-codeSamples: - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/apps' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - type: array - items: - $ref: '#/components/schemas/OAuth' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -2619,35 +2456,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - first_name - - last_name - - password - properties: - email: - type: string - description: The customer's email. - format: email - first_name: - type: string - description: The customer's first name. - last_name: - type: string - description: The customer's last name. - password: - type: string - description: The customer's password. - format: password - phone: - type: string - description: The customer's phone number. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCustomersReq' tags: - Customer x-codeSamples: @@ -2699,7 +2508,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2779,7 +2588,7 @@ paths: customers: type: array items: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' count: type: integer description: The total number of items available @@ -2861,7 +2670,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2900,40 +2709,7 @@ paths: content: application/json: schema: - type: object - properties: - email: - type: string - description: The Customer's email. - format: email - first_name: - type: string - description: The Customer's first name. - last_name: - type: string - description: The Customer's last name. - phone: - type: string - description: The Customer's phone number. - password: - type: string - description: The Customer's password. - format: password - groups: - type: array - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - description: A list of customer groups to which the customer belongs. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCustomersCustomerReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2979,7 +2755,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -3048,7 +2824,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3118,7 +2894,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3134,7 +2910,7 @@ paths: '/discounts/{discount_id}/conditions/{condition_id}/batch': post: operationId: PostDiscountsDiscountConditionsConditionBatch - summary: Add a batch of resources to a discount condition + summary: Add Batch Resources description: Add a batch of resources to a discount condition. x-authenticated: true parameters: @@ -3168,20 +2944,8 @@ paths: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be added to the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -3229,7 +2993,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3244,7 +3008,7 @@ paths: $ref: '#/components/responses/500_error' delete: operationId: DeleteDiscountsDiscountConditionsConditionBatch - summary: Delete a batch of resources from a discount condition + summary: Delete Batch Resources description: Delete a batch of resources from a discount condition. x-authenticated: true parameters: @@ -3278,20 +3042,8 @@ paths: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be deleted from the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + #/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -3339,7 +3091,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3386,49 +3138,7 @@ paths: content: application/json: schema: - type: object - required: - - operator - properties: - operator: - description: Operator of the condition - type: string - enum: - - in - - not_in - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditions' x-codeSamples: - lang: JavaScript label: JS Client @@ -3476,7 +3186,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3512,144 +3222,7 @@ paths: content: application/json: schema: - type: object - required: - - code - - rule - - regions - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: boolean - description: >- - Whether the Discount should have multiple instances of - itself, each with a different code. This can be useful for - automatically generated codes that all have to follow a - common set of rules. - default: false - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - type - - value - - allocation - properties: - description: - type: string - description: A short description of the discount - type: - type: string - description: >- - The type of the Discount, can be `fixed` for discounts - that reduce the price by a fixed amount, `percentage` - for percentage reductions or `free_shipping` for - shipping vouchers. - enum: - - fixed - - percentage - - free_shipping - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - default: false - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - usage_limit: - type: number - description: Maximum times the discount can be used - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostDiscountsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3670,7 +3243,7 @@ paths: value: 10, allocation: AllocationType.ITEM }, - regions: ['reg_XXXXXXXX'], + regions: ["reg_XXXXXXXX"], is_dynamic: false, is_disabled: false }) @@ -3695,7 +3268,7 @@ paths: "value": 10, "allocation": "item" }, - "regions": ['reg_XXXXXXXX'] + "regions": ["reg_XXXXXXXX"] }' security: - api_token: [] @@ -3711,7 +3284,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3826,7 +3399,7 @@ paths: discounts: type: array items: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' count: type: integer description: The total number of items available @@ -3910,7 +3483,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4024,7 +3597,7 @@ paths: default: true discount: description: The Discount to which the condition used to belong - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4103,7 +3676,7 @@ paths: type: object properties: discount_condition: - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' '400': $ref: '#/components/responses/400_error' '401': @@ -4155,41 +3728,8 @@ paths: content: application/json: schema: - type: object - properties: - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsCondition x-codeSamples: - lang: JavaScript label: JS Client @@ -4240,7 +3780,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4384,7 +3924,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4429,122 +3969,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostDiscountsDiscountReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4590,7 +4015,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4659,7 +4084,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4732,7 +4157,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4755,106 +4180,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - items - - region_id - - shipping_methods - properties: - status: - description: The status of the draft order - type: string - enum: - - open - - completed - email: - description: The email of the customer of the draft order - type: string - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - items: - description: The Line Items that have been received. - type: array - items: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line - Item from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details - about the Line Item. - type: object - region_id: - description: The ID of the region for the draft order - type: string - discounts: - description: The discounts to add on the draft order - type: array - items: - type: object - required: - - code - properties: - code: - description: The code of the discount to apply - type: string - customer_id: - description: The ID of the customer to add on the draft order - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - shipping_methods: - description: The shipping methods for the draft order - type: array - items: - type: object - required: - - option_id - properties: - option_id: - description: The ID of the shipping option in use - type: string - data: - description: >- - The optional additional data needed for the shipping - method - type: object - price: - description: The potential custom price of the shipping - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Draft Order. - type: object + $ref: '#/components/schemas/AdminPostDraftOrdersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4922,7 +4248,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -4999,7 +4325,7 @@ paths: draft_orders: type: array items: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' count: type: integer description: The total number of items available @@ -5038,30 +4364,7 @@ paths: content: application/json: schema: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line Item - from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - default: Custom item - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5107,7 +4410,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5241,7 +4544,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5311,7 +4614,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5346,22 +4649,8 @@ paths: content: application/json: schema: - type: object - properties: - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object + $ref: >- + #/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq x-codeSamples: - lang: JavaScript label: JS Client @@ -5408,7 +4697,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5471,7 +4760,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5501,51 +4790,7 @@ paths: content: application/json: schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Draft Order in. - country_code: - type: string - description: The 2 character ISO code for the Country. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Draft Order. - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - discounts: - description: An array of Discount codes to add to the Draft Order. - type: array - items: - type: object - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - customer_id: - description: The ID of the Customer to associate the Draft Order with. - type: string + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5591,7 +4836,7 @@ paths: type: object properties: draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -5616,34 +4861,7 @@ paths: content: application/json: schema: - type: object - required: - - region_id - properties: - value: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostGiftCardsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5689,7 +4907,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -5764,7 +4982,7 @@ paths: gift_cards: type: array items: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' count: type: integer description: The total number of items available @@ -5907,7 +5125,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -5938,32 +5156,7 @@ paths: content: application/json: schema: - type: object - properties: - balance: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6009,7 +5202,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -6031,32 +5224,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostInvitesInviteAcceptReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6132,22 +5300,7 @@ paths: content: application/json: schema: - type: object - required: - - user - - role - properties: - user: - description: The email for the user to be created. - type: string - format: email - role: - description: The role of the user to be created. - type: string - enum: - - admin - - member - - developer + $ref: '#/components/schemas/AdminPostInvitesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6249,7 +5402,7 @@ paths: invites: type: array items: - $ref: '#/components/schemas/invite' + $ref: '#/components/schemas/Invite' '400': $ref: '#/components/responses/400_error' '401': @@ -6404,21 +5557,7 @@ paths: content: application/json: schema: - type: object - required: - - resource_id - - resource_type - - value - properties: - resource_id: - type: string - description: The ID of the resource which the Note relates to. - resource_type: - type: string - description: The type of resource which the Note relates to. - value: - type: string - description: The content of the Note to create. + $ref: '#/components/schemas/AdminPostNotesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6468,7 +5607,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6541,7 +5680,7 @@ paths: notes: type: array items: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' count: type: integer description: The total number of items available @@ -6684,7 +5823,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6713,13 +5852,7 @@ paths: content: application/json: schema: - type: object - required: - - value - properties: - value: - type: string - description: The updated description of the Note. + $ref: '#/components/schemas/AdminPostNotesNoteReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6765,7 +5898,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6878,7 +6011,7 @@ paths: notifications: type: array items: - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' '400': $ref: '#/components/responses/400_error' '401': @@ -6910,13 +6043,7 @@ paths: content: application/json: schema: - type: object - properties: - to: - description: >- - A new address or user identifier that the Notification - should be sent to - type: string + $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6954,7 +6081,7 @@ paths: type: object properties: notification: - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' '400': $ref: '#/components/responses/400_error' '401': @@ -6970,7 +6097,7 @@ paths: '/order-edits/{id}/items': post: operationId: PostOrderEditsEditLineItems - summary: Add an line item to an order (edit) + summary: Add a Line Item description: Create an OrderEdit LineItem. parameters: - in: path @@ -6983,22 +6110,7 @@ paths: content: application/json: schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the variant ID to add - type: string - quantity: - description: The quantity to add - type: number - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsReq' x-authenticated: true x-codeSamples: - lang: JavaScript @@ -7012,8 +6124,8 @@ paths: // must be previously logged in or use api token medusa.admin.orderEdits.addLineItem(order_edit_id, { - variant_id, - quantity + variant_id, + quantity }) .then(({ order_edit }) => { @@ -7045,7 +6157,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7107,7 +6219,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7165,7 +6277,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7183,16 +6295,7 @@ paths: content: application/json: schema: - type: object - required: - - order_id - properties: - order_id: - description: The ID of the order to create the edit for. - type: string - internal_note: - description: An optional note to create for the order edit. - type: string + $ref: '#/components/schemas/AdminPostOrderEditsReq' x-authenticated: true x-codeSamples: - lang: JavaScript @@ -7235,7 +6338,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7323,7 +6426,7 @@ paths: properties: order_edits: type: array - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' count: type: integer description: The total number of items available @@ -7348,7 +6451,7 @@ paths: '/order-edits/{id}/items/{item_id}': delete: operationId: DeleteOrderEditsOrderEditLineItemsLineItem - summary: Delete line items from an order edit and create change item + summary: Delete a Line Item description: Delete line items from an order edit and create change item x-authenticated: true parameters: @@ -7400,7 +6503,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7415,7 +6518,7 @@ paths: $ref: '#/components/responses/500_error' post: operationId: PostOrderEditsEditLineItemsLineItem - summary: Create or update the order edit change holding the line item changes + summary: Upsert Line Item Change description: Create or update the order edit change holding the line item changes x-authenticated: true parameters: @@ -7435,13 +6538,7 @@ paths: content: application/json: schema: - type: object - required: - - quantity - properties: - quantity: - description: The quantity to update - type: number + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -7485,7 +6582,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7501,7 +6598,7 @@ paths: '/order-edits/{id}/changes/{change_id}': delete: operationId: DeleteOrderEditsOrderEditItemChange - summary: Delete an Order Edit Item Change + summary: Delete a Line Item Change description: Deletes an Order Edit Item Change x-authenticated: true parameters: @@ -7571,7 +6668,7 @@ paths: delete: operationId: DeleteOrderEditsOrderEdit summary: Delete an Order Edit - description: Deletes an Order Edit + description: Delete an Order Edit x-authenticated: true parameters: - in: path @@ -7630,7 +6727,7 @@ paths: $ref: '#/components/responses/400_error' get: operationId: GetOrderEditsOrderEdit - summary: Retrieve an OrderEdit + summary: Get an OrderEdit description: Retrieves a OrderEdit. x-authenticated: true parameters: @@ -7686,7 +6783,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7701,7 +6798,7 @@ paths: $ref: '#/components/responses/500_error' post: operationId: PostOrderEditsOrderEdit - summary: Updates an OrderEdit + summary: Update an OrderEdit description: Updates a OrderEdit. x-authenticated: true parameters: @@ -7715,11 +6812,7 @@ paths: content: application/json: schema: - type: object - properties: - internal_note: - description: An optional note to create or update for the order edit. - type: string + $ref: '#/components/schemas/AdminPostOrderEditsOrderEditReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -7764,7 +6857,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7780,7 +6873,7 @@ paths: '/order-edits/{id}/request': post: operationId: PostOrderEditsOrderEditRequest - summary: Request order edit confirmation + summary: Request Confirmation description: Request customer confirmation of an Order Edit x-authenticated: true parameters: @@ -7826,7 +6919,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -7898,7 +6991,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7986,7 +7079,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8056,7 +7149,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8133,7 +7226,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8210,7 +7303,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8280,7 +7373,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8346,7 +7439,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8416,7 +7509,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8479,7 +7572,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8542,7 +7635,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8578,18 +7671,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8636,7 +7718,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8666,126 +7748,7 @@ paths: content: application/json: schema: - type: object - required: - - type - - claim_items - properties: - type: - description: >- - The type of the Claim. This will determine how the Claim is - treated: `replace` Claims will result in a Fulfillment with - new items being created, while a `refund` Claim will refund - the amount paid for the claimed items. - type: string - enum: - - replace - - refund - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: string - images: - description: >- - A list of image URL's that will be associated with the - Claim - items: - type: string - return_shipping: - description: >- - Optional details for the Return Shipping Method, if the - items are to be sent back. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - shipping_address: - type: object - description: >- - An optional shipping address to send the claim to. Defaults - to the parent order's shipping address - $ref: '#/components/schemas/address' - refund_amount: - description: >- - The amount to refund the Customer when the Claim type is - `refund`. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8843,7 +7806,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8875,34 +7838,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items to include in the Fulfillment. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of Line Item to fulfill. - type: string - quantity: - description: The quantity of the Line Item to fulfill. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderFulfillmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8958,7 +7894,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8988,23 +7924,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Shipment. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderShipmentReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9050,7 +7970,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9086,23 +8006,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be sent related to this - Claim. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9149,7 +8053,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9181,85 +8085,7 @@ paths: content: application/json: schema: - type: object - required: - - return_items - properties: - return_items: - description: The Line Items to return as part of the Swap. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - return_shipping: - description: How the Swap will be returned. - type: object - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: The new items to send to the Customer. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - custom_shipping_options: - description: >- - The custom shipping options to potentially create a Shipping - Method from. - type: array - items: - required: - - option_id - - price - properties: - option_id: - description: >- - The ID of the Shipping Option to override with a - custom price. - type: string - price: - description: The custom price of the Shipping Option. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - allow_backorder: - description: 'If true, swaps can be completed with items out of stock' - type: boolean - default: true + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9315,7 +8141,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9351,18 +8177,8 @@ paths: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + #/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -9401,7 +8217,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9437,18 +8253,8 @@ paths: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + #/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -9487,7 +8293,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9550,7 +8356,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9579,71 +8385,7 @@ paths: content: application/json: schema: - type: object - properties: - email: - description: the email for the order - type: string - billing_address: - description: Billing address - anyOf: - - $ref: '#/components/schemas/address_fields' - shipping_address: - description: Shipping address - anyOf: - - $ref: '#/components/schemas/address_fields' - items: - description: The Line Items for the order - type: array - items: - $ref: '#/components/schemas/line_item' - region: - description: ID of the region where the order belongs - type: string - discounts: - description: Discounts applied to the order - type: array - items: - $ref: '#/components/schemas/discount' - customer_id: - description: ID of the customer - type: string - payment_method: - description: payment method chosen for the order - type: object - properties: - provider_id: - type: string - description: ID of the payment provider - data: - description: Data relevant for the given payment method - type: object - shipping_method: - description: The Shipping Method used for shipping the order. - type: object - properties: - provider_id: - type: string - description: The ID of the shipping provider. - profile_id: - type: string - description: The ID of the shipping profile. - price: - type: integer - description: The price of the shipping. - data: - type: object - description: Data relevant to the specific shipping method. - items: - type: array - items: - $ref: '#/components/schemas/line_item' - description: Items to ship - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the updated order. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9689,7 +8431,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9961,7 +8703,7 @@ paths: orders: type: array items: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' count: type: integer description: The total number of items available @@ -10043,7 +8785,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -10073,25 +8815,7 @@ paths: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Refund. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderRefundsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10139,7 +8863,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -10171,61 +8895,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that will be returned. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - return_shipping: - description: >- - The Shipping Method to be used to handle the return - shipment. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - note: - description: An optional note with information about the Return. - 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 + $ref: '#/components/schemas/AdminPostOrdersOrderReturnsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10282,7 +8952,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -10318,96 +8988,7 @@ paths: content: application/json: schema: - type: object - properties: - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - id - - images - - tags - properties: - id: - description: The ID of the Claim Item. - type: string - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: object - properties: - id: - type: string - description: Tag ID - value: - type: string - description: Tag value - images: - description: >- - A list of image URL's that will be associated with the - Claim - type: array - items: - type: object - properties: - id: - type: string - description: Image ID - url: - type: string - description: Image URL - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10453,288 +9034,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}': - delete: - operationId: DeletePaymentCollectionsPaymentCollection - summary: Delete a Payment Collection - description: Deletes a Payment Collection - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collection 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.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: - - PaymentCollection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Payment Collection. - object: - type: string - description: The type of the object that was deleted. - format: payment_collection - deleted: - type: boolean - description: Whether or not the Payment Collection was deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - get: - operationId: GetPaymentCollectionsPaymentCollection - summary: Retrieve an PaymentCollection - description: Retrieves a PaymentCollection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the PaymentCollection. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - PaymentCollection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostPaymentCollectionsPaymentCollection - summary: Updates a PaymentCollection - description: Updates a PaymentCollection. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the PaymentCollection. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - description: - description: >- - An optional description to create or update the payment - collection. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - PaymentCollection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}/authorize': - post: - operationId: PostPaymentCollectionsPaymentCollectionAuthorize - summary: Set the status of PaymentCollection as Authorized - description: Sets the status of PaymentCollection as Authorized. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the PaymentCollection. - 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.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: - - PaymentCollection - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -10797,7 +9097,7 @@ paths: type: object properties: payment: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' '400': $ref: '#/components/responses/400_error' '401': @@ -10860,7 +9160,7 @@ paths: type: object properties: payment: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' '400': $ref: '#/components/responses/400_error' '401': @@ -10890,20 +9190,7 @@ paths: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string + $ref: '#/components/schemas/AdminPostPaymentRefundsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10953,7 +9240,7 @@ paths: type: object properties: refund: - $ref: '#/components/schemas/refund' + $ref: '#/components/schemas/Refund' '400': $ref: '#/components/responses/400_error' '401': @@ -10983,50 +9270,7 @@ paths: content: application/json: schema: - type: object - properties: - prices: - description: The prices to update or add. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - override: - description: >- - If true the prices will replace all existing prices - associated with the Price List. - type: boolean + $ref: '#/components/schemas/AdminPostPriceListPricesPricesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11084,7 +9328,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11115,13 +9359,7 @@ paths: content: application/json: schema: - type: object - properties: - price_ids: - description: The price id's of the Money Amounts to delete. - type: array - items: - type: string + $ref: '#/components/schemas/AdminDeletePriceListPricesPricesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11205,88 +9443,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - description - - type - - prices - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - variant_id: - description: The ID of the Variant for which the price is used. - type: string - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: '#/components/schemas/AdminPostPriceListsPriceListReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11352,7 +9509,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11550,7 +9707,7 @@ paths: price_lists: type: array items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' count: type: integer description: The total number of items available @@ -11693,7 +9850,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11722,86 +9879,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: '#/components/schemas/AdminPostPriceListsPriceListPriceListReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11847,7 +9925,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -12246,7 +10324,7 @@ paths: products: type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' count: type: integer description: The total number of items available @@ -12268,6 +10346,276 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/payment-collections/{id}': + 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Payment Collection. + object: + type: string + description: The type of the object that was deleted. + format: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /product-tags: get: operationId: GetProductTags @@ -12401,7 +10749,7 @@ paths: type: object properties: product_tags: - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' count: type: integer description: The total number of items available @@ -12556,7 +10904,7 @@ paths: type: object properties: product_types: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' count: type: integer description: The total number of items available @@ -12595,15 +10943,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: >- - The title the Product Option will be identified by i.e. - "Size" - type: string + $ref: '#/components/schemas/AdminPostProductsProductOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -12649,7 +10989,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -12672,244 +11012,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - is_giftcard: - description: >- - A flag to indicate if the Product represents a Gift Card. - Purchasing Products with this flag set to `true` will result - in a Gift Card being created. - type: boolean - default: false - discountable: - description: >- - A flag to indicate if discounts can be applied to the - LineItems generated from this Product - type: boolean - default: true - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - default: draft - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - options: - description: >- - The Options that the Product should have. These define on - which properties the Product's Product Variants will differ. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Option by. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - value - properties: - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The weight of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -12957,7 +11060,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13172,6 +11275,11 @@ paths: the result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -13211,7 +11319,7 @@ paths: products: type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' count: type: integer description: The total number of items available @@ -13252,117 +11360,7 @@ paths: content: application/json: schema: - type: object - required: - - title - - prices - - options - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: '#/components/schemas/AdminPostProductsProductVariantsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -13433,7 +11431,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13504,7 +11502,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' count: type: integer description: The total number of items available @@ -13597,7 +11595,7 @@ paths: description: Whether or not the items were deleted. default: true product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13632,13 +11630,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product Option - type: string + $ref: '#/components/schemas/AdminPostProductsProductOptionsOption' x-codeSamples: - lang: JavaScript label: JS Client @@ -13684,7 +11676,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13818,7 +11810,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13847,225 +11839,7 @@ paths: content: application/json: schema: - 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: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - properties: - id: - description: The ID of the Product Variant. - type: string - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the Price. - type: string - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Option. - type: string - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The wieght of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostProductsProductReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14112,7 +11886,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14192,7 +11966,7 @@ paths: description: Whether or not the items were deleted. default: true product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14227,114 +12001,7 @@ paths: content: application/json: schema: - type: object - required: - - prices - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The weight of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: '#/components/schemas/AdminPostProductsProductVariantsVariantReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14399,7 +12066,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14525,7 +12192,7 @@ paths: types: type: array items: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' '400': $ref: '#/components/responses/400_error' '401': @@ -14555,17 +12222,7 @@ paths: content: application/json: schema: - type: object - required: - - key - - value - properties: - key: - description: The metadata key - type: string - value: - description: The metadata value - type: string + $ref: '#/components/schemas/AdminPostProductsProductMetadataReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14614,7 +12271,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14630,7 +12287,7 @@ paths: '/publishable-api-keys/{id}/sales-channels/batch': post: operationId: PostPublishableApiKeySalesChannelsChannelsBatch - summary: Add sales channel to a publishable api key scope + summary: Add SalesChannels description: Assign a batch of sales channels to a publishable api key. x-authenticated: true parameters: @@ -14644,22 +12301,8 @@ paths: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to add to the publishable api - key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + #/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -14713,7 +12356,7 @@ paths: schema: properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14728,7 +12371,7 @@ paths: $ref: '#/components/responses/500_error' delete: operationId: DeletePublishableApiKeySalesChannelsChannelsBatch - summary: Remove sales channel from a publishable api key scope + summary: Delete SalesChannels description: Remove a batch of sales channels from a publishable api key. x-authenticated: true parameters: @@ -14742,22 +12385,8 @@ paths: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to delete from the publishable - api key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + #/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -14811,7 +12440,7 @@ paths: schema: properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14827,19 +12456,13 @@ paths: /publishable-api-keys: post: operationId: PostPublishableApiKeys - summary: Create a PublishableApiKey + summary: Create PublishableApiKey description: Creates a PublishableApiKey. requestBody: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: A title for the publishable api key - type: string + $ref: '#/components/schemas/AdminPostPublishableApiKeysReq' x-authenticated: true x-codeSamples: - lang: JavaScript @@ -14879,7 +12502,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14962,7 +12585,7 @@ paths: properties: publishable_api_keys: type: array - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14978,7 +12601,7 @@ paths: '/publishable-api-keys/{id}': delete: operationId: DeletePublishableApiKeysPublishableApiKey - summary: Delete a PublishableApiKey + summary: Delete PublishableApiKey description: Deletes a PublishableApiKeys x-authenticated: true parameters: @@ -15038,7 +12661,7 @@ paths: $ref: '#/components/responses/400_error' get: operationId: GetPublishableApiKeysPublishableApiKey - summary: Get a Publishable API Key + summary: Get a PublishableApiKey description: Retrieve the Publishable Api Key. parameters: - in: path @@ -15086,7 +12709,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15102,7 +12725,7 @@ paths: '/publishable-api-keys/{id}/sales-channels': get: operationId: GetPublishableApiKeySalesChannels - summary: List PublishableApiKey's SalesChannels + summary: List SalesChannels description: List PublishableApiKey's SalesChannels x-authenticated: true parameters: @@ -15112,6 +12735,11 @@ paths: 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-codeSamples: - lang: JavaScript label: JS Client @@ -15150,7 +12778,7 @@ paths: sales_channels: type: array items: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -15166,7 +12794,7 @@ paths: '/publishable-api-keys/{id}/revoke': post: operationId: PostPublishableApiKeysPublishableApiKeyRevoke - summary: Revoke a PublishableApiKey + summary: Revoke PublishableApiKey description: Revokes a PublishableApiKey. parameters: - in: path @@ -15215,7 +12843,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15231,7 +12859,7 @@ paths: '/publishable-api-key/{id}': post: operationId: PostPublishableApiKysPublishableApiKey - summary: Updates a PublishableApiKey + summary: Update PublishableApiKey description: Updates a PublishableApiKey. x-authenticated: true parameters: @@ -15245,11 +12873,8 @@ paths: content: application/json: schema: - type: object - properties: - title: - description: A title to update for the key. - type: string + $ref: >- + #/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq x-codeSamples: - lang: JavaScript label: JS Client @@ -15294,7 +12919,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15324,17 +12949,7 @@ paths: content: application/json: schema: - type: object - required: - - country_code - properties: - country_code: - description: The 2 character ISO code for the Country. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. + $ref: '#/components/schemas/AdminPostRegionsRegionCountriesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15380,7 +12995,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15410,13 +13025,8 @@ paths: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Fulfillment Provider to add. - type: string + $ref: >- + #/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq x-codeSamples: - lang: JavaScript label: JS Client @@ -15462,7 +13072,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15492,13 +13102,7 @@ paths: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Payment Provider to add. - type: string + $ref: '#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15544,7 +13148,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15567,56 +13171,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - currency_code - - tax_rate - - payment_providers - - fulfillment_providers - - countries - properties: - name: - description: The name of the Region - type: string - currency_code: - description: The 3 character ISO currency code to use for the Region. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - tax_code: - description: An optional tax code the Region. - 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 + $ref: '#/components/schemas/AdminPostRegionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15684,7 +13239,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15780,7 +13335,7 @@ paths: regions: type: array items: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' count: type: integer description: The total number of items available @@ -15923,7 +13478,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15952,63 +13507,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Region - type: string - currency_code: - description: The 3 character ISO currency code to use for the Region. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - automatic_taxes: - description: >- - If true Medusa will automatically calculate taxes for carts - in this region. If false you have to manually call POST - /carts/:id/taxes. - type: boolean - gift_cards_taxable: - description: >- - Whether gift cards in this region should be applied sales - tax when purchasing a gift card - type: boolean - tax_provider_id: - description: >- - The ID of the tax provider to use; if null the system tax - provider is used - type: string - tax_code: - description: An optional tax code the Region. - type: string - tax_rate: - description: The tax rate to use on Orders in the Region. - type: number - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean - payment_providers: - description: >- - A list of Payment Provider IDs that should be enabled for - the Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled - for the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be - included in the Region. - type: array - items: - type: string + $ref: '#/components/schemas/AdminPostRegionsRegionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16054,7 +13553,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16201,7 +13700,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16271,7 +13770,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16341,7 +13840,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16364,30 +13863,7 @@ paths: content: application/json: schema: - type: object - required: - - label - - value - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - parent_return_reason_id: - description: The ID of the parent return reason. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostReturnReasonsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16435,7 +13911,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16492,7 +13968,7 @@ paths: return_reasons: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16626,7 +14102,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16655,24 +14131,7 @@ paths: content: application/json: schema: - type: object - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostReturnReasonsReasonReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16718,7 +14177,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16780,7 +14239,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -16850,7 +14309,7 @@ paths: returns: type: array items: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' count: type: integer description: The total number of items available @@ -16890,27 +14349,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that have been received. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: number + $ref: '#/components/schemas/AdminPostReturnsReturnReceiveReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16966,7 +14405,716 @@ paths: type: object properties: return: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /shipping-options: + post: + operationId: PostShippingOptions + summary: Create Shipping Option + description: Creates a Shipping Option + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingOptionsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingOptions.create({ + name: 'PostFake', + region_id: "saasf", + provider_id: "manual", + data: { + }, + price_type: 'flat_rate' + }) + + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-options' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "PostFake", + "region_id": "afasf", + "provider_id": "manual", + "data": {}, + "price_type": "flat_rate" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_option: + $ref: '#/components/schemas/ShippingOption' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingOptions + summary: List Shipping Options + description: Retrieves a list of Shipping Options. + x-authenticated: true + parameters: + - in: query + name: region_id + schema: + type: string + description: Region ID to fetch options from + - in: query + name: is_return + schema: + type: boolean + description: Flag for fetching return options only + - in: query + name: admin_only + schema: + type: boolean + description: Flag for fetching admin specific options + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingOptions.list() + + .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 Option + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_options: + type: array + items: + $ref: '#/components/schemas/ShippingOption' + count: + type: integer + description: The total number of items available + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/shipping-options/{id}': + 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Option + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Shipping Option. + object: + type: string + description: The type of the object that was deleted. + default: shipping-option + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingOptionsOption + summary: Get a Shipping Option + description: Retrieves a Shipping Option. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Option + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_option: + $ref: '#/components/schemas/ShippingOption' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Option + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_option: + $ref: '#/components/schemas/ShippingOption' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /shipping-profiles: + 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingProfiles + summary: List Shipping Profiles + description: Retrieves a list of Shipping Profile. + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.list() + + .then(({ shipping_profiles }) => { + console.log(shipping_profiles.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profiles: + type: array + items: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/shipping-profiles/{id}': + delete: + operationId: DeleteShippingProfilesProfile + summary: Delete a Shipping Profile + description: Deletes a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + 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.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 Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Shipping Profile. + object: + type: string + description: The type of the object that was deleted. + default: shipping_profile + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' '400': $ref: '#/components/responses/400_error' '401': @@ -16996,21 +15144,8 @@ paths: content: application/json: schema: - 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 + $ref: >- + #/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -17064,7 +15199,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17093,21 +15228,8 @@ paths: content: application/json: schema: - 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 + $ref: >- + #/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -17161,7 +15283,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17184,19 +15306,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostSalesChannelsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -17243,7 +15353,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17418,7 +15528,7 @@ paths: sales_channels: type: array items: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' count: type: integer description: The total number of items available @@ -17561,7 +15671,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17590,17 +15700,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - type: string - description: Name of the sales channel. - description: - type: string - description: Sales Channel description. - is_disabled: - type: boolean - description: Indication of if the sales channel is active. + $ref: '#/components/schemas/AdminPostSalesChannelsSalesChannelReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -17646,351 +15746,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /shipping-profiles: - post: - operationId: PostShippingProfiles - summary: Create a Shipping Profile - description: Creates a Shipping Profile - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - description: The name of the Shipping Profile - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetShippingProfiles - summary: List Shipping Profiles - description: Retrieves a list of Shipping Profile. - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingProfiles.list() - - .then(({ shipping_profiles }) => { - console.log(shipping_profiles.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profiles: - type: array - items: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/shipping-profiles/{id}': - delete: - operationId: DeleteShippingProfilesProfile - summary: Delete a Shipping Profile - description: Deletes a Shipping Profile. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Profile. - 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.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 Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Shipping Profile. - object: - type: string - description: The type of the object that was deleted. - default: shipping_profile - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - 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: - type: object - properties: - name: - description: The name of the Shipping Profile - 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.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 Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -18056,7 +15812,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18121,7 +15877,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18175,7 +15931,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18197,42 +15953,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Store - type: string - swap_link_template: - description: >- - A template for Swap links - use `{{cart_id}}` to insert the - Swap Cart id - type: string - payment_link_template: - description: >- - A template for payment links links - use `{{cart_id}}` to - insert the Cart id - type: string - invite_link_template: - description: >- - A template for invite links - use `{{invite_token}}` to - insert the invite token - type: string - default_currency_code: - description: The default currency code for the Store. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - currencies: - description: Array of currencies in 2 character ISO code format. - type: array - items: - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostStoreReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -18278,7 +15999,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18336,7 +16057,7 @@ paths: payment_providers: type: array items: - $ref: '#/components/schemas/payment_provider' + $ref: '#/components/schemas/PaymentProvider' '400': $ref: '#/components/responses/400_error' '401': @@ -18394,498 +16115,7 @@ paths: tax_providers: type: array items: - $ref: '#/components/schemas/tax_provider' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /shipping-options: - post: - operationId: PostShippingOptions - summary: Create Shipping Option - description: Creates a Shipping Option - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - name - - region_id - - provider_id - - data - - price_type - properties: - name: - description: The name of the Shipping Option - type: string - region_id: - description: >- - The ID of the Region in which the Shipping Option will be - available. - type: string - provider_id: - description: >- - The ID of the Fulfillment Provider that handles the Shipping - Option. - type: string - profile_id: - description: >- - The ID of the Shipping Profile to add the Shipping Option - to. - type: number - data: - description: >- - The data needed for the Fulfillment Provider to handle - shipping with this Shipping Option. - type: object - price_type: - description: The type of the Shipping Option price. - type: string - enum: - - flat_rate - - calculated - amount: - description: The amount to charge for the Shipping Option. - type: integer - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - is_return: - description: Whether the Shipping Option defines a return shipment. - type: boolean - default: false - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - default: false - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingOptions.create({ - name: 'PostFake', - region_id: "saasf", - provider_id: "manual", - data: { - }, - price_type: 'flat_rate' - }) - - .then(({ shipping_option }) => { - console.log(shipping_option.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-options' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "name": "PostFake", - "region_id": "afasf", - "provider_id": "manual", - "data": {}, - "price_type": "flat_rate" - }' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Option - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetShippingOptions - summary: List Shipping Options - description: Retrieves a list of Shipping Options. - x-authenticated: true - parameters: - - in: query - name: region_id - schema: - type: string - description: Region ID to fetch options from - - in: query - name: is_return - schema: - type: boolean - description: Flag for fetching return options only - - in: query - name: admin_only - schema: - type: boolean - description: Flag for fetching admin specific options - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingOptions.list() - - .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 Option - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_options: - type: array - items: - $ref: '#/components/schemas/shipping_option' - count: - type: integer - description: The total number of items available - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/shipping-options/{id}': - 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Option - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Shipping Option. - object: - type: string - description: The type of the object that was deleted. - default: shipping-option - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetShippingOptionsOption - summary: Get a Shipping Option - description: Retrieves a Shipping Option. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Option. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Option - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostShippingOptionsOption - summary: Update Shipping Option - description: Updates a Shipping Option - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Option. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - requirements - properties: - name: - description: The name of the Shipping Option - type: string - amount: - description: The amount to charge for the Shipping Option. - type: integer - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - id: - description: The ID of the requirement - type: string - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Option - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/TaxProvider' '400': $ref: '#/components/responses/400_error' '401': @@ -18948,7 +16178,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '401': @@ -19017,7 +16247,7 @@ paths: swaps: type: array items: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' count: type: integer description: The total number of items available @@ -19074,17 +16304,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19134,7 +16354,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19181,17 +16401,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19241,7 +16451,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19289,15 +16499,7 @@ paths: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: The IDs of the products to associate with this tax rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19347,7 +16549,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19394,17 +16596,7 @@ paths: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: >- - The IDs of the products to remove association with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19454,7 +16646,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19502,17 +16694,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19563,7 +16745,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19610,17 +16792,8 @@ paths: content: application/json: schema: - 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 + $ref: >- + #/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -19671,7 +16844,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19713,43 +16886,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostTaxRatesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19799,7 +16936,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19930,7 +17067,7 @@ paths: tax_rates: type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' count: type: integer description: The total number of items available @@ -20091,7 +17228,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -20138,39 +17275,7 @@ paths: content: application/json: schema: - type: object - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: >- - The IDs of the shipping options associated with this tax - rate - items: - type: string - product_types: - type: array - description: >- - The IDs of the types of products associated with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -20216,7 +17321,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -20232,10 +17337,10 @@ paths: /uploads/protected: post: operationId: PostUploadsProtected - summary: Upload files with acl or in a non-public bucket + summary: Protected File Upload description: >- - Uploads at least one file to the specific fileservice that is installed - in Medusa. + 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: @@ -20399,32 +17504,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminCreateUserRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20472,7 +17552,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20527,7 +17607,7 @@ paths: users: type: array items: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20661,7 +17741,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20690,29 +17770,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminUpdateUserRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20758,7 +17816,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20781,14 +17839,7 @@ paths: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The Users email. - type: string - format: email + $ref: '#/components/schemas/AdminResetPasswordTokenRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20854,22 +17905,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminResetPasswordRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20917,7 +17953,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -21067,7 +18103,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' count: type: integer description: The total number of items available @@ -21096,7 +18132,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: An unknown error occurred. @@ -21106,7 +18142,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: >- @@ -21118,7 +18154,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: invalid_request_error message: Discount with code TEST already exists. @@ -21128,7 +18164,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: message: Entity with id 1 was not found type: not_found @@ -21138,21 +18174,21 @@ components: application/json: schema: oneOf: - - $ref: '#/components/schemas/error' - - $ref: '#/components/schemas/multiple_errors' + - $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' - multiple_errors: + MultipleErrors: $ref: '#/components/examples/multiple_errors' 500_error: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' examples: database: $ref: '#/components/examples/database_error' @@ -21363,10 +18399,9 @@ components: Where `{sid}` is the value of `connect.sid` that you copied. schemas: - address_fields: + AddressFields: title: Address Fields description: Address fields used when creating/updating an address. - x-resourceId: address type: object properties: company: @@ -21418,10 +18453,9 @@ components: description: An optional key-value map with additional details example: car: white - address: + Address: title: Address description: An address. - x-resourceId: address type: object properties: id: @@ -21502,10 +18536,9 @@ components: description: An optional key-value map with additional details example: car: white - batch_job: + BatchJob: title: Batch Job description: A Batch Job. - x-resourceId: batch_job type: object required: - type @@ -21645,10 +18678,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - cart: + Cart: title: Cart description: Represents a user cart - x-resourceId: cart type: object properties: id: @@ -21665,19 +18697,19 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' region_id: type: string description: The region's ID @@ -21706,24 +18738,24 @@ components: type: object payment_session: description: The selected payment session in the cart. - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' type: type: string description: The cart's type. @@ -21823,10 +18855,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - claim_image: + ClaimImage: title: Claim Image description: Represents photo documentation of a claim. - x-resourceId: claim_image type: object required: - claim_item_id @@ -21865,12 +18896,11 @@ components: description: An optional key-value map with additional details example: car: white - claim_item: + ClaimItem: title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. - x-resourceId: claim_item type: object required: - claim_order_id @@ -21887,7 +18917,7 @@ components: type: array description: Available if the relation `images` is expanded. items: - $ref: '#/components/schemas/claim_image' + $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -21902,7 +18932,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. type: string @@ -21934,7 +18964,7 @@ components: relation 'tags' is expanded. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: '#/components/schemas/ClaimTag' created_at: type: string description: The date with timezone at which the resource was created. @@ -21952,13 +18982,12 @@ components: description: An optional key-value map with additional details example: car: white - claim_order: + 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. - x-resourceId: claim_order type: object required: - type @@ -21998,14 +19027,14 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $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/line_item' + $ref: '#/components/schemas/LineItem' order_id: description: The ID of the order that the claim comes from. type: string @@ -22024,17 +19053,17 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer @@ -22075,12 +19104,11 @@ components: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - claim_tag: + ClaimTag: title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. - x-resourceId: claim_tag type: object required: - value @@ -22110,10 +19138,9 @@ components: description: An optional key-value map with additional details example: car: white - country: + Country: title: Country description: Country details - x-resourceId: country type: object required: - iso_2 @@ -22165,10 +19192,9 @@ components: region: description: A region object. Available if the relation `region` is expanded. type: object - currency: + Currency: title: Currency description: Currency - x-resourceId: currency type: object required: - code @@ -22198,13 +19224,12 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean - custom_shipping_option: + 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 - x-resourceId: custom_shipping_option type: object required: - price @@ -22260,10 +19285,9 @@ components: [EXPERIMENTAL] Indicates if the custom shipping option price include tax type: boolean - customer_group: + CustomerGroup: title: Customer Group description: Represents a customer group - x-resourceId: customer_group type: object required: - name @@ -22290,7 +19314,7 @@ components: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' created_at: type: string description: The date with timezone at which the resource was created. @@ -22308,10 +19332,9 @@ components: description: An optional key-value map with additional details example: car: white - customer: + Customer: title: Customer description: Represents a customer - x-resourceId: customer type: object required: - email @@ -22338,12 +19361,12 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' phone: type: string description: The customer's phone number @@ -22364,7 +19387,7 @@ components: relation `groups` is expanded. type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' created_at: type: string description: The date with timezone at which the resource was created. @@ -22382,10 +19405,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_customer_group: + DiscountConditionCustomerGroup: title: Product Tag Discount Condition description: Associates a discount condition with a customer group - x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -22401,10 +19423,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22418,10 +19440,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_collection: + DiscountConditionProductCollection: title: Product Collection Discount Condition description: Associates a discount condition with a product collection - x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -22437,10 +19458,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22454,10 +19475,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_tag: + DiscountConditionProductTag: title: Product Tag Discount Condition description: Associates a discount condition with a product tag - x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -22473,10 +19493,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22490,10 +19510,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_type: + DiscountConditionProductType: title: Product Type Discount Condition description: Associates a discount condition with a product type - x-resourceId: discount_condition_product type: object required: - product_type_id @@ -22509,10 +19528,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22526,10 +19545,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product: + DiscountConditionProduct: title: Product Discount Condition description: Associates a discount condition with a product - x-resourceId: discount_condition_product type: object required: - product_id @@ -22545,10 +19563,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22562,10 +19580,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition: + DiscountCondition: title: Discount Condition description: Holds rule conditions for when a discount is applicable - x-resourceId: discount_condition type: object required: - type @@ -22597,7 +19614,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' products: description: >- products associated with this condition if type = products. @@ -22658,12 +19675,11 @@ components: description: An optional key-value map with additional details example: car: white - discount_rule: + DiscountRule: title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. - x-resourceId: discount_rule type: object required: - type @@ -22726,12 +19742,11 @@ components: description: An optional key-value map with additional details example: car: white - discount: + Discount: title: Discount description: >- Represents a discount that can be applied to a cart for promotional purposes. - x-resourceId: discount type: object required: - code @@ -22759,7 +19774,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -22774,7 +19789,7 @@ components: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. type: string @@ -22821,10 +19836,9 @@ components: description: An optional key-value map with additional details example: car: white - draft-order: + DraftOrder: title: DraftOrder description: Represents a draft order - x-resourceId: draft-order type: object properties: id: @@ -22894,12 +19908,11 @@ components: description: An optional key-value map with additional details example: car: white - fulfillment_item: + FulfillmentItem: title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. - x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -22921,17 +19934,16 @@ components: type: object item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer example: 1 - fulfillment_provider: + FulfillmentProvider: title: Fulfillment Provider description: >- Represents a fulfillment provider plugin and holds its installation status. - x-resourceId: fulfillment_provider type: object properties: id: @@ -22945,7 +19957,7 @@ components: to `false`. type: boolean example: true - fulfillment: + Fulfillment: title: Fulfillment description: >- Fulfillments are created once store operators can prepare the purchased @@ -22955,7 +19967,6 @@ components: 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. - x-resourceId: fulfillment type: object required: - provider_id @@ -22995,7 +20006,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' items: description: >- The Fulfillment Items in the Fulfillment - these hold information @@ -23003,7 +20014,7 @@ components: the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: '#/components/schemas/FulfillmentItem' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -23011,7 +20022,7 @@ components: Provider. Available if the relation `tracking_links` is expanded. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true description: >- @@ -23066,12 +20077,11 @@ components: description: An optional key-value map with additional details example: car: white - gift_card_transaction: + GiftCardTransaction: title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order - x-resourceId: gift_card_transaction type: object required: - gift_card_id @@ -23113,12 +20123,11 @@ components: description: The tax rate of the transaction type: number example: 0 - gift_card: + GiftCard: title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. - x-resourceId: gift_card type: object required: - code @@ -23168,6 +20177,10 @@ components: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. @@ -23185,12 +20198,11 @@ components: description: An optional key-value map with additional details example: car: white - idempotency_key: + IdempotencyKey: title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. - x-resourceId: idempotency_key type: object required: - idempotency_key @@ -23242,10 +20254,9 @@ components: type: string description: Where to continue from. default: started - image: + Image: title: Image description: Images holds a reference to a URL at which the image file can be found. - x-resourceId: image type: object required: - url @@ -23275,10 +20286,9 @@ components: description: An optional key-value map with additional details example: car: white - invite: + Invite: title: Invite description: Represents an invite - x-resourceId: invite type: object required: - user_email @@ -23327,10 +20337,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_adjustment: + LineItemAdjustment: title: Line Item Adjustment - description: Represents an Line Item Adjustment - x-resourceId: line_item_adjustment + description: Represents a Line Item Adjustment type: object required: - item_id @@ -23347,7 +20356,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' description: type: string description: The line item's adjustment description @@ -23358,7 +20367,7 @@ components: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' amount: type: number description: The adjustment amount @@ -23368,10 +20377,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_tax_line: + LineItemTaxLine: title: Line Item Tax Line - description: Represents an Line Item Tax Line - x-resourceId: line_item_tax_line + description: Represents a Line Item Tax Line type: object required: - item_id @@ -23388,7 +20396,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' code: description: A code to identify the tax type by type: string @@ -23414,7 +20422,7 @@ components: description: An optional key-value map with additional details example: car: white - line_item: + LineItem: title: Line Item description: >- Line Items represent purchasable units that can be added to a Cart for @@ -23422,7 +20430,6 @@ components: resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. - x-resourceId: line_item type: object required: - title @@ -23467,12 +20474,12 @@ components: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: '#/components/schemas/line_item_tax_line' + $ref: '#/components/schemas/LineItemTaxLine' adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: '#/components/schemas/line_item_adjustment' + $ref: '#/components/schemas/LineItemAdjustment' title: description: >- The title of the Line Item, this should be easily identifiable by @@ -23608,7 +20615,7 @@ components: description: An optional key-value map with additional details example: car: white - money_amount: + MoneyAmount: title: Money Amount description: >- Money Amounts represents an amount that a given Product Variant can be @@ -23617,7 +20624,6 @@ components: 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. - x-resourceId: money_amount type: object required: - currency_code @@ -23636,7 +20642,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to @@ -23661,7 +20667,7 @@ components: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' variant_id: description: The id of the Product Variant contained in the Line Item. type: string @@ -23695,13 +20701,12 @@ components: description: An optional key-value map with additional details example: car: white - note: + 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. - x-resourceId: note type: object required: - value @@ -23730,7 +20735,7 @@ components: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' created_at: type: string description: The date with timezone at which the resource was created. @@ -23748,12 +20753,11 @@ components: description: An optional key-value map with additional details example: car: white - notification_provider: + NotificationProvider: title: Notification Provider description: >- Represents a notification provider plugin and holds its installation status. - x-resourceId: notification_provider type: object required: - id @@ -23769,14 +20773,13 @@ components: to `false`. type: boolean default: true - notification: + 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. - x-resourceId: notification type: object required: - resource_type @@ -23825,14 +20828,14 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: '#/components/schemas/NotificationResend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -23841,10 +20844,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - notification_resend: + NotificationResend: title: Notification Resend description: A resend of a Notification. - x-resourceId: notification_resend type: object properties: id: @@ -23889,14 +20891,14 @@ components: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -23908,7 +20910,6 @@ components: OAuth: title: OAuth description: Represent an OAuth app - x-resourceId: OAuth type: object required: - id @@ -23939,10 +20940,9 @@ components: type: object description: Any data necessary to the app. example: {} - order_edit: + OrderEdit: title: Order Edit description: Order edit keeps track of order items changes. - x-resourceId: order_edit type: object required: - order_id @@ -23960,12 +20960,12 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: '#/components/schemas/order_item_change' + $ref: '#/components/schemas/OrderItemChange' internal_note: description: An optional note with additional details about the order edit. type: string @@ -24052,14 +21052,14 @@ components: type: array description: Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' created_at: type: string description: The date with timezone at which the resource was created. @@ -24068,10 +21068,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - order_item_change: + OrderItemChange: title: Order Item Change description: Represents an order edit item change - x-resourceId: order_item_change type: object required: - type @@ -24094,21 +21093,21 @@ components: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' created_at: type: string description: The date with timezone at which the resource was created. @@ -24126,10 +21125,9 @@ components: description: An optional key-value map with additional details example: car: white - order: + Order: title: Order description: Represents an order - x-resourceId: order type: object required: - customer_id @@ -24205,14 +21203,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' region_id: type: string description: The region's ID @@ -24229,7 +21227,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The order's tax rate type: number @@ -24256,21 +21254,21 @@ components: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' returns: type: array description: >- @@ -24318,21 +21316,21 @@ components: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: '#/components/schemas/GiftCardTransaction' canceled_at: type: string description: The date the order was canceled on. @@ -24405,10 +21403,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - payment_collection: + PaymentCollection: title: Payment Collection description: Payment Collection - x-resourceId: payment_collection type: object required: - type @@ -24451,7 +21448,7 @@ components: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' currency_code: description: The 3 character ISO code for the currency. type: string @@ -24461,17 +21458,17 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' created_by: type: string description: The ID of the user that created the payment collection. @@ -24492,10 +21489,9 @@ components: description: An optional key-value map with additional details example: car: white - payment_provider: + PaymentProvider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. - x-resourceId: payment_provider type: object required: - id @@ -24511,7 +21507,7 @@ components: to `false`. type: boolean default: true - payment_session: + PaymentSession: title: Payment Session description: >- Payment Sessions are created when a Customer initilizes the checkout @@ -24520,7 +21516,6 @@ components: communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. - x-resourceId: payment_session type: object required: - cart_id @@ -24589,12 +21584,11 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - payment: + Payment: title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. - x-resourceId: payment type: object required: - amount @@ -24638,7 +21632,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount_refunded: description: >- The amount of the original Payment amount that has been refunded @@ -24687,12 +21681,11 @@ components: description: An optional key-value map with additional details example: car: white - price_list: + PriceList: title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. - x-resourceId: price_list type: object required: - name @@ -24749,8 +21742,8 @@ components: type: array items: oneOf: - - $ref: '#/components/schemas/money_amount' - - $ref: '#/components/schemas/customer_group' + - $ref: '#/components/schemas/MoneyAmount' + - $ref: '#/components/schemas/CustomerGroup' includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean @@ -24766,10 +21759,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - product_collection: + ProductCollection: title: Product Collection description: Product Collections represents a group of Products that are related. - x-resourceId: product_collection type: object required: - title @@ -24813,13 +21805,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option_value: + 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. - x-resourceId: product_option_value type: object required: - value @@ -24845,7 +21836,7 @@ components: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variant_id: description: >- The ID of the Product Variant that the Product Option Value is @@ -24854,7 +21845,7 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' created_at: type: string description: The date with timezone at which the resource was created. @@ -24872,13 +21863,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option: + 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. - x-resourceId: product_option type: object required: - title @@ -24898,7 +21888,7 @@ components: Available if the relation `values` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' product_id: description: The ID of the Product that the Product Option is defined for. type: string @@ -24923,10 +21913,9 @@ components: description: An optional key-value map with additional details example: car: white - product_tag: + ProductTag: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. - x-resourceId: product_tag type: object required: - value @@ -24956,12 +21945,11 @@ components: description: An optional key-value map with additional details example: car: white - product_tax_rate: + ProductTaxRate: title: Product Tax Rate description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way - x-resourceId: product_tax_rate type: object required: - product_id @@ -24973,14 +21961,14 @@ components: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -24994,12 +21982,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type_tax_rate: + 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 - x-resourceId: product_type_tax_rate type: object required: - product_type_id @@ -25011,14 +21998,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -25032,12 +22019,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type: + ProductType: title: Product Type description: >- Product Type can be added to Products for filtering and reporting purposes. - x-resourceId: product_type type: object required: - value @@ -25067,14 +22053,13 @@ components: description: An optional key-value map with additional details example: car: white - product_variant: + 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. - x-resourceId: product_variant type: object required: - title @@ -25105,7 +22090,7 @@ components: Region. Available if the relation `prices` is expanded. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: '#/components/schemas/MoneyAmount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -25207,7 +22192,7 @@ components: Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' created_at: type: string description: The date with timezone at which the resource was created. @@ -25225,10 +22210,9 @@ components: description: An optional key-value map with additional details example: car: white - product_variant_prices_fields: + ProductVariantPricesFields: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. - x-resourceId: product_variant_prices_fields type: object properties: original_price: @@ -25266,13 +22250,12 @@ components: code: type: string description: The code of the tax rate - product: + 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. - x-resourceId: product type: object required: - title @@ -25323,7 +22306,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/image' + $ref: '#/components/schemas/Image' thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -25335,7 +22318,7 @@ components: Option Values. Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variants: description: >- The Product Variants that belong to the Product. Each will have a @@ -25343,7 +22326,7 @@ components: relation `variants` is expanded. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -25353,7 +22336,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -25421,14 +22404,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: '#/components/schemas/product_type' + $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/product_tag' + $ref: '#/components/schemas/ProductTag' discountable: description: >- Whether the Product can be discounted. Discounts will not apply to @@ -25464,10 +22447,9 @@ components: description: An optional key-value map with additional details example: car: white - publishable_api_key_sales_channel: + PublishableApiKeySalesChannel: title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels - x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: @@ -25478,12 +22460,11 @@ components: type: string description: The publishable API key's ID example: pak_01G1G5V21KADXNGH29BJMAJ4B4 - publishable_api_key: + PublishableApiKey: title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. - x-resourceId: publishable_api_key type: object properties: id: @@ -25520,13 +22501,12 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - refund: + 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. - x-resourceId: refund type: object required: - order_id @@ -25586,14 +22566,13 @@ components: description: An optional key-value map with additional details example: car: white - region: + 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. - x-resourceId: region type: object required: - name @@ -25619,7 +22598,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -25630,7 +22609,7 @@ components: relation `tax_rates` is expanded. type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' tax_code: description: >- The tax code used on purchases in the Region. This may be used by @@ -25651,28 +22630,28 @@ components: relation `countries` is expanded. type: array items: - $ref: '#/components/schemas/country' + $ref: '#/components/schemas/Country' tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: '#/components/schemas/tax_provider' + $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/payment_provider' + $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean @@ -25693,12 +22672,11 @@ components: description: An optional key-value map with additional details example: car: white - return_item: + 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. - x-resourceId: return_item type: object required: - return_id @@ -25710,14 +22688,14 @@ components: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -25742,7 +22720,7 @@ components: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' note: description: An optional note with additional details about the Return. type: string @@ -25752,12 +22730,11 @@ components: description: An optional key-value map with additional details example: car: white - return_reason: + 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. - x-resourceId: return_reason type: object required: - value @@ -25785,10 +22762,10 @@ components: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' created_at: type: string description: The date with timezone at which the resource was created. @@ -25806,13 +22783,12 @@ components: description: An optional key-value map with additional details example: car: white - return: + 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. - x-resourceId: return type: object required: - refund_amount @@ -25836,7 +22812,7 @@ components: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/return_item' + $ref: '#/components/schemas/ReturnItem' swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -25867,7 +22843,7 @@ components: Available if the relation `shipping_method` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -25910,10 +22886,9 @@ components: description: An optional key-value map with additional details example: car: white - sales_channel: + SalesChannel: title: Sales Channel description: A Sales Channel - x-resourceId: sales_channel type: object required: - name @@ -25946,10 +22921,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_method_tax_line: + ShippingMethodTaxLine: title: Shipping Method Tax Line description: Shipping Method Tax Line - x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -25966,7 +22940,7 @@ components: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' code: description: A code to identify the tax type by type: string @@ -25992,14 +22966,13 @@ components: description: An optional key-value map with additional details example: car: white - shipping_method: + 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. - x-resourceId: shipping_method type: object required: - shipping_option_id @@ -26017,7 +22990,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -26061,7 +23034,7 @@ components: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: '#/components/schemas/shipping_method_tax_line' + $ref: '#/components/schemas/ShippingMethodTaxLine' price: description: >- The amount to charge for the Shipping Method. The currency of the @@ -26079,12 +23052,11 @@ components: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean - shipping_option_requirement: + ShippingOptionRequirement: title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. - x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -26103,7 +23075,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' type: description: >- The type of the requirement, this defines how the value will be @@ -26124,7 +23096,7 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_option: + ShippingOption: title: Shipping Option description: >- Shipping Options represent a way in which an Order or Return can be @@ -26133,7 +23105,6 @@ components: 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. - x-resourceId: shipping_option type: object required: - name @@ -26168,7 +23139,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -26177,7 +23148,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' price_type: description: >- The type of pricing calculation that is used when creatin Shipping @@ -26208,7 +23179,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: '#/components/schemas/ShippingOptionRequirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -26235,12 +23206,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_profile: + 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. - x-resourceId: shipping_profile type: object required: - name @@ -26281,7 +23251,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' created_at: type: string description: The date with timezone at which the resource was created. @@ -26299,12 +23269,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_tax_rate: + 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 - x-resourceId: shipping_tax_rate type: object required: - shipping_option_id @@ -26316,14 +23285,14 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -26337,10 +23306,9 @@ components: description: An optional key-value map with additional details example: car: white - staged_job: + StagedJob: title: Staged Job description: A staged job resource - x-resourceId: staged_job type: object required: - event_name @@ -26357,10 +23325,9 @@ components: description: Data necessary for the job type: object example: {} - store: + Store: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' - x-resourceId: store type: object properties: id: @@ -26380,14 +23347,14 @@ components: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: '#/components/schemas/currency' + $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' + $ref: '#/components/schemas/Currency' swap_link_template: description: >- A template to generate Swap links from. Use {{cart_id}} to include @@ -26418,7 +23385,7 @@ components: description: An optional key-value map with additional details example: car: white - swap: + Swap: title: Swap description: >- Swaps can be created when a Customer wishes to exchange Products that @@ -26428,7 +23395,6 @@ components: 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. - x-resourceId: swap type: object required: - fulfillment_status @@ -26480,7 +23446,7 @@ components: relation `additional_items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' return_order: description: >- A return order object. The Return that is issued for the return part @@ -26492,13 +23458,13 @@ components: relation `fulfillments` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May @@ -26514,14 +23480,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $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/shipping_method' + $ref: '#/components/schemas/ShippingMethod' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string @@ -26573,10 +23539,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_line: + TaxLine: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. - x-resourceId: tax_line type: object required: - rate @@ -26611,10 +23576,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_provider: + TaxProvider: title: Tax Provider description: The tax service used to calculate taxes - x-resourceId: tax_provider type: object properties: id: @@ -26628,12 +23592,11 @@ components: to `false`. type: boolean default: true - tax_rate: + TaxRate: title: Tax Rate description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region - x-resourceId: line_item type: object required: - name @@ -26711,13 +23674,12 @@ components: description: An optional key-value map with additional details example: car: white - tracking_link: + 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. - x-resourceId: tracking_link type: object required: - tracking_number @@ -26741,7 +23703,7 @@ components: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string description: >- @@ -26768,10 +23730,9 @@ components: description: An optional key-value map with additional details example: car: white - user: + User: title: User description: Represents a User who can manage store settings. - x-resourceId: user type: object required: - email @@ -26813,24 +23774,22 @@ components: description: An optional key-value map with additional details example: car: white - multiple_errors: + MultipleErrors: title: Multiple Errors - x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' message: type: string default: >- Provided request body contains errors. Please check the data and retry the request - error: + Error: title: Response Error - x-resourceId: error type: object properties: code: @@ -26842,3 +23801,3002 @@ components: type: type: string description: A slug indicating the type of the error. + 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 + AdminPostCurrenciesCurrencyReq: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + 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 + 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 + 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 + 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 + AdminPostCustomerGroupsGroupCustomersBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminDeleteCustomerGroupsGroupCustomerBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminPostCustomerGroupsGroupReq: + type: object + properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object + 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 + 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 + 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: + 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 + AdminPostDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + 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 + 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 + AdminDeleteDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + 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 + 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 + 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/AddressFields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - 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 + 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 + 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/AddressFields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - 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 + 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 + 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 + 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 + 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 + 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. + AdminPostNotesNoteReq: + type: object + required: + - value + properties: + value: + type: string + description: The updated description of the Note. + AdminPostNotificationsNotificationResendReq: + type: object + properties: + to: + description: >- + A new address or user identifier that the Notification should be + sent to + type: string + 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 + 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 + AdminPostOrderEditsEditLineItemsLineItemReq: + type: object + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number + AdminPostOrderEditsOrderEditReq: + type: object + properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string + 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: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: A list of image URL's that will be associated with the Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the items are to + be sent back. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: >- + The new items to send to the Customer when the Claim type is + Replace. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + shipping_address: + type: object + description: >- + An optional shipping address to send the claim to. Defaults to the + parent order's shipping address + $ref: '#/components/schemas/Address' + refund_amount: + description: The amount to refund the Customer when the Claim type is `refund`. + type: integer + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderFulfillmentsReq: + type: object + required: + - items + properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + 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 + 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 + AdminPostOrdersOrderSwapsReq: + type: object + required: + - return_items + properties: + return_items: + description: The Line Items to return as part of the Swap. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: >- + The custom shipping options to potentially create a Shipping Method + from. + type: array + items: + required: + - option_id + - price + properties: + option_id: + description: The ID of the Shipping Option to override with a custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + allow_backorder: + description: 'If true, swaps can be completed with items out of stock' + type: boolean + default: true + 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 + 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 + 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 + AdminPostOrdersOrderReturnsReq: + type: object + required: + - items + properties: + items: + description: The Line Items that will be returned. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: The Shipping Method to be used to handle the return shipment. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + 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 + AdminPostOrdersOrderClaimsClaimReq: + type: object + properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - id + - images + - tags + properties: + id: + description: The ID of the Claim Item. + type: string + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: A list of image URL's that will be associated with the Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderReq: + type: object + properties: + email: + description: the email for the order + type: string + billing_address: + description: Billing address + anyOf: + - $ref: '#/components/schemas/AddressFields' + shipping_address: + description: Shipping address + anyOf: + - $ref: '#/components/schemas/AddressFields' + 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 + 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: + 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 + 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: + required: + - amount + - variant_id + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminDeletePriceListPricesPricesReq: + type: object + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string + 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: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + 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 + AdminPostProductsProductOptionsReq: + type: object + required: + - title + properties: + title: + description: The title the Product Option will be identified by i.e. "Size" + 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: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + options: + description: >- + The Options that the Product should have. These define on which + properties the Product's Product Variants will differ. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - value + properties: + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + 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 + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + 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 + 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: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The wieght of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + 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: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + 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 + AdminPostPublishableApiKeysReq: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + 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 + AdminPostPublishableApiKeysPublishableApiKeyReq: + type: object + properties: + title: + description: A title to update for the 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 + 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 + 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 + 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 + 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 + AdminPostReturnsReturnReceiveReq: + type: object + required: + - items + properties: + items: + description: The Line Items that have been received. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number + 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: + 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 + 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: + 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 + AdminPostShippingProfilesReq: + type: object + required: + - name + properties: + name: + description: The name of the Shipping Profile + type: string + AdminPostShippingProfilesProfileReq: + type: object + properties: + name: + description: The name of the Shipping Profile + type: string + 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 + 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 + 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 + 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. + 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 + 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 + 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 + 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 + 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 + 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 + AdminDeleteUploadsReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to delete + type: string + AdminPostUploadsDownloadUrlReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to obtain the download link for + type: string + 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 + AdminResetPasswordTokenRequest: + type: object + required: + - email + properties: + email: + description: The Users email. + type: string + format: email + 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 + 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 diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index f715e780af..a6037a8437 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -108,100 +108,166 @@ tags: sessions. - name: App description: App endpoints that allow handling apps in Medusa. - x-resourceId: OAuth - name: Batch Job description: Batch Job endpoints that allow handling batch jobs in Medusa. - x-resourceId: batch_job - name: Claim description: Claim endpoints that allow handling claims in Medusa. - x-resourceId: claim_order - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Customer Group description: Customer Group endpoints that allow handling customer groups in Medusa. - x-resourceId: customer_group - name: Discount description: Discount endpoints that allow handling discounts in Medusa. - x-resourceId: discount - name: Discount Condition description: >- Discount Condition endpoints that allow handling discount conditions in Medusa. - x-resourceId: discount_condition - name: Draft Order description: Draft Order endpoints that allow handling draft orders in Medusa. - x-resourceId: draft-order - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Invite description: Invite endpoints that allow handling invites in Medusa. - x-resourceId: invite - name: Note description: Note endpoints that allow handling notes in Medusa. - x-resourceId: note - name: Notification description: Notification endpoints that allow handling notifications in Medusa. - x-resourceId: notification - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Price List description: Price List endpoints that allow handling price lists in Medusa. - x-resourceId: price_list - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Tag description: Product Tag endpoints that allow handling product tags in Medusa. - x-resourceId: product_tag - name: Product Type description: Product Types endpoints that allow handling product types in Medusa. - x-resourceId: product_type - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Sales Channel description: Sales Channel endpoints that allow handling sales channels in Medusa. - x-resourceId: sales_channel - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Shipping Profile description: >- Shipping Profile endpoints that allow handling shipping profiles in Medusa. - x-resourceId: shipping_profile - name: Store description: Store endpoints that allow handling stores in Medusa. - x-resourceId: store - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap - name: Tax Rate description: Tax Rate endpoints that allow handling tax rates in Medusa. - x-resourceId: tax_rate - name: Upload description: Upload endpoints that allow handling uploads in Medusa. - name: User description: User endpoints that allow handling users in Medusa. - x-resourceId: user servers: - url: 'https://api.medusa-commerce.com/admin' paths: + /apps/authorizations: + post: + operationId: PostApps + summary: Generate Token for App + description: Generates a token for an application. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostAppsReq' + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/apps/authorizations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "application_name": "example", + "state": "ready", + "code": "token" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + $ref: '#/components/schemas/OAuth' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /apps: + get: + operationId: GetApps + summary: List Applications + description: Retrieve a list of applications. + x-authenticated: true + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/apps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + apps: + type: array + items: + $ref: '#/components/schemas/OAuth' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /auth: post: operationId: PostAuth @@ -259,7 +325,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -356,7 +422,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -369,151 +435,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /currencies: - get: - operationId: GetCurrencies - summary: List Currency - description: Retrieves a list of Currency - x-authenticated: true - parameters: - - in: query - name: code - description: Code of the currency to search for. - schema: - type: string - - in: query - name: includes_tax - description: Search for tax inclusive currencies. - schema: - type: boolean - - in: query - name: order - description: order to retrieve products in. - schema: - type: string - - in: query - name: offset - description: How many products to skip in the result. - schema: - type: number - default: '0' - - in: query - name: limit - description: Limit the number of products returned. - schema: - type: number - default: '20' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.list() - - .then(({ currencies, count, offset, limit }) => { - console.log(currencies.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies' \ - - --header 'Authorization: Bearer {api_token}' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - currencies: - type: array - items: - $ref: '#/components/schemas/currency' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '/currencies/{code}': - post: - operationId: PostCurrenciesCurrency - summary: Update a Currency - description: Update a Currency - x-authenticated: true - parameters: - - in: path - name: code - required: true - description: The code of the Currency. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.currencies.update(code, { - includes_tax: true - }) - - .then(({ currency }) => { - console.log(currency.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies/{code}' \ - - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "includes_tax": true - }' - tags: - - Currency - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - currency: - $ref: '#/components/schemas/currency' '/batch-jobs/{id}/cancel': post: operationId: PostBatchJobsBatchJobCancel @@ -564,7 +485,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -627,7 +548,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -650,42 +571,7 @@ paths: content: application/json: schema: - type: object - required: - - type - - context - properties: - type: - type: string - description: The type of batch job to start. - example: product-export - context: - type: object - description: >- - Additional infomration regarding the batch to be used for - processing. - example: - shape: - prices: - - region: null - currency_code: eur - dynamicImageColumnCount: 4 - dynamicOptionColumnCount: 2 - list_config: - skip: 0 - take: 50 - order: - created_at: DESC - relations: - - variants - - variant.prices - - images - dry_run: - type: boolean - description: >- - Set a batch job in dry_run mode to get some information on - what will be done without applying any modifications. - default: false + $ref: '#/components/schemas/AdminPostBatchesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -732,7 +618,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -1025,7 +911,7 @@ paths: batch_jobs: type: array items: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' count: type: integer description: The total number of items available @@ -1097,7 +983,7 @@ paths: type: object properties: batch_job: - $ref: '#/components/schemas/batch_job' + $ref: '#/components/schemas/BatchJob' '400': $ref: '#/components/responses/400_error' '401': @@ -1127,16 +1013,7 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: '#/components/schemas/AdminPostProductsToCollectionReq' x-codeSamples: - lang: Shell label: cURL @@ -1167,7 +1044,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1196,18 +1073,7 @@ paths: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: >- - An array of Product IDs to remove from the Product - Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: '#/components/schemas/AdminDeleteProductsFromCollectionReq' x-codeSamples: - lang: Shell label: cURL @@ -1272,23 +1138,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided - we will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCollectionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1334,7 +1184,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1492,7 +1342,7 @@ paths: collections: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' count: type: integer description: The total number of items available @@ -1635,7 +1485,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1664,21 +1514,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostCollectionsCollectionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1724,7 +1560,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -1754,20 +1590,8 @@ paths: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to add - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + #/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -1822,7 +1646,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -1851,20 +1675,8 @@ paths: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + #/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -1919,7 +1731,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -1984,7 +1796,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -2172,7 +1984,7 @@ paths: customer_groups: type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' count: type: integer description: The total number of items available @@ -2331,7 +2143,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -2360,14 +2172,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: Name of the customer group - type: string - metadata: - description: Metadata for the customer. - type: object + $ref: '#/components/schemas/AdminPostCustomerGroupsGroupReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2413,7 +2218,7 @@ paths: type: object properties: customer_group: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' '400': $ref: '#/components/responses/400_error' '401': @@ -2478,7 +2283,7 @@ paths: customers: type: array items: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' count: type: integer description: The total number of items available @@ -2500,52 +2305,137 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /apps/authorizations: - post: - operationId: PostApps - summary: Generate Token for App - description: Generates a token for an application. + /currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - application_name - - state - - code - properties: - application_name: - type: string - description: Name of the application for the token to be generated for. - state: - type: string - description: State of the application. - code: - type: string - description: The code for the generated token. + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/apps/authorizations' \ + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + currencies: + type: array + items: + $ref: '#/components/schemas/Currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '/currencies/{code}': + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCurrenciesCurrencyReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 '{ - "application_name": "example", - "state": "ready", - "code": "token" + "includes_tax": true }' - security: - - api_token: [] - - cookie_auth: [] tags: - - App + - Currency responses: '200': description: OK @@ -2554,61 +2444,8 @@ paths: schema: type: object properties: - apps: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /apps: - get: - operationId: GetApps - summary: List Applications - description: Retrieve a list of applications. - x-authenticated: true - x-codeSamples: - - lang: Shell - label: cURL - source: | - curl --location --request GET 'https://medusa-url.com/admin/apps' \ - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - App - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - apps: - type: array - items: - $ref: '#/components/schemas/OAuth' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' + currency: + $ref: '#/components/schemas/Currency' /customers: post: operationId: PostCustomers @@ -2619,35 +2456,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - first_name - - last_name - - password - properties: - email: - type: string - description: The customer's email. - format: email - first_name: - type: string - description: The customer's first name. - last_name: - type: string - description: The customer's last name. - password: - type: string - description: The customer's password. - format: password - phone: - type: string - description: The customer's phone number. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCustomersReq' tags: - Customer x-codeSamples: @@ -2699,7 +2508,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2779,7 +2588,7 @@ paths: customers: type: array items: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' count: type: integer description: The total number of items available @@ -2861,7 +2670,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2900,40 +2709,7 @@ paths: content: application/json: schema: - type: object - properties: - email: - type: string - description: The Customer's email. - format: email - first_name: - type: string - description: The Customer's first name. - last_name: - type: string - description: The Customer's last name. - phone: - type: string - description: The Customer's phone number. - password: - type: string - description: The Customer's password. - format: password - groups: - type: array - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - description: A list of customer groups to which the customer belongs. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostCustomersCustomerReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2979,866 +2755,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /draft-orders: - post: - operationId: PostDraftOrders - summary: Create a Draft Order - description: Creates a Draft Order - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - items - - region_id - - shipping_methods - properties: - status: - description: The status of the draft order - type: string - enum: - - open - - completed - email: - description: The email of the customer of the draft order - type: string - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - items: - description: The Line Items that have been received. - type: array - items: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line - Item from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details - about the Line Item. - type: object - region_id: - description: The ID of the region for the draft order - type: string - discounts: - description: The discounts to add on the draft order - type: array - items: - type: object - required: - - code - properties: - code: - description: The code of the discount to apply - type: string - customer_id: - description: The ID of the customer to add on the draft order - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - shipping_methods: - description: The shipping methods for the draft order - type: array - items: - type: object - required: - - option_id - properties: - option_id: - description: The ID of the shipping option in use - type: string - data: - description: >- - The optional additional data needed for the shipping - method - type: object - price: - description: The potential custom price of the shipping - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Draft Order. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_orders: - type: array - items: - $ref: '#/components/schemas/draft-order' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/draft-orders/{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: - type: object - required: - - quantity - properties: - variant_id: - description: >- - The ID of the Product Variant to generate the Line Item - from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - default: Custom item - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/draft-orders/{id}': - 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - 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 - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/draft-orders/{id}/line-items/{line_id}': - delete: - operationId: DeleteDraftOrdersDraftOrderLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Draft Order. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Draft Order. - schema: - type: string - - in: path - name: line_id - required: true - description: The ID of the Draft Order. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - 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: - type: object - properties: - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order: - $ref: '#/components/schemas/draft-order' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/admin/draft-orders/{id}': - 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: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Draft Order in. - country_code: - type: string - description: The 2 character ISO code for the Country. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Draft Order. - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address_fields' - - type: string - discounts: - description: An array of Discount codes to add to the Draft Order. - type: array - items: - type: object - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - customer_id: - description: The ID of the Customer to associate the Draft Order with. - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Order - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - draft_order: - $ref: '#/components/schemas/draft-order' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -3907,7 +2824,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3977,7 +2894,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -3993,7 +2910,7 @@ paths: '/discounts/{discount_id}/conditions/{condition_id}/batch': post: operationId: PostDiscountsDiscountConditionsConditionBatch - summary: Add a batch of resources to a discount condition + summary: Add Batch Resources description: Add a batch of resources to a discount condition. x-authenticated: true parameters: @@ -4027,20 +2944,8 @@ paths: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be added to the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -4088,7 +2993,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4103,7 +3008,7 @@ paths: $ref: '#/components/responses/500_error' delete: operationId: DeleteDiscountsDiscountConditionsConditionBatch - summary: Delete a batch of resources from a discount condition + summary: Delete Batch Resources description: Delete a batch of resources from a discount condition. x-authenticated: true parameters: @@ -4137,20 +3042,8 @@ paths: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be deleted from the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + #/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -4198,7 +3091,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4245,49 +3138,7 @@ paths: content: application/json: schema: - type: object - required: - - operator - properties: - operator: - description: Operator of the condition - type: string - enum: - - in - - not_in - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditions' x-codeSamples: - lang: JavaScript label: JS Client @@ -4335,7 +3186,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4371,144 +3222,7 @@ paths: content: application/json: schema: - type: object - required: - - code - - rule - - regions - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: boolean - description: >- - Whether the Discount should have multiple instances of - itself, each with a different code. This can be useful for - automatically generated codes that all have to follow a - common set of rules. - default: false - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - type - - value - - allocation - properties: - description: - type: string - description: A short description of the discount - type: - type: string - description: >- - The type of the Discount, can be `fixed` for discounts - that reduce the price by a fixed amount, `percentage` - for percentage reductions or `free_shipping` for - shipping vouchers. - enum: - - fixed - - percentage - - free_shipping - value: - type: number - description: >- - The value that the discount represents; this will depend - on the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, - and `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is - applied on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is - applied on product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is - applied on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - default: false - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - usage_limit: - type: number - description: Maximum times the discount can be used - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostDiscountsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4529,7 +3243,7 @@ paths: value: 10, allocation: AllocationType.ITEM }, - regions: ['reg_XXXXXXXX'], + regions: ["reg_XXXXXXXX"], is_dynamic: false, is_disabled: false }) @@ -4554,7 +3268,7 @@ paths: "value": 10, "allocation": "item" }, - "regions": ['reg_XXXXXXXX'] + "regions": ["reg_XXXXXXXX"] }' security: - api_token: [] @@ -4570,7 +3284,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4685,7 +3399,7 @@ paths: discounts: type: array items: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' count: type: integer description: The total number of items available @@ -4769,7 +3483,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4883,7 +3597,7 @@ paths: default: true discount: description: The Discount to which the condition used to belong - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -4962,7 +3676,7 @@ paths: type: object properties: discount_condition: - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' '400': $ref: '#/components/responses/400_error' '401': @@ -5014,41 +3728,8 @@ paths: content: application/json: schema: - type: object - properties: - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on - product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsCondition x-codeSamples: - lang: JavaScript label: JS Client @@ -5099,7 +3780,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5243,7 +3924,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5288,122 +3969,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostDiscountsDiscountReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5449,7 +4015,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5518,7 +4084,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5591,7 +4157,7 @@ paths: type: object properties: discount: - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' '400': $ref: '#/components/responses/400_error' '401': @@ -5616,34 +4182,7 @@ paths: content: application/json: schema: - type: object - required: - - region_id - properties: - value: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostGiftCardsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -5689,7 +4228,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -5764,7 +4303,7 @@ paths: gift_cards: type: array items: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' count: type: integer description: The total number of items available @@ -5907,7 +4446,7 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' '401': @@ -5938,32 +4477,7 @@ paths: content: application/json: schema: - type: object - properties: - balance: - type: integer - description: >- - The value (excluding VAT) that the Gift Card should - represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have - to enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: >- - The time at which the Gift Card should no longer be - available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6009,7 +4523,686 @@ paths: type: object properties: gift_card: - $ref: '#/components/schemas/gift_card' + $ref: '#/components/schemas/GiftCard' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /draft-orders: + post: + operationId: PostDraftOrders + summary: Create a Draft Order + description: Creates a Draft Order + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + 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 + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{id}': + 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + 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 + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{id}/line-items/{line_id}': + delete: + operationId: DeleteDraftOrdersDraftOrderLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order: + $ref: '#/components/schemas/DraftOrder' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/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}': + 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Order + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' '400': $ref: '#/components/responses/400_error' '401': @@ -6031,32 +5224,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostInvitesInviteAcceptReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6132,22 +5300,7 @@ paths: content: application/json: schema: - type: object - required: - - user - - role - properties: - user: - description: The email for the user to be created. - type: string - format: email - role: - description: The role of the user to be created. - type: string - enum: - - admin - - member - - developer + $ref: '#/components/schemas/AdminPostInvitesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6249,7 +5402,7 @@ paths: invites: type: array items: - $ref: '#/components/schemas/invite' + $ref: '#/components/schemas/Invite' '400': $ref: '#/components/responses/400_error' '401': @@ -6404,21 +5557,7 @@ paths: content: application/json: schema: - type: object - required: - - resource_id - - resource_type - - value - properties: - resource_id: - type: string - description: The ID of the resource which the Note relates to. - resource_type: - type: string - description: The type of resource which the Note relates to. - value: - type: string - description: The content of the Note to create. + $ref: '#/components/schemas/AdminPostNotesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6468,7 +5607,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6541,7 +5680,7 @@ paths: notes: type: array items: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' count: type: integer description: The total number of items available @@ -6684,7 +5823,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6713,13 +5852,7 @@ paths: content: application/json: schema: - type: object - required: - - value - properties: - value: - type: string - description: The updated description of the Note. + $ref: '#/components/schemas/AdminPostNotesNoteReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6765,7 +5898,7 @@ paths: type: object properties: note: - $ref: '#/components/schemas/note' + $ref: '#/components/schemas/Note' '400': $ref: '#/components/responses/400_error' '401': @@ -6878,7 +6011,7 @@ paths: notifications: type: array items: - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' '400': $ref: '#/components/responses/400_error' '401': @@ -6910,13 +6043,7 @@ paths: content: application/json: schema: - type: object - properties: - to: - description: >- - A new address or user identifier that the Notification - should be sent to - type: string + $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -6954,7 +6081,7 @@ paths: type: object properties: notification: - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' '400': $ref: '#/components/responses/400_error' '401': @@ -6967,6 +6094,840 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/cancel': + post: + operationId: PostOrderEditsOrderEditCancel + summary: Cancel an OrderEdit + description: Cancels an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + 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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits: + post: + operationId: PostOrderEdits + summary: Create an OrderEdit + description: Creates an OrderEdit. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsReq' + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetOrderEdits + summary: List OrderEdits + description: List OrderEdits. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching order edit internal note. + schema: + type: string + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edits: + type: array + $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 + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/items/{item_id}': + 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEditsEditLineItemsLineItem + summary: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Order Edit Item Change. + object: + type: string + description: The type of the object that was deleted. + format: item_change + deleted: + type: boolean + description: Whether or not the Order Edit Item Change was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '/order-edits/{id}': + delete: + operationId: DeleteOrderEditsOrderEdit + summary: Delete an Order Edit + description: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Order Edit. + object: + type: string + description: The type of the object that was deleted. + format: order_edit + deleted: + type: boolean + description: Whether or not the Order Edit was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetOrderEditsOrderEdit + summary: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' '/orders/{id}/shipping-methods': post: operationId: PostOrdersOrderShippingMethods @@ -7030,7 +6991,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7118,7 +7079,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7188,7 +7149,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7265,7 +7226,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7342,7 +7303,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7412,7 +7373,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7478,7 +7439,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7548,7 +7509,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7611,7 +7572,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7674,7 +7635,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7710,18 +7671,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -7768,7 +7718,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -7798,126 +7748,7 @@ paths: content: application/json: schema: - type: object - required: - - type - - claim_items - properties: - type: - description: >- - The type of the Claim. This will determine how the Claim is - treated: `replace` Claims will result in a Fulfillment with - new items being created, while a `refund` Claim will refund - the amount paid for the claimed items. - type: string - enum: - - replace - - refund - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: string - images: - description: >- - A list of image URL's that will be associated with the - Claim - items: - type: string - return_shipping: - description: >- - Optional details for the Return Shipping Method, if the - items are to be sent back. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - shipping_address: - type: object - description: >- - An optional shipping address to send the claim to. Defaults - to the parent order's shipping address - $ref: '#/components/schemas/address' - refund_amount: - description: >- - The amount to refund the Customer when the Claim type is - `refund`. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -7975,7 +7806,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8007,34 +7838,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items to include in the Fulfillment. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of Line Item to fulfill. - type: string - quantity: - description: The quantity of the Line Item to fulfill. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderFulfillmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8090,7 +7894,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8120,23 +7924,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Shipment. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderShipmentReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8182,7 +7970,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8218,23 +8006,7 @@ paths: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be sent related to this - Claim. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8281,7 +8053,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8313,85 +8085,7 @@ paths: content: application/json: schema: - type: object - required: - - return_items - properties: - return_items: - description: The Line Items to return as part of the Swap. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - return_shipping: - description: How the Swap will be returned. - type: object - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: The new items to send to the Customer. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - custom_shipping_options: - description: >- - The custom shipping options to potentially create a Shipping - Method from. - type: array - items: - required: - - option_id - - price - properties: - option_id: - description: >- - The ID of the Shipping Option to override with a - custom price. - type: string - price: - description: The custom price of the Shipping Option. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - allow_backorder: - description: 'If true, swaps can be completed with items out of stock' - type: boolean - default: true + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8447,7 +8141,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8483,18 +8177,8 @@ paths: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + #/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -8533,7 +8217,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8569,18 +8253,8 @@ paths: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + #/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -8619,7 +8293,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8682,7 +8356,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -8711,71 +8385,7 @@ paths: content: application/json: schema: - type: object - properties: - email: - description: the email for the order - type: string - billing_address: - description: Billing address - anyOf: - - $ref: '#/components/schemas/address_fields' - shipping_address: - description: Shipping address - anyOf: - - $ref: '#/components/schemas/address_fields' - items: - description: The Line Items for the order - type: array - items: - $ref: '#/components/schemas/line_item' - region: - description: ID of the region where the order belongs - type: string - discounts: - description: Discounts applied to the order - type: array - items: - $ref: '#/components/schemas/discount' - customer_id: - description: ID of the customer - type: string - payment_method: - description: payment method chosen for the order - type: object - properties: - provider_id: - type: string - description: ID of the payment provider - data: - description: Data relevant for the given payment method - type: object - shipping_method: - description: The Shipping Method used for shipping the order. - type: object - properties: - provider_id: - type: string - description: The ID of the shipping provider. - profile_id: - type: string - description: The ID of the shipping profile. - price: - type: integer - description: The price of the shipping. - data: - type: object - description: Data relevant to the specific shipping method. - items: - type: array - items: - $ref: '#/components/schemas/line_item' - description: Items to ship - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the updated order. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -8821,7 +8431,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9093,7 +8703,7 @@ paths: orders: type: array items: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' count: type: integer description: The total number of items available @@ -9175,7 +8785,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9205,25 +8815,7 @@ paths: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Refund. - type: boolean + $ref: '#/components/schemas/AdminPostOrdersOrderRefundsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9271,7 +8863,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9303,61 +8895,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that will be returned. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - return_shipping: - description: >- - The Shipping Method to be used to handle the return - shipment. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - note: - description: An optional note with information about the Return. - 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 + $ref: '#/components/schemas/AdminPostOrdersOrderReturnsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9414,7 +8952,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9450,96 +8988,7 @@ paths: content: application/json: schema: - type: object - properties: - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - id - - images - - tags - properties: - id: - description: The ID of the Claim Item. - type: string - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: object - properties: - id: - type: string - description: Tag ID - value: - type: string - description: Tag value - images: - description: >- - A list of image URL's that will be associated with the - Claim - type: array - items: - type: object - properties: - id: - type: string - description: Image ID - url: - type: string - description: Image URL - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -9585,7 +9034,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -9598,878 +9047,10 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/items': - post: - operationId: PostOrderEditsEditLineItems - summary: Add an line item to an order (edit) - description: Create an OrderEdit LineItem. - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the variant ID to add - type: string - quantity: - description: The quantity to add - type: number - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/cancel': - post: - operationId: PostOrderEditsOrderEditCancel - summary: Cancel an OrderEdit - description: Cancels an OrderEdit. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the OrderEdit. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - 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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '500': - $ref: '#/components/responses/500_error' - '/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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '500': - $ref: '#/components/responses/500_error' - /order-edits: - post: - operationId: PostOrderEdits - summary: Create an OrderEdit - description: Creates an OrderEdit. - requestBody: - content: - application/json: - schema: - type: object - required: - - order_id - properties: - order_id: - description: The ID of the order to create the edit for. - type: string - internal_note: - description: An optional note to create for the order edit. - type: string - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetOrderEdits - summary: List OrderEdits - description: List OrderEdits. - x-authenticated: true - parameters: - - in: query - name: q - description: Query used for searching order edit internal note. - schema: - type: string - - in: query - name: order_id - description: List order edits by order id. - schema: - type: string - - in: query - name: limit - description: The number of items in the response - schema: - type: number - default: '20' - - in: query - name: offset - description: The offset of items in response - schema: - type: number - default: '0' - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edits: - type: array - $ref: '#/components/schemas/order_edit' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/items/{item_id}': - delete: - operationId: DeleteOrderEditsOrderEditLineItemsLineItem - summary: Delete line items from an order edit and create change item - description: Delete line items from an order edit and create change item - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to delete from. - schema: - type: string - - in: path - name: item_id - required: true - description: The ID of the order edit item to delete from order. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostOrderEditsEditLineItemsLineItem - summary: Create or update the order edit change holding the line item changes - description: Create or update the order edit change holding the line item changes - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to update. - schema: - type: string - - in: path - name: item_id - required: true - description: The ID of the order edit item to update. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - description: The quantity to update - type: number - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/changes/{change_id}': - delete: - operationId: DeleteOrderEditsOrderEditItemChange - summary: Delete an Order Edit Item Change - description: Deletes an Order Edit Item Change - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to delete. - schema: - type: string - - in: path - name: change_id - required: true - description: The ID of the Order Edit Item Change to delete. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Order Edit Item Change. - object: - type: string - description: The type of the object that was deleted. - format: item_change - deleted: - type: boolean - description: Whether or not the Order Edit Item Change was deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - '/order-edits/{id}': - delete: - operationId: DeleteOrderEditsOrderEdit - summary: Delete an Order Edit - description: Deletes an Order Edit - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to delete. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - 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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Order Edit. - object: - type: string - description: The type of the object that was deleted. - format: order_edit - deleted: - type: boolean - description: Whether or not the Order Edit was deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - get: - operationId: GetOrderEditsOrderEdit - summary: Retrieve an OrderEdit - description: Retrieves a OrderEdit. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the OrderEdit. - schema: - type: string - - in: query - name: expand - description: Comma separated list of relations to include in the results. - schema: - type: string - - in: query - name: fields - description: Comma separated list of fields to include in the results. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - 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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostOrderEditsOrderEdit - summary: Updates an OrderEdit - description: Updates a OrderEdit. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the OrderEdit. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - properties: - internal_note: - description: An optional note to create or update for the order edit. - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/order-edits/{id}/request': - post: - operationId: PostOrderEditsOrderEditRequest - summary: Request order edit confirmation - description: Request customer confirmation of an Order Edit - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Order Edit to request confirmation from. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.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: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '500': - $ref: '#/components/responses/500_error' '/payment-collections/{id}': delete: operationId: DeletePaymentCollectionsPaymentCollection - summary: Delete a Payment Collection + summary: Del a PaymentCollection description: Deletes a Payment Collection x-authenticated: true parameters: @@ -10531,7 +9112,7 @@ paths: $ref: '#/components/responses/unauthorized' get: operationId: GetPaymentCollectionsPaymentCollection - summary: Retrieve an PaymentCollection + summary: Get a PaymentCollection description: Retrieves a PaymentCollection. x-authenticated: true parameters: @@ -10587,7 +9168,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -10602,7 +9183,7 @@ paths: $ref: '#/components/responses/500_error' post: operationId: PostPaymentCollectionsPaymentCollection - summary: Updates a PaymentCollection + summary: Update PaymentCollection description: Updates a PaymentCollection. x-authenticated: true parameters: @@ -10616,18 +9197,7 @@ paths: content: application/json: schema: - type: object - properties: - description: - description: >- - An optional description to create or update the payment - collection. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: '#/components/schemas/AdminUpdatePaymentCollectionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -10672,7 +9242,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -10688,7 +9258,7 @@ paths: '/payment-collections/{id}/authorize': post: operationId: PostPaymentCollectionsPaymentCollectionAuthorize - summary: Set the status of PaymentCollection as Authorized + summary: Mark Authorized description: Sets the status of PaymentCollection as Authorized. x-authenticated: true parameters: @@ -10734,226 +9304,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - payment: - $ref: '#/components/schemas/payment' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - payment: - $ref: '#/components/schemas/payment' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/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: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - refund: - $ref: '#/components/schemas/refund' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -10983,50 +9334,7 @@ paths: content: application/json: schema: - type: object - properties: - prices: - description: The prices to update or add. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - override: - description: >- - If true the prices will replace all existing prices - associated with the Price List. - type: boolean + $ref: '#/components/schemas/AdminPostPriceListPricesPricesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11084,7 +9392,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11115,13 +9423,7 @@ paths: content: application/json: schema: - type: object - properties: - price_ids: - description: The price id's of the Money Amounts to delete. - type: array - items: - type: string + $ref: '#/components/schemas/AdminDeletePriceListPricesPricesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11205,88 +9507,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - description - - type - - prices - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - variant_id: - description: The ID of the Variant for which the price is used. - type: string - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: '#/components/schemas/AdminPostPriceListsPriceListReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11352,7 +9573,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11550,7 +9771,7 @@ paths: price_lists: type: array items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' count: type: integer description: The total number of items available @@ -11693,7 +9914,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -11722,86 +9943,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: >- - The date with timezone that the Price List starts being - valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: '#/components/schemas/AdminPostPriceListsPriceListPriceListReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -11847,7 +9989,7 @@ paths: type: object properties: price_list: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' '400': $ref: '#/components/responses/400_error' '401': @@ -12246,162 +10388,7 @@ paths: products: type: array items: - $ref: '#/components/schemas/product' - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /product-tags: - get: - operationId: GetProductTags - summary: List Product Tags - description: Retrieve a list of Product Tags. - x-authenticated: true - parameters: - - in: query - name: limit - description: The number of tags to return. - schema: - type: integer - default: 10 - - in: query - name: offset - description: The number of items to skip before the results. - schema: - type: integer - default: 0 - - in: query - name: order - description: The field to sort items by. - schema: - type: string - - in: query - name: discount_condition_id - description: The discount condition id on which to filter the tags. - schema: - type: string - - in: query - name: value - style: form - explode: false - description: The tag values to search for - schema: - type: array - items: - type: string - - in: query - name: q - description: A query string to search values for - schema: - type: string - - in: query - name: id - style: form - explode: false - description: The tag IDs to search for - schema: - type: array - items: - type: string - - in: query - name: created_at - description: Date comparison for when resulting product tags were created. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - - in: query - name: updated_at - description: Date comparison for when resulting product tags were updated. - schema: - type: object - properties: - lt: - type: string - description: filter by dates less than this date - format: date - gt: - type: string - description: filter by dates greater than this date - format: date - lte: - type: string - description: filter by dates less than or equal to this date - format: date - gte: - type: string - description: filter by dates greater than or equal to this date - format: date - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.productTags.list() - - .then(({ product_tags }) => { - console.log(product_tags.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/product-tags' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Product Tag - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - product_tags: - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/Product' count: type: integer description: The total number of items available @@ -12556,7 +10543,162 @@ paths: type: object properties: product_types: - $ref: '#/components/schemas/product_type' + $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 + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-tags: + get: + operationId: GetProductTags + summary: List Product Tags + description: Retrieve a list of Product Tags. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of tags to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the tags. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The tag values to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: id + style: form + explode: false + description: The tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product tags were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product tags were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productTags.list() + + .then(({ product_tags }) => { + console.log(product_tags.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/product-tags' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Tag + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + product_tags: + $ref: '#/components/schemas/ProductTag' count: type: integer description: The total number of items available @@ -12595,15 +10737,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: >- - The title the Product Option will be identified by i.e. - "Size" - type: string + $ref: '#/components/schemas/AdminPostProductsProductOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -12649,7 +10783,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -12672,244 +10806,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - is_giftcard: - description: >- - A flag to indicate if the Product represents a Gift Card. - Purchasing Products with this flag set to `true` will result - in a Gift Card being created. - type: boolean - default: false - discountable: - description: >- - A flag to indicate if discounts can be applied to the - LineItems generated from this Product - type: boolean - default: true - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - default: draft - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - options: - description: >- - The Options that the Product should have. These define on - which properties the Product's Product Variants will differ. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Option by. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - value - properties: - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The weight of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -12957,7 +10854,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13172,6 +11069,11 @@ paths: the result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -13211,7 +11113,7 @@ paths: products: type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' count: type: integer description: The total number of items available @@ -13252,117 +11154,7 @@ paths: content: application/json: schema: - type: object - required: - - title - - prices - - options - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: '#/components/schemas/AdminPostProductsProductVariantsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -13433,7 +11225,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13504,7 +11296,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' count: type: integer description: The total number of items available @@ -13597,7 +11389,7 @@ paths: description: Whether or not the items were deleted. default: true product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13632,13 +11424,7 @@ paths: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product Option - type: string + $ref: '#/components/schemas/AdminPostProductsProductOptionsOption' x-codeSamples: - lang: JavaScript label: JS Client @@ -13684,7 +11470,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13818,7 +11604,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -13847,225 +11633,7 @@ paths: content: application/json: schema: - 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: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: 'The value of the Tag, these will be upserted.' - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - properties: - id: - description: The ID of the Product Variant. - type: string - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out - of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for - this Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the Price. - type: string - region_id: - description: >- - The ID of the Region for which the price is - used. Only required if currency_code is not - provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id - is not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Option. - type: string - value: - description: >- - The value to give for the Product Option at the - same index in the Product's `options` field. - type: string - weight: - description: The wieght of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostProductsProductReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14112,7 +11680,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14192,7 +11760,7 @@ paths: description: Whether or not the items were deleted. default: true product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14227,114 +11795,7 @@ paths: content: application/json: schema: - type: object - required: - - prices - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The weight of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: '#/components/schemas/AdminPostProductsProductVariantsVariantReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14399,7 +11860,7 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' '400': $ref: '#/components/responses/400_error' '401': @@ -14525,7 +11986,7 @@ paths: types: type: array items: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' '400': $ref: '#/components/responses/400_error' '401': @@ -14555,17 +12016,7 @@ paths: content: application/json: schema: - type: object - required: - - key - - value - properties: - key: - description: The metadata key - type: string - value: - description: The metadata value - type: string + $ref: '#/components/schemas/AdminPostProductsProductMetadataReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -14614,7 +12065,213 @@ paths: type: object properties: product: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: '#/components/schemas/Payment' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment: + $ref: '#/components/schemas/Payment' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + refund: + $ref: '#/components/schemas/Refund' '400': $ref: '#/components/responses/400_error' '401': @@ -14630,7 +12287,7 @@ paths: '/publishable-api-keys/{id}/sales-channels/batch': post: operationId: PostPublishableApiKeySalesChannelsChannelsBatch - summary: Add sales channel to a publishable api key scope + summary: Add SalesChannels description: Assign a batch of sales channels to a publishable api key. x-authenticated: true parameters: @@ -14644,22 +12301,8 @@ paths: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to add to the publishable api - key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + #/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -14713,7 +12356,7 @@ paths: schema: properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14728,7 +12371,7 @@ paths: $ref: '#/components/responses/500_error' delete: operationId: DeletePublishableApiKeySalesChannelsChannelsBatch - summary: Remove sales channel from a publishable api key scope + summary: Delete SalesChannels description: Remove a batch of sales channels from a publishable api key. x-authenticated: true parameters: @@ -14742,22 +12385,8 @@ paths: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to delete from the publishable - api key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + #/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -14811,7 +12440,7 @@ paths: schema: properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14827,19 +12456,13 @@ paths: /publishable-api-keys: post: operationId: PostPublishableApiKeys - summary: Create a PublishableApiKey + summary: Create PublishableApiKey description: Creates a PublishableApiKey. requestBody: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: A title for the publishable api key - type: string + $ref: '#/components/schemas/AdminPostPublishableApiKeysReq' x-authenticated: true x-codeSamples: - lang: JavaScript @@ -14879,7 +12502,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14962,7 +12585,7 @@ paths: properties: publishable_api_keys: type: array - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -14978,7 +12601,7 @@ paths: '/publishable-api-keys/{id}': delete: operationId: DeletePublishableApiKeysPublishableApiKey - summary: Delete a PublishableApiKey + summary: Delete PublishableApiKey description: Deletes a PublishableApiKeys x-authenticated: true parameters: @@ -15038,7 +12661,7 @@ paths: $ref: '#/components/responses/400_error' get: operationId: GetPublishableApiKeysPublishableApiKey - summary: Get a Publishable API Key + summary: Get a PublishableApiKey description: Retrieve the Publishable Api Key. parameters: - in: path @@ -15086,7 +12709,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15102,7 +12725,7 @@ paths: '/publishable-api-keys/{id}/sales-channels': get: operationId: GetPublishableApiKeySalesChannels - summary: List PublishableApiKey's SalesChannels + summary: List SalesChannels description: List PublishableApiKey's SalesChannels x-authenticated: true parameters: @@ -15112,6 +12735,11 @@ paths: 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-codeSamples: - lang: JavaScript label: JS Client @@ -15150,7 +12778,7 @@ paths: sales_channels: type: array items: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -15166,7 +12794,7 @@ paths: '/publishable-api-keys/{id}/revoke': post: operationId: PostPublishableApiKeysPublishableApiKeyRevoke - summary: Revoke a PublishableApiKey + summary: Revoke PublishableApiKey description: Revokes a PublishableApiKey. parameters: - in: path @@ -15215,7 +12843,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15231,7 +12859,7 @@ paths: '/publishable-api-key/{id}': post: operationId: PostPublishableApiKysPublishableApiKey - summary: Updates a PublishableApiKey + summary: Update PublishableApiKey description: Updates a PublishableApiKey. x-authenticated: true parameters: @@ -15245,11 +12873,8 @@ paths: content: application/json: schema: - type: object - properties: - title: - description: A title to update for the key. - type: string + $ref: >- + #/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq x-codeSamples: - lang: JavaScript label: JS Client @@ -15294,7 +12919,7 @@ paths: type: object properties: publishable_api_key: - $ref: '#/components/schemas/publishable_api_key' + $ref: '#/components/schemas/PublishableApiKey' '400': $ref: '#/components/responses/400_error' '401': @@ -15324,17 +12949,7 @@ paths: content: application/json: schema: - type: object - required: - - country_code - properties: - country_code: - description: The 2 character ISO code for the Country. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. + $ref: '#/components/schemas/AdminPostRegionsRegionCountriesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15380,7 +12995,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15410,13 +13025,8 @@ paths: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Fulfillment Provider to add. - type: string + $ref: >- + #/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq x-codeSamples: - lang: JavaScript label: JS Client @@ -15462,7 +13072,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15492,13 +13102,7 @@ paths: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Payment Provider to add. - type: string + $ref: '#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15544,7 +13148,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15567,56 +13171,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - currency_code - - tax_rate - - payment_providers - - fulfillment_providers - - countries - properties: - name: - description: The name of the Region - type: string - currency_code: - description: The 3 character ISO currency code to use for the Region. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - tax_code: - description: An optional tax code the Region. - 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 + $ref: '#/components/schemas/AdminPostRegionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -15684,7 +13239,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15780,7 +13335,7 @@ paths: regions: type: array items: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' count: type: integer description: The total number of items available @@ -15923,7 +13478,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -15952,63 +13507,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Region - type: string - currency_code: - description: The 3 character ISO currency code to use for the Region. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - automatic_taxes: - description: >- - If true Medusa will automatically calculate taxes for carts - in this region. If false you have to manually call POST - /carts/:id/taxes. - type: boolean - gift_cards_taxable: - description: >- - Whether gift cards in this region should be applied sales - tax when purchasing a gift card - type: boolean - tax_provider_id: - description: >- - The ID of the tax provider to use; if null the system tax - provider is used - type: string - tax_code: - description: An optional tax code the Region. - type: string - tax_rate: - description: The tax rate to use on Orders in the Region. - type: number - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean - payment_providers: - description: >- - A list of Payment Provider IDs that should be enabled for - the Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled - for the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be - included in the Region. - type: array - items: - type: string + $ref: '#/components/schemas/AdminPostRegionsRegionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16054,7 +13553,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16201,7 +13700,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16271,7 +13770,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16341,7 +13840,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '401': @@ -16364,30 +13863,7 @@ paths: content: application/json: schema: - type: object - required: - - label - - value - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - parent_return_reason_id: - description: The ID of the parent return reason. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostReturnReasonsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16435,7 +13911,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16492,7 +13968,7 @@ paths: return_reasons: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16626,7 +14102,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16655,24 +14131,7 @@ paths: content: application/json: schema: - type: object - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostReturnReasonsReasonReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16718,7 +14177,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '401': @@ -16748,21 +14207,8 @@ paths: content: application/json: schema: - 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 + $ref: >- + #/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -16816,7 +14262,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -16845,21 +14291,8 @@ paths: content: application/json: schema: - 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 + $ref: >- + #/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -16913,7 +14346,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -16936,19 +14369,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostSalesChannelsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -16995,7 +14416,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17170,7 +14591,7 @@ paths: sales_channels: type: array items: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' count: type: integer description: The total number of items available @@ -17313,7 +14734,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17342,17 +14763,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - type: string - description: Name of the sales channel. - description: - type: string - description: Sales Channel description. - is_disabled: - type: boolean - description: Indication of if the sales channel is active. + $ref: '#/components/schemas/AdminPostSalesChannelsSalesChannelReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -17398,7 +14809,7 @@ paths: type: object properties: sales_channel: - $ref: '#/components/schemas/sales_channel' + $ref: '#/components/schemas/SalesChannel' '400': $ref: '#/components/responses/400_error' '401': @@ -17460,7 +14871,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '401': @@ -17530,7 +14941,7 @@ paths: returns: type: array items: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' count: type: integer description: The total number of items available @@ -17570,27 +14981,7 @@ paths: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that have been received. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: number + $ref: '#/components/schemas/AdminPostReturnsReturnReceiveReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -17646,7 +15037,7 @@ paths: type: object properties: return: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' '400': $ref: '#/components/responses/400_error' '401': @@ -17669,81 +15060,7 @@ paths: content: application/json: schema: - type: object - required: - - name - - region_id - - provider_id - - data - - price_type - properties: - name: - description: The name of the Shipping Option - type: string - region_id: - description: >- - The ID of the Region in which the Shipping Option will be - available. - type: string - provider_id: - description: >- - The ID of the Fulfillment Provider that handles the Shipping - Option. - type: string - profile_id: - description: >- - The ID of the Shipping Profile to add the Shipping Option - to. - type: number - data: - description: >- - The data needed for the Fulfillment Provider to handle - shipping with this Shipping Option. - type: object - price_type: - description: The type of the Shipping Option price. - type: string - enum: - - flat_rate - - calculated - amount: - description: The amount to charge for the Shipping Option. - type: integer - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - is_return: - description: Whether the Shipping Option defines a return shipment. - type: boolean - default: false - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - default: false - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: '#/components/schemas/AdminPostShippingOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -17798,7 +15115,7 @@ paths: type: object properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '401': @@ -17871,7 +15188,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' count: type: integer description: The total number of items available @@ -18008,7 +15325,7 @@ paths: type: object properties: shipping_option: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '401': @@ -18037,49 +15354,7 @@ paths: content: application/json: schema: - type: object - required: - - requirements - properties: - name: - description: The name of the Shipping Option - type: string - amount: - description: The amount to charge for the Shipping Option. - type: integer - admin_only: - description: 'If true, the option can be used for draft orders' - type: boolean - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - requirements: - description: >- - The requirements that must be satisfied for the Shipping - Option to be available. - type: array - items: - required: - - type - - amount - properties: - id: - description: The ID of the requirement - type: string - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: '#/components/schemas/AdminPostShippingOptionsOptionReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -18137,351 +15412,7 @@ paths: type: object properties: shipping_option: - $ref: '#/components/schemas/shipping_option' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /shipping-profiles: - post: - operationId: PostShippingProfiles - summary: Create a Shipping Profile - description: Creates a Shipping Profile - x-authenticated: true - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - description: The name of the Shipping Profile - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: GetShippingProfiles - summary: List Shipping Profiles - description: Retrieves a list of Shipping Profile. - x-authenticated: true - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.admin.shippingProfiles.list() - - .then(({ shipping_profiles }) => { - console.log(shipping_profiles.length); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles' \ - - --header 'Authorization: Bearer {api_token}' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Shipping Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profiles: - type: array - items: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/shipping-profiles/{id}': - delete: - operationId: DeleteShippingProfilesProfile - summary: Delete a Shipping Profile - description: Deletes a Shipping Profile. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Shipping Profile. - 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.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 Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - id: - type: string - description: The ID of the deleted Shipping Profile. - object: - type: string - description: The type of the object that was deleted. - default: shipping_profile - deleted: - type: boolean - description: Whether or not the items were deleted. - default: true - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - get: - operationId: 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-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@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 Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - 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: - type: object - properties: - name: - description: The name of the Shipping Profile - 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.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 Profile - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - shipping_profile: - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '401': @@ -18547,7 +15478,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18612,7 +15543,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18666,7 +15597,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18688,42 +15619,7 @@ paths: content: application/json: schema: - type: object - properties: - name: - description: The name of the Store - type: string - swap_link_template: - description: >- - A template for Swap links - use `{{cart_id}}` to insert the - Swap Cart id - type: string - payment_link_template: - description: >- - A template for payment links links - use `{{cart_id}}` to - insert the Cart id - type: string - invite_link_template: - description: >- - A template for invite links - use `{{invite_token}}` to - insert the invite token - type: string - default_currency_code: - description: The default currency code for the Store. - type: string - externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' - description: See a list of codes. - currencies: - description: Array of currencies in 2 character ISO code format. - type: array - items: - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object + $ref: '#/components/schemas/AdminPostStoreReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -18769,7 +15665,7 @@ paths: type: object properties: store: - $ref: '#/components/schemas/store' + $ref: '#/components/schemas/Store' '400': $ref: '#/components/responses/400_error' '401': @@ -18827,7 +15723,7 @@ paths: payment_providers: type: array items: - $ref: '#/components/schemas/payment_provider' + $ref: '#/components/schemas/PaymentProvider' '400': $ref: '#/components/responses/400_error' '401': @@ -18885,7 +15781,7 @@ paths: tax_providers: type: array items: - $ref: '#/components/schemas/tax_provider' + $ref: '#/components/schemas/TaxProvider' '400': $ref: '#/components/responses/400_error' '401': @@ -18948,7 +15844,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '401': @@ -19017,7 +15913,7 @@ paths: swaps: type: array items: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' count: type: integer description: The total number of items available @@ -19074,17 +15970,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19134,7 +16020,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19181,17 +16067,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19241,7 +16117,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19289,15 +16165,7 @@ paths: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: The IDs of the products to associate with this tax rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19347,7 +16215,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19394,17 +16262,7 @@ paths: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: >- - The IDs of the products to remove association with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19454,7 +16312,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19502,17 +16360,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19563,7 +16411,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19610,17 +16458,8 @@ paths: content: application/json: schema: - 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 + $ref: >- + #/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq x-codeSamples: - lang: JavaScript label: JS Client @@ -19671,7 +16510,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19713,43 +16552,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminPostTaxRatesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -19799,7 +16602,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -19930,7 +16733,7 @@ paths: tax_rates: type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' count: type: integer description: The total number of items available @@ -20091,7 +16894,7 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' '400': $ref: '#/components/responses/400_error' '401': @@ -20138,39 +16941,7 @@ paths: content: application/json: schema: - type: object - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: >- - The IDs of the shipping options associated with this tax - rate - items: - type: string - product_types: - type: array - description: >- - The IDs of the types of products associated with this tax - rate - items: - type: string + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -20216,7 +16987,341 @@ paths: type: object properties: tax_rate: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /shipping-profiles: + 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingProfiles + summary: List Shipping Profiles + description: Retrieves a list of Shipping Profile. + x-authenticated: true + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.list() + + .then(({ shipping_profiles }) => { + console.log(shipping_profiles.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profiles: + type: array + items: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/shipping-profiles/{id}': + delete: + operationId: DeleteShippingProfilesProfile + summary: Delete a Shipping Profile + description: Deletes a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + 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.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 Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Shipping Profile. + object: + type: string + description: The type of the object that was deleted. + default: shipping_profile + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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 Profile + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' '400': $ref: '#/components/responses/400_error' '401': @@ -20232,10 +17337,10 @@ paths: /uploads/protected: post: operationId: PostUploadsProtected - summary: Upload files with acl or in a non-public bucket + summary: Protected File Upload description: >- - Uploads at least one file to the specific fileservice that is installed - in Medusa. + 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: @@ -20399,32 +17504,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminCreateUserRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20472,7 +17552,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20527,7 +17607,7 @@ paths: users: type: array items: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20661,7 +17741,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20690,29 +17770,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminUpdateUserRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20758,7 +17816,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -20781,14 +17839,7 @@ paths: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The Users email. - type: string - format: email + $ref: '#/components/schemas/AdminResetPasswordTokenRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20854,22 +17905,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminResetPasswordRequest' x-codeSamples: - lang: JavaScript label: JS Client @@ -20917,7 +17953,7 @@ paths: type: object properties: user: - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/400_error' '401': @@ -21067,7 +18103,7 @@ paths: variants: type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' count: type: integer description: The total number of items available @@ -21096,7 +18132,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: An unknown error occurred. @@ -21106,7 +18142,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: >- @@ -21118,7 +18154,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: invalid_request_error message: Discount with code TEST already exists. @@ -21128,7 +18164,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: message: Entity with id 1 was not found type: not_found @@ -21138,21 +18174,21 @@ components: application/json: schema: oneOf: - - $ref: '#/components/schemas/error' - - $ref: '#/components/schemas/multiple_errors' + - $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' - multiple_errors: + MultipleErrors: $ref: '#/components/examples/multiple_errors' 500_error: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' examples: database: $ref: '#/components/examples/database_error' @@ -21363,10 +18399,9 @@ components: Where `{sid}` is the value of `connect.sid` that you copied. schemas: - address_fields: + AddressFields: title: Address Fields description: Address fields used when creating/updating an address. - x-resourceId: address type: object properties: company: @@ -21418,10 +18453,9 @@ components: description: An optional key-value map with additional details example: car: white - address: + Address: title: Address description: An address. - x-resourceId: address type: object properties: id: @@ -21502,10 +18536,9 @@ components: description: An optional key-value map with additional details example: car: white - batch_job: + BatchJob: title: Batch Job description: A Batch Job. - x-resourceId: batch_job type: object required: - type @@ -21645,10 +18678,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - cart: + Cart: title: Cart description: Represents a user cart - x-resourceId: cart type: object properties: id: @@ -21665,19 +18697,19 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' region_id: type: string description: The region's ID @@ -21706,24 +18738,24 @@ components: type: object payment_session: description: The selected payment session in the cart. - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' type: type: string description: The cart's type. @@ -21823,10 +18855,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - claim_image: + ClaimImage: title: Claim Image description: Represents photo documentation of a claim. - x-resourceId: claim_image type: object required: - claim_item_id @@ -21865,12 +18896,11 @@ components: description: An optional key-value map with additional details example: car: white - claim_item: + ClaimItem: title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. - x-resourceId: claim_item type: object required: - claim_order_id @@ -21887,7 +18917,7 @@ components: type: array description: Available if the relation `images` is expanded. items: - $ref: '#/components/schemas/claim_image' + $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -21902,7 +18932,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. type: string @@ -21934,7 +18964,7 @@ components: relation 'tags' is expanded. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: '#/components/schemas/ClaimTag' created_at: type: string description: The date with timezone at which the resource was created. @@ -21952,13 +18982,12 @@ components: description: An optional key-value map with additional details example: car: white - claim_order: + 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. - x-resourceId: claim_order type: object required: - type @@ -21998,14 +19027,14 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $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/line_item' + $ref: '#/components/schemas/LineItem' order_id: description: The ID of the order that the claim comes from. type: string @@ -22024,17 +19053,17 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer @@ -22075,12 +19104,11 @@ components: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - claim_tag: + ClaimTag: title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. - x-resourceId: claim_tag type: object required: - value @@ -22110,10 +19138,9 @@ components: description: An optional key-value map with additional details example: car: white - country: + Country: title: Country description: Country details - x-resourceId: country type: object required: - iso_2 @@ -22165,10 +19192,9 @@ components: region: description: A region object. Available if the relation `region` is expanded. type: object - currency: + Currency: title: Currency description: Currency - x-resourceId: currency type: object required: - code @@ -22198,13 +19224,12 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean - custom_shipping_option: + 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 - x-resourceId: custom_shipping_option type: object required: - price @@ -22260,10 +19285,9 @@ components: [EXPERIMENTAL] Indicates if the custom shipping option price include tax type: boolean - customer_group: + CustomerGroup: title: Customer Group description: Represents a customer group - x-resourceId: customer_group type: object required: - name @@ -22290,7 +19314,7 @@ components: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' created_at: type: string description: The date with timezone at which the resource was created. @@ -22308,10 +19332,9 @@ components: description: An optional key-value map with additional details example: car: white - customer: + Customer: title: Customer description: Represents a customer - x-resourceId: customer type: object required: - email @@ -22338,12 +19361,12 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' phone: type: string description: The customer's phone number @@ -22364,7 +19387,7 @@ components: relation `groups` is expanded. type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' created_at: type: string description: The date with timezone at which the resource was created. @@ -22382,10 +19405,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_customer_group: + DiscountConditionCustomerGroup: title: Product Tag Discount Condition description: Associates a discount condition with a customer group - x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -22401,10 +19423,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22418,10 +19440,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_collection: + DiscountConditionProductCollection: title: Product Collection Discount Condition description: Associates a discount condition with a product collection - x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -22437,10 +19458,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22454,10 +19475,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_tag: + DiscountConditionProductTag: title: Product Tag Discount Condition description: Associates a discount condition with a product tag - x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -22473,10 +19493,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22490,10 +19510,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_type: + DiscountConditionProductType: title: Product Type Discount Condition description: Associates a discount condition with a product type - x-resourceId: discount_condition_product type: object required: - product_type_id @@ -22509,10 +19528,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22526,10 +19545,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product: + DiscountConditionProduct: title: Product Discount Condition description: Associates a discount condition with a product - x-resourceId: discount_condition_product type: object required: - product_id @@ -22545,10 +19563,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -22562,10 +19580,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition: + DiscountCondition: title: Discount Condition description: Holds rule conditions for when a discount is applicable - x-resourceId: discount_condition type: object required: - type @@ -22597,7 +19614,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' products: description: >- products associated with this condition if type = products. @@ -22658,12 +19675,11 @@ components: description: An optional key-value map with additional details example: car: white - discount_rule: + DiscountRule: title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. - x-resourceId: discount_rule type: object required: - type @@ -22726,12 +19742,11 @@ components: description: An optional key-value map with additional details example: car: white - discount: + Discount: title: Discount description: >- Represents a discount that can be applied to a cart for promotional purposes. - x-resourceId: discount type: object required: - code @@ -22759,7 +19774,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -22774,7 +19789,7 @@ components: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. type: string @@ -22821,10 +19836,9 @@ components: description: An optional key-value map with additional details example: car: white - draft-order: + DraftOrder: title: DraftOrder description: Represents a draft order - x-resourceId: draft-order type: object properties: id: @@ -22894,12 +19908,11 @@ components: description: An optional key-value map with additional details example: car: white - fulfillment_item: + FulfillmentItem: title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. - x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -22921,17 +19934,16 @@ components: type: object item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer example: 1 - fulfillment_provider: + FulfillmentProvider: title: Fulfillment Provider description: >- Represents a fulfillment provider plugin and holds its installation status. - x-resourceId: fulfillment_provider type: object properties: id: @@ -22945,7 +19957,7 @@ components: to `false`. type: boolean example: true - fulfillment: + Fulfillment: title: Fulfillment description: >- Fulfillments are created once store operators can prepare the purchased @@ -22955,7 +19967,6 @@ components: 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. - x-resourceId: fulfillment type: object required: - provider_id @@ -22995,7 +20006,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' items: description: >- The Fulfillment Items in the Fulfillment - these hold information @@ -23003,7 +20014,7 @@ components: the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: '#/components/schemas/FulfillmentItem' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -23011,7 +20022,7 @@ components: Provider. Available if the relation `tracking_links` is expanded. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true description: >- @@ -23066,12 +20077,11 @@ components: description: An optional key-value map with additional details example: car: white - gift_card_transaction: + GiftCardTransaction: title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order - x-resourceId: gift_card_transaction type: object required: - gift_card_id @@ -23113,12 +20123,11 @@ components: description: The tax rate of the transaction type: number example: 0 - gift_card: + GiftCard: title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. - x-resourceId: gift_card type: object required: - code @@ -23168,6 +20177,10 @@ components: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. @@ -23185,12 +20198,11 @@ components: description: An optional key-value map with additional details example: car: white - idempotency_key: + IdempotencyKey: title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. - x-resourceId: idempotency_key type: object required: - idempotency_key @@ -23242,10 +20254,9 @@ components: type: string description: Where to continue from. default: started - image: + Image: title: Image description: Images holds a reference to a URL at which the image file can be found. - x-resourceId: image type: object required: - url @@ -23275,10 +20286,9 @@ components: description: An optional key-value map with additional details example: car: white - invite: + Invite: title: Invite description: Represents an invite - x-resourceId: invite type: object required: - user_email @@ -23327,10 +20337,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_adjustment: + LineItemAdjustment: title: Line Item Adjustment - description: Represents an Line Item Adjustment - x-resourceId: line_item_adjustment + description: Represents a Line Item Adjustment type: object required: - item_id @@ -23347,7 +20356,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' description: type: string description: The line item's adjustment description @@ -23358,7 +20367,7 @@ components: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' amount: type: number description: The adjustment amount @@ -23368,10 +20377,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_tax_line: + LineItemTaxLine: title: Line Item Tax Line - description: Represents an Line Item Tax Line - x-resourceId: line_item_tax_line + description: Represents a Line Item Tax Line type: object required: - item_id @@ -23388,7 +20396,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' code: description: A code to identify the tax type by type: string @@ -23414,7 +20422,7 @@ components: description: An optional key-value map with additional details example: car: white - line_item: + LineItem: title: Line Item description: >- Line Items represent purchasable units that can be added to a Cart for @@ -23422,7 +20430,6 @@ components: resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. - x-resourceId: line_item type: object required: - title @@ -23467,12 +20474,12 @@ components: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: '#/components/schemas/line_item_tax_line' + $ref: '#/components/schemas/LineItemTaxLine' adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: '#/components/schemas/line_item_adjustment' + $ref: '#/components/schemas/LineItemAdjustment' title: description: >- The title of the Line Item, this should be easily identifiable by @@ -23608,7 +20615,7 @@ components: description: An optional key-value map with additional details example: car: white - money_amount: + MoneyAmount: title: Money Amount description: >- Money Amounts represents an amount that a given Product Variant can be @@ -23617,7 +20624,6 @@ components: 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. - x-resourceId: money_amount type: object required: - currency_code @@ -23636,7 +20642,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to @@ -23661,7 +20667,7 @@ components: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' variant_id: description: The id of the Product Variant contained in the Line Item. type: string @@ -23695,13 +20701,12 @@ components: description: An optional key-value map with additional details example: car: white - note: + 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. - x-resourceId: note type: object required: - value @@ -23730,7 +20735,7 @@ components: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' created_at: type: string description: The date with timezone at which the resource was created. @@ -23748,12 +20753,11 @@ components: description: An optional key-value map with additional details example: car: white - notification_provider: + NotificationProvider: title: Notification Provider description: >- Represents a notification provider plugin and holds its installation status. - x-resourceId: notification_provider type: object required: - id @@ -23769,14 +20773,13 @@ components: to `false`. type: boolean default: true - notification: + 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. - x-resourceId: notification type: object required: - resource_type @@ -23825,14 +20828,14 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: '#/components/schemas/NotificationResend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -23841,10 +20844,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - notification_resend: + NotificationResend: title: Notification Resend description: A resend of a Notification. - x-resourceId: notification_resend type: object properties: id: @@ -23889,14 +20891,14 @@ components: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -23908,7 +20910,6 @@ components: OAuth: title: OAuth description: Represent an OAuth app - x-resourceId: OAuth type: object required: - id @@ -23939,10 +20940,9 @@ components: type: object description: Any data necessary to the app. example: {} - order_edit: + OrderEdit: title: Order Edit description: Order edit keeps track of order items changes. - x-resourceId: order_edit type: object required: - order_id @@ -23960,12 +20960,12 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: '#/components/schemas/order_item_change' + $ref: '#/components/schemas/OrderItemChange' internal_note: description: An optional note with additional details about the order edit. type: string @@ -24052,14 +21052,14 @@ components: type: array description: Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' created_at: type: string description: The date with timezone at which the resource was created. @@ -24068,10 +21068,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - order_item_change: + OrderItemChange: title: Order Item Change description: Represents an order edit item change - x-resourceId: order_item_change type: object required: - type @@ -24094,21 +21093,21 @@ components: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' created_at: type: string description: The date with timezone at which the resource was created. @@ -24126,10 +21125,9 @@ components: description: An optional key-value map with additional details example: car: white - order: + Order: title: Order description: Represents an order - x-resourceId: order type: object required: - customer_id @@ -24205,14 +21203,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' region_id: type: string description: The region's ID @@ -24229,7 +21227,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The order's tax rate type: number @@ -24256,21 +21254,21 @@ components: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' returns: type: array description: >- @@ -24318,21 +21316,21 @@ components: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: '#/components/schemas/GiftCardTransaction' canceled_at: type: string description: The date the order was canceled on. @@ -24405,10 +21403,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - payment_collection: + PaymentCollection: title: Payment Collection description: Payment Collection - x-resourceId: payment_collection type: object required: - type @@ -24451,7 +21448,7 @@ components: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' currency_code: description: The 3 character ISO code for the currency. type: string @@ -24461,17 +21458,17 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' created_by: type: string description: The ID of the user that created the payment collection. @@ -24492,10 +21489,9 @@ components: description: An optional key-value map with additional details example: car: white - payment_provider: + PaymentProvider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. - x-resourceId: payment_provider type: object required: - id @@ -24511,7 +21507,7 @@ components: to `false`. type: boolean default: true - payment_session: + PaymentSession: title: Payment Session description: >- Payment Sessions are created when a Customer initilizes the checkout @@ -24520,7 +21516,6 @@ components: communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. - x-resourceId: payment_session type: object required: - cart_id @@ -24589,12 +21584,11 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - payment: + Payment: title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. - x-resourceId: payment type: object required: - amount @@ -24638,7 +21632,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount_refunded: description: >- The amount of the original Payment amount that has been refunded @@ -24687,12 +21681,11 @@ components: description: An optional key-value map with additional details example: car: white - price_list: + PriceList: title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. - x-resourceId: price_list type: object required: - name @@ -24749,8 +21742,8 @@ components: type: array items: oneOf: - - $ref: '#/components/schemas/money_amount' - - $ref: '#/components/schemas/customer_group' + - $ref: '#/components/schemas/MoneyAmount' + - $ref: '#/components/schemas/CustomerGroup' includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean @@ -24766,10 +21759,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - product_collection: + ProductCollection: title: Product Collection description: Product Collections represents a group of Products that are related. - x-resourceId: product_collection type: object required: - title @@ -24813,13 +21805,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option_value: + 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. - x-resourceId: product_option_value type: object required: - value @@ -24845,7 +21836,7 @@ components: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variant_id: description: >- The ID of the Product Variant that the Product Option Value is @@ -24854,7 +21845,7 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' created_at: type: string description: The date with timezone at which the resource was created. @@ -24872,13 +21863,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option: + 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. - x-resourceId: product_option type: object required: - title @@ -24898,7 +21888,7 @@ components: Available if the relation `values` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' product_id: description: The ID of the Product that the Product Option is defined for. type: string @@ -24923,10 +21913,9 @@ components: description: An optional key-value map with additional details example: car: white - product_tag: + ProductTag: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. - x-resourceId: product_tag type: object required: - value @@ -24956,12 +21945,11 @@ components: description: An optional key-value map with additional details example: car: white - product_tax_rate: + ProductTaxRate: title: Product Tax Rate description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way - x-resourceId: product_tax_rate type: object required: - product_id @@ -24973,14 +21961,14 @@ components: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -24994,12 +21982,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type_tax_rate: + 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 - x-resourceId: product_type_tax_rate type: object required: - product_type_id @@ -25011,14 +21998,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -25032,12 +22019,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type: + ProductType: title: Product Type description: >- Product Type can be added to Products for filtering and reporting purposes. - x-resourceId: product_type type: object required: - value @@ -25067,14 +22053,13 @@ components: description: An optional key-value map with additional details example: car: white - product_variant: + 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. - x-resourceId: product_variant type: object required: - title @@ -25105,7 +22090,7 @@ components: Region. Available if the relation `prices` is expanded. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: '#/components/schemas/MoneyAmount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -25207,7 +22192,7 @@ components: Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' created_at: type: string description: The date with timezone at which the resource was created. @@ -25225,10 +22210,9 @@ components: description: An optional key-value map with additional details example: car: white - product_variant_prices_fields: + ProductVariantPricesFields: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. - x-resourceId: product_variant_prices_fields type: object properties: original_price: @@ -25266,13 +22250,12 @@ components: code: type: string description: The code of the tax rate - product: + 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. - x-resourceId: product type: object required: - title @@ -25323,7 +22306,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/image' + $ref: '#/components/schemas/Image' thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -25335,7 +22318,7 @@ components: Option Values. Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variants: description: >- The Product Variants that belong to the Product. Each will have a @@ -25343,7 +22326,7 @@ components: relation `variants` is expanded. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -25353,7 +22336,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -25421,14 +22404,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: '#/components/schemas/product_type' + $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/product_tag' + $ref: '#/components/schemas/ProductTag' discountable: description: >- Whether the Product can be discounted. Discounts will not apply to @@ -25464,10 +22447,9 @@ components: description: An optional key-value map with additional details example: car: white - publishable_api_key_sales_channel: + PublishableApiKeySalesChannel: title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels - x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: @@ -25478,12 +22460,11 @@ components: type: string description: The publishable API key's ID example: pak_01G1G5V21KADXNGH29BJMAJ4B4 - publishable_api_key: + PublishableApiKey: title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. - x-resourceId: publishable_api_key type: object properties: id: @@ -25520,13 +22501,12 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - refund: + 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. - x-resourceId: refund type: object required: - order_id @@ -25586,14 +22566,13 @@ components: description: An optional key-value map with additional details example: car: white - region: + 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. - x-resourceId: region type: object required: - name @@ -25619,7 +22598,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -25630,7 +22609,7 @@ components: relation `tax_rates` is expanded. type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' tax_code: description: >- The tax code used on purchases in the Region. This may be used by @@ -25651,28 +22630,28 @@ components: relation `countries` is expanded. type: array items: - $ref: '#/components/schemas/country' + $ref: '#/components/schemas/Country' tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: '#/components/schemas/tax_provider' + $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/payment_provider' + $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean @@ -25693,12 +22672,11 @@ components: description: An optional key-value map with additional details example: car: white - return_item: + 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. - x-resourceId: return_item type: object required: - return_id @@ -25710,14 +22688,14 @@ components: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -25742,7 +22720,7 @@ components: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' note: description: An optional note with additional details about the Return. type: string @@ -25752,12 +22730,11 @@ components: description: An optional key-value map with additional details example: car: white - return_reason: + 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. - x-resourceId: return_reason type: object required: - value @@ -25785,10 +22762,10 @@ components: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' created_at: type: string description: The date with timezone at which the resource was created. @@ -25806,13 +22783,12 @@ components: description: An optional key-value map with additional details example: car: white - return: + 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. - x-resourceId: return type: object required: - refund_amount @@ -25836,7 +22812,7 @@ components: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/return_item' + $ref: '#/components/schemas/ReturnItem' swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -25867,7 +22843,7 @@ components: Available if the relation `shipping_method` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -25910,10 +22886,9 @@ components: description: An optional key-value map with additional details example: car: white - sales_channel: + SalesChannel: title: Sales Channel description: A Sales Channel - x-resourceId: sales_channel type: object required: - name @@ -25946,10 +22921,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_method_tax_line: + ShippingMethodTaxLine: title: Shipping Method Tax Line description: Shipping Method Tax Line - x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -25966,7 +22940,7 @@ components: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' code: description: A code to identify the tax type by type: string @@ -25992,14 +22966,13 @@ components: description: An optional key-value map with additional details example: car: white - shipping_method: + 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. - x-resourceId: shipping_method type: object required: - shipping_option_id @@ -26017,7 +22990,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -26061,7 +23034,7 @@ components: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: '#/components/schemas/shipping_method_tax_line' + $ref: '#/components/schemas/ShippingMethodTaxLine' price: description: >- The amount to charge for the Shipping Method. The currency of the @@ -26079,12 +23052,11 @@ components: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean - shipping_option_requirement: + ShippingOptionRequirement: title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. - x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -26103,7 +23075,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' type: description: >- The type of the requirement, this defines how the value will be @@ -26124,7 +23096,7 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_option: + ShippingOption: title: Shipping Option description: >- Shipping Options represent a way in which an Order or Return can be @@ -26133,7 +23105,6 @@ components: 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. - x-resourceId: shipping_option type: object required: - name @@ -26168,7 +23139,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -26177,7 +23148,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' price_type: description: >- The type of pricing calculation that is used when creatin Shipping @@ -26208,7 +23179,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: '#/components/schemas/ShippingOptionRequirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -26235,12 +23206,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_profile: + 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. - x-resourceId: shipping_profile type: object required: - name @@ -26281,7 +23251,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' created_at: type: string description: The date with timezone at which the resource was created. @@ -26299,12 +23269,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_tax_rate: + 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 - x-resourceId: shipping_tax_rate type: object required: - shipping_option_id @@ -26316,14 +23285,14 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -26337,10 +23306,9 @@ components: description: An optional key-value map with additional details example: car: white - staged_job: + StagedJob: title: Staged Job description: A staged job resource - x-resourceId: staged_job type: object required: - event_name @@ -26357,10 +23325,9 @@ components: description: Data necessary for the job type: object example: {} - store: + Store: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' - x-resourceId: store type: object properties: id: @@ -26380,14 +23347,14 @@ components: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: '#/components/schemas/currency' + $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' + $ref: '#/components/schemas/Currency' swap_link_template: description: >- A template to generate Swap links from. Use {{cart_id}} to include @@ -26418,7 +23385,7 @@ components: description: An optional key-value map with additional details example: car: white - swap: + Swap: title: Swap description: >- Swaps can be created when a Customer wishes to exchange Products that @@ -26428,7 +23395,6 @@ components: 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. - x-resourceId: swap type: object required: - fulfillment_status @@ -26480,7 +23446,7 @@ components: relation `additional_items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' return_order: description: >- A return order object. The Return that is issued for the return part @@ -26492,13 +23458,13 @@ components: relation `fulfillments` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May @@ -26514,14 +23480,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $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/shipping_method' + $ref: '#/components/schemas/ShippingMethod' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string @@ -26573,10 +23539,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_line: + TaxLine: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. - x-resourceId: tax_line type: object required: - rate @@ -26611,10 +23576,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_provider: + TaxProvider: title: Tax Provider description: The tax service used to calculate taxes - x-resourceId: tax_provider type: object properties: id: @@ -26628,12 +23592,11 @@ components: to `false`. type: boolean default: true - tax_rate: + TaxRate: title: Tax Rate description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region - x-resourceId: line_item type: object required: - name @@ -26711,13 +23674,12 @@ components: description: An optional key-value map with additional details example: car: white - tracking_link: + 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. - x-resourceId: tracking_link type: object required: - tracking_number @@ -26741,7 +23703,7 @@ components: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string description: >- @@ -26768,10 +23730,9 @@ components: description: An optional key-value map with additional details example: car: white - user: + User: title: User description: Represents a User who can manage store settings. - x-resourceId: user type: object required: - email @@ -26813,24 +23774,22 @@ components: description: An optional key-value map with additional details example: car: white - multiple_errors: + MultipleErrors: title: Multiple Errors - x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' message: type: string default: >- Provided request body contains errors. Please check the data and retry the request - error: + Error: title: Response Error - x-resourceId: error type: object properties: code: @@ -26842,3 +23801,3002 @@ components: type: type: string description: A slug indicating the type of the error. + 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 + 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 + 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 + 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 + 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 + AdminPostCustomerGroupsGroupCustomersBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminDeleteCustomerGroupsGroupCustomerBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminPostCustomerGroupsGroupReq: + type: object + properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object + AdminPostCurrenciesCurrencyReq: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + 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 + 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: + 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 + AdminPostDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + 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 + 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 + AdminDeleteDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + 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 + 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 + 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 + 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 + 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/AddressFields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - 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 + 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 + 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/AddressFields' + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/AddressFields' + - 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 + 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 + 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 + 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. + AdminPostNotesNoteReq: + type: object + required: + - value + properties: + value: + type: string + description: The updated description of the Note. + AdminPostNotificationsNotificationResendReq: + type: object + properties: + to: + description: >- + A new address or user identifier that the Notification should be + sent to + type: string + 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 + 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 + AdminPostOrderEditsEditLineItemsLineItemReq: + type: object + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number + AdminPostOrderEditsOrderEditReq: + type: object + properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string + 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: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: A list of image URL's that will be associated with the Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the items are to + be sent back. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: >- + The new items to send to the Customer when the Claim type is + Replace. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + shipping_address: + type: object + description: >- + An optional shipping address to send the claim to. Defaults to the + parent order's shipping address + $ref: '#/components/schemas/Address' + refund_amount: + description: The amount to refund the Customer when the Claim type is `refund`. + type: integer + no_notification: + description: If set to true no notification will be send related to this Claim. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderFulfillmentsReq: + type: object + required: + - items + properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + 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 + 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 + AdminPostOrdersOrderSwapsReq: + type: object + required: + - return_items + properties: + return_items: + description: The Line Items to return as part of the Swap. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: >- + The custom shipping options to potentially create a Shipping Method + from. + type: array + items: + required: + - option_id + - price + properties: + option_id: + description: The ID of the Shipping Option to override with a custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + allow_backorder: + description: 'If true, swaps can be completed with items out of stock' + type: boolean + default: true + 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 + 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 + 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 + AdminPostOrdersOrderReturnsReq: + type: object + required: + - items + properties: + items: + description: The Line Items that will be returned. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: The Shipping Method to be used to handle the return shipment. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + 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 + AdminPostOrdersOrderClaimsClaimReq: + type: object + properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - id + - images + - tags + properties: + id: + description: The ID of the Claim Item. + type: string + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: A list of image URL's that will be associated with the Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostOrdersOrderReq: + type: object + properties: + email: + description: the email for the order + type: string + billing_address: + description: Billing address + anyOf: + - $ref: '#/components/schemas/AddressFields' + shipping_address: + description: Shipping address + anyOf: + - $ref: '#/components/schemas/AddressFields' + 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 + 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 + AdminPostPriceListPricesPricesReq: + type: object + properties: + prices: + description: The prices to update or add. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: + description: >- + If true the prices will replace all existing prices associated with + the Price List. + type: boolean + 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: + required: + - amount + - variant_id + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminDeletePriceListPricesPricesReq: + type: object + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string + 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: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminPostProductsProductOptionsReq: + type: object + required: + - title + properties: + title: + description: The title the Product Option will be identified by i.e. "Size" + 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: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + options: + description: >- + The Options that the Product should have. These define on which + properties the Product's Product Variants will differ. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - value + properties: + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + 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 + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + 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 + 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: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The wieght of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + 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: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + 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 + 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 + AdminPostPublishableApiKeysReq: + type: object + required: + - title + properties: + title: + description: A title for the publishable api key + 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 + AdminPostPublishableApiKeysPublishableApiKeyReq: + type: object + properties: + title: + description: A title to update for the 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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. + AdminPostReturnsReturnReceiveReq: + type: object + required: + - items + properties: + items: + description: The Line Items that have been received. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number + 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: + 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 + 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: + 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 + 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 + 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 + 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 + 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 + 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 + 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 + AdminPostShippingProfilesReq: + type: object + required: + - name + properties: + name: + description: The name of the Shipping Profile + type: string + AdminPostShippingProfilesProfileReq: + type: object + properties: + name: + description: The name of the Shipping Profile + type: string + AdminDeleteUploadsReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to delete + type: string + AdminPostUploadsDownloadUrlReq: + type: object + required: + - file_key + properties: + file_key: + description: key of the file to obtain the download link for + type: string + 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 + AdminResetPasswordTokenRequest: + type: object + required: + - email + properties: + email: + description: The Users email. + type: string + format: email + 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 + 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 diff --git a/docs/api/admin/code_samples/JavaScript/discounts/postundefined b/docs/api/admin/code_samples/JavaScript/discounts/postundefined index fdb9dae2a3..873666ba15 100644 --- a/docs/api/admin/code_samples/JavaScript/discounts/postundefined +++ b/docs/api/admin/code_samples/JavaScript/discounts/postundefined @@ -9,7 +9,7 @@ medusa.admin.discounts.create({ value: 10, allocation: AllocationType.ITEM }, - regions: ['reg_XXXXXXXX'], + regions: ["reg_XXXXXXXX"], is_dynamic: false, is_disabled: false }) diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined index 4ae4ed80a7..599fe4aa64 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined @@ -2,8 +2,8 @@ import Medusa from "@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 + variant_id, + quantity }) .then(({ order_edit }) => { console.log(order_edit.id) diff --git a/docs/api/admin/code_samples/Shell/discounts/postundefined b/docs/api/admin/code_samples/Shell/discounts/postundefined index d0cb7fb00c..a651e15ba4 100644 --- a/docs/api/admin/code_samples/Shell/discounts/postundefined +++ b/docs/api/admin/code_samples/Shell/discounts/postundefined @@ -8,5 +8,5 @@ curl --location --request POST 'https://medusa-url.com/admin/discounts' \ "value": 10, "allocation": "item" }, - "regions": ['reg_XXXXXXXX'] + "regions": ["reg_XXXXXXXX"] }' diff --git a/docs/api/admin/components/responses/400_error.yaml b/docs/api/admin/components/responses/400_error.yaml index 95f25b376b..b960f05fb4 100644 --- a/docs/api/admin/components/responses/400_error.yaml +++ b/docs/api/admin/components/responses/400_error.yaml @@ -3,12 +3,12 @@ content: application/json: schema: oneOf: - - $ref: ../schemas/error.yaml - - $ref: ../schemas/multiple_errors.yaml + - $ref: ../schemas/Error.yaml + - $ref: ../schemas/MultipleErrors.yaml examples: not_allowed: $ref: ../examples/not_allowed_error.yaml invalid_data: $ref: ../examples/invalid_data_error.yaml - multiple_errors: + MultipleErrors: $ref: ../examples/multiple_errors.yaml diff --git a/docs/api/admin/components/responses/500_error.yaml b/docs/api/admin/components/responses/500_error.yaml index ecb2e70917..5da1a171e5 100644 --- a/docs/api/admin/components/responses/500_error.yaml +++ b/docs/api/admin/components/responses/500_error.yaml @@ -2,7 +2,7 @@ description: Server Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml examples: database: $ref: ../examples/database_error.yaml diff --git a/docs/api/admin/components/responses/default_error.yaml b/docs/api/admin/components/responses/default_error.yaml index b7d6911d9d..5591502a6c 100644 --- a/docs/api/admin/components/responses/default_error.yaml +++ b/docs/api/admin/components/responses/default_error.yaml @@ -2,7 +2,7 @@ description: Default Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: unknown_error message: An unknown error occurred. diff --git a/docs/api/admin/components/responses/invalid_request_error.yaml b/docs/api/admin/components/responses/invalid_request_error.yaml index 4050c5fc89..c70a32b01f 100644 --- a/docs/api/admin/components/responses/invalid_request_error.yaml +++ b/docs/api/admin/components/responses/invalid_request_error.yaml @@ -2,7 +2,7 @@ description: Invalid Request Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: invalid_request_error message: Discount with code TEST already exists. diff --git a/docs/api/admin/components/responses/invalid_state_error.yaml b/docs/api/admin/components/responses/invalid_state_error.yaml index fbbf916749..479206bab5 100644 --- a/docs/api/admin/components/responses/invalid_state_error.yaml +++ b/docs/api/admin/components/responses/invalid_state_error.yaml @@ -2,7 +2,7 @@ description: Invalid State Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: unknown_error message: >- diff --git a/docs/api/admin/components/responses/not_found_error.yaml b/docs/api/admin/components/responses/not_found_error.yaml index 667ae355c0..c6fea98d05 100644 --- a/docs/api/admin/components/responses/not_found_error.yaml +++ b/docs/api/admin/components/responses/not_found_error.yaml @@ -2,7 +2,7 @@ description: Not Found Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: message: Entity with id 1 was not found type: not_found diff --git a/docs/api/admin/components/schemas/address.yaml b/docs/api/admin/components/schemas/Address.yaml similarity index 98% rename from docs/api/admin/components/schemas/address.yaml rename to docs/api/admin/components/schemas/Address.yaml index d39d1760ae..a69d410311 100644 --- a/docs/api/admin/components/schemas/address.yaml +++ b/docs/api/admin/components/schemas/Address.yaml @@ -1,6 +1,5 @@ title: Address description: An address. -x-resourceId: address type: object properties: id: diff --git a/docs/api/admin/components/schemas/address_fields.yaml b/docs/api/admin/components/schemas/AddressFields.yaml similarity index 98% rename from docs/api/admin/components/schemas/address_fields.yaml rename to docs/api/admin/components/schemas/AddressFields.yaml index 303b9d5ca9..6e4c4d6358 100644 --- a/docs/api/admin/components/schemas/address_fields.yaml +++ b/docs/api/admin/components/schemas/AddressFields.yaml @@ -1,6 +1,5 @@ title: Address Fields description: Address fields used when creating/updating an address. -x-resourceId: address type: object properties: company: diff --git a/docs/api/admin/components/schemas/AdminCreateUserRequest.yaml b/docs/api/admin/components/schemas/AdminCreateUserRequest.yaml new file mode 100644 index 0000000000..e725065733 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminCreateUserRequest.yaml @@ -0,0 +1,26 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml new file mode 100644 index 0000000000..1829b6c7cf --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - customer_ids +properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml new file mode 100644 index 0000000000..65ab064008 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - resources +properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string diff --git a/docs/api/admin/components/schemas/AdminDeletePriceListPricesPricesReq.yaml b/docs/api/admin/components/schemas/AdminDeletePriceListPricesPricesReq.yaml new file mode 100644 index 0000000000..0b1e797641 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeletePriceListPricesPricesReq.yaml @@ -0,0 +1,7 @@ +type: object +properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionReq.yaml b/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionReq.yaml new file mode 100644 index 0000000000..0c9720a349 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteProductsFromCollectionReq.yaml @@ -0,0 +1,10 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq.yaml new file mode 100644 index 0000000000..4fb1c786f2 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq.yaml @@ -0,0 +1,15 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq.yaml new file mode 100644 index 0000000000..176d203729 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq.yaml @@ -0,0 +1,15 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq.yaml b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq.yaml new file mode 100644 index 0000000000..499a433451 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq.yaml @@ -0,0 +1,9 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq.yaml b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq.yaml new file mode 100644 index 0000000000..9e8ca198b0 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - products +properties: + products: + type: array + description: The IDs of the products to remove association with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq.yaml b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq.yaml new file mode 100644 index 0000000000..b3c0433aae --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq.yaml @@ -0,0 +1,9 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminDeleteUploadsReq.yaml b/docs/api/admin/components/schemas/AdminDeleteUploadsReq.yaml new file mode 100644 index 0000000000..0a967b0845 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteUploadsReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - file_key +properties: + file_key: + description: key of the file to delete + type: string diff --git a/docs/api/admin/components/schemas/AdminPostAppsReq.yaml b/docs/api/admin/components/schemas/AdminPostAppsReq.yaml new file mode 100644 index 0000000000..91cda2d7de --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostAppsReq.yaml @@ -0,0 +1,15 @@ +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. diff --git a/docs/api/admin/components/schemas/AdminPostAuthReq.yaml b/docs/api/admin/components/schemas/AdminPostAuthReq.yaml new file mode 100644 index 0000000000..2d945cc366 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostAuthReq.yaml @@ -0,0 +1,13 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostBatchesReq.yaml b/docs/api/admin/components/schemas/AdminPostBatchesReq.yaml new file mode 100644 index 0000000000..2e52f9c9ee --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostBatchesReq.yaml @@ -0,0 +1,34 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostCollectionsCollectionReq.yaml b/docs/api/admin/components/schemas/AdminPostCollectionsCollectionReq.yaml new file mode 100644 index 0000000000..95e7bb1f33 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCollectionsCollectionReq.yaml @@ -0,0 +1,13 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostCollectionsReq.yaml b/docs/api/admin/components/schemas/AdminPostCollectionsReq.yaml new file mode 100644 index 0000000000..23edc85cc8 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCollectionsReq.yaml @@ -0,0 +1,15 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostCurrenciesCurrencyReq.yaml b/docs/api/admin/components/schemas/AdminPostCurrenciesCurrencyReq.yaml new file mode 100644 index 0000000000..4c168fc38a --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCurrenciesCurrencyReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' diff --git a/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml new file mode 100644 index 0000000000..ba460c4c79 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - customer_ids +properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: ID of the customer + type: string diff --git a/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupReq.yaml new file mode 100644 index 0000000000..8f647d1e83 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupReq.yaml @@ -0,0 +1,8 @@ +type: object +properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml new file mode 100644 index 0000000000..c10421b691 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml @@ -0,0 +1,32 @@ +type: object +properties: + email: + type: string + description: The Customer's email. + format: email + first_name: + type: string + description: The Customer's first name. + last_name: + type: string + description: The Customer's last name. + phone: + type: string + description: The Customer's phone number. + password: + type: string + description: The Customer's password. + format: password + groups: + type: array + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + description: A list of customer groups to which the customer belongs. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostCustomersReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomersReq.yaml new file mode 100644 index 0000000000..250c211fb5 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCustomersReq.yaml @@ -0,0 +1,27 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditions.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditions.yaml new file mode 100644 index 0000000000..f510e4b7f2 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditions.yaml @@ -0,0 +1,37 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml new file mode 100644 index 0000000000..7e6f366712 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml @@ -0,0 +1,29 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml new file mode 100644 index 0000000000..afe209d46e --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - resources +properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountReq.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountReq.yaml new file mode 100644 index 0000000000..d7acadcf2f --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountReq.yaml @@ -0,0 +1,111 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsReq.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsReq.yaml new file mode 100644 index 0000000000..a73bc06eb3 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsReq.yaml @@ -0,0 +1,130 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml new file mode 100644 index 0000000000..2f631fea3b --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml @@ -0,0 +1,14 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml new file mode 100644 index 0000000000..c05a24e9ac --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml @@ -0,0 +1,20 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml new file mode 100644 index 0000000000..05a6d92efc --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml @@ -0,0 +1,45 @@ +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: ./AddressFields.yaml + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: ./AddressFields.yaml + - 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 diff --git a/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml b/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml new file mode 100644 index 0000000000..e2f7db512d --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDraftOrdersReq.yaml @@ -0,0 +1,93 @@ +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: ./AddressFields.yaml + - type: string + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: ./AddressFields.yaml + - 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 diff --git a/docs/api/admin/components/schemas/AdminPostGiftCardsGiftCardReq.yaml b/docs/api/admin/components/schemas/AdminPostGiftCardsGiftCardReq.yaml new file mode 100644 index 0000000000..e7976952f4 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostGiftCardsGiftCardReq.yaml @@ -0,0 +1,20 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostGiftCardsReq.yaml b/docs/api/admin/components/schemas/AdminPostGiftCardsReq.yaml new file mode 100644 index 0000000000..fc19e7674d --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostGiftCardsReq.yaml @@ -0,0 +1,22 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostInvitesInviteAcceptReq.yaml b/docs/api/admin/components/schemas/AdminPostInvitesInviteAcceptReq.yaml new file mode 100644 index 0000000000..41600a6ddb --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostInvitesInviteAcceptReq.yaml @@ -0,0 +1,26 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostInvitesReq.yaml b/docs/api/admin/components/schemas/AdminPostInvitesReq.yaml new file mode 100644 index 0000000000..31d8426e51 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostInvitesReq.yaml @@ -0,0 +1,16 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostNotesNoteReq.yaml b/docs/api/admin/components/schemas/AdminPostNotesNoteReq.yaml new file mode 100644 index 0000000000..1c2bb16901 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostNotesNoteReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - value +properties: + value: + type: string + description: The updated description of the Note. diff --git a/docs/api/admin/components/schemas/AdminPostNotesReq.yaml b/docs/api/admin/components/schemas/AdminPostNotesReq.yaml new file mode 100644 index 0000000000..01ef23d775 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostNotesReq.yaml @@ -0,0 +1,15 @@ +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. diff --git a/docs/api/admin/components/schemas/AdminPostNotificationsNotificationResendReq.yaml b/docs/api/admin/components/schemas/AdminPostNotificationsNotificationResendReq.yaml new file mode 100644 index 0000000000..3d6d6575df --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostNotificationsNotificationResendReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + to: + description: A new address or user identifier that the Notification should be sent to + type: string diff --git a/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml b/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml new file mode 100644 index 0000000000..cb38c689f2 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - quantity +properties: + quantity: + description: The quantity to update + type: number diff --git a/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml new file mode 100644 index 0000000000..6671ae2e12 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml @@ -0,0 +1,14 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostOrderEditsOrderEditReq.yaml b/docs/api/admin/components/schemas/AdminPostOrderEditsOrderEditReq.yaml new file mode 100644 index 0000000000..0956090625 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrderEditsOrderEditReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostOrderEditsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrderEditsReq.yaml new file mode 100644 index 0000000000..37fcff4261 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrderEditsReq.yaml @@ -0,0 +1,10 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml new file mode 100644 index 0000000000..9ebb87d7e4 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml @@ -0,0 +1,8 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml new file mode 100644 index 0000000000..8ae3a23fe6 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml @@ -0,0 +1,78 @@ +type: object +properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - id + - images + - tags + properties: + id: + description: The ID of the Claim Item. + type: string + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: A list of image URL's that will be associated with the Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml new file mode 100644 index 0000000000..e94def5834 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml @@ -0,0 +1,12 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml new file mode 100644 index 0000000000..cd86c5f9a0 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml @@ -0,0 +1,104 @@ +type: object +required: + - type + - claim_items +properties: + type: + description: >- + The type of the Claim. This will determine how the Claim is treated: + `replace` Claims will result in a Fulfillment with new items being + created, while a `refund` Claim will refund the amount paid for the + claimed items. + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: A list of image URL's that will be associated with the Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the items are to be + sent back. + type: object + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer when the Claim type is Replace. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + shipping_address: + type: object + description: >- + An optional shipping address to send the claim to. Defaults to the parent + order's shipping address + $ref: ./Address.yaml + 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 diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml new file mode 100644 index 0000000000..c910300406 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml @@ -0,0 +1,24 @@ +type: object +required: + - items +properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderRefundsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderRefundsReq.yaml new file mode 100644 index 0000000000..ee19081712 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderRefundsReq.yaml @@ -0,0 +1,17 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml new file mode 100644 index 0000000000..5a7c57fb2d --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderReq.yaml @@ -0,0 +1,65 @@ +type: object +properties: + email: + description: the email for the order + type: string + billing_address: + description: Billing address + anyOf: + - $ref: ./AddressFields.yaml + shipping_address: + description: Shipping address + anyOf: + - $ref: ./AddressFields.yaml + items: + description: The Line Items for the order + type: array + items: + $ref: ./LineItem.yaml + region: + description: ID of the region where the order belongs + type: string + discounts: + description: Discounts applied to the order + type: array + items: + $ref: ./Discount.yaml + 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: ./LineItem.yaml + description: Items to ship + no_notification: + description: >- + A flag to indicate if no notifications should be emitted related to the + updated order. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml new file mode 100644 index 0000000000..938c93c8ef --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml @@ -0,0 +1,51 @@ +type: object +required: + - items +properties: + items: + description: The Line Items that will be returned. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: The Shipping Method to be used to handle the return shipment. + type: object + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + 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 diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderShipmentReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderShipmentReq.yaml new file mode 100644 index 0000000000..760275eb19 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderShipmentReq.yaml @@ -0,0 +1,15 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml new file mode 100644 index 0000000000..45e754b776 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml @@ -0,0 +1,71 @@ +type: object +required: + - return_items +properties: + return_items: + description: The Line Items to return as part of the Swap. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: The custom shipping options to potentially create a Shipping Method from. + type: array + items: + required: + - option_id + - price + properties: + option_id: + description: The ID of the Shipping Option to override with a custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + allow_backorder: + description: If true, swaps can be completed with items out of stock + type: boolean + default: true diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml new file mode 100644 index 0000000000..9ebb87d7e4 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml @@ -0,0 +1,8 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml new file mode 100644 index 0000000000..fab12e01e5 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml @@ -0,0 +1,15 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostPaymentRefundsReq.yaml b/docs/api/admin/components/schemas/AdminPostPaymentRefundsReq.yaml new file mode 100644 index 0000000000..3ac53d359a --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPaymentRefundsReq.yaml @@ -0,0 +1,14 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml b/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml new file mode 100644 index 0000000000..28d3868fdb --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml @@ -0,0 +1,43 @@ +type: object +properties: + prices: + description: The prices to update or add. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: + description: >- + If true the prices will replace all existing prices associated with the + Price List. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml new file mode 100644 index 0000000000..09bbab331c --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml @@ -0,0 +1,77 @@ +type: object +properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml new file mode 100644 index 0000000000..aeb0835071 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml @@ -0,0 +1,79 @@ +type: object +required: + - name + - description + - type + - prices +properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + required: + - amount + - variant_id + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductMetadataReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductMetadataReq.yaml new file mode 100644 index 0000000000..bb97fc5ea7 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductMetadataReq.yaml @@ -0,0 +1,11 @@ +type: object +required: + - key + - value +properties: + key: + description: The metadata key + type: string + value: + description: The metadata value + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductOptionsOption.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductOptionsOption.yaml new file mode 100644 index 0000000000..2e287f30d7 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductOptionsOption.yaml @@ -0,0 +1,7 @@ +type: object +required: + - title +properties: + title: + description: The title of the Product Option + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductOptionsReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductOptionsReq.yaml new file mode 100644 index 0000000000..db0ba5be42 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductOptionsReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - title +properties: + title: + description: The title the Product Option will be identified by i.e. "Size" + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml new file mode 100644 index 0000000000..024aaa2c9c --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml @@ -0,0 +1,204 @@ +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: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: The value of the Tag, these will be upserted. + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: >- + The value to give for the Product Option at the same index in + the Product's `options` field. + type: string + weight: + description: The wieght of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml new file mode 100644 index 0000000000..209ef9bd18 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml @@ -0,0 +1,104 @@ +type: object +required: + - title + - prices + - options +properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml new file mode 100644 index 0000000000..9deff44aeb --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml @@ -0,0 +1,101 @@ +type: object +required: + - prices +properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The weight of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only required if + currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be used. + Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostProductsReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsReq.yaml new file mode 100644 index 0000000000..a779060218 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsReq.yaml @@ -0,0 +1,223 @@ +type: object +required: + - title +properties: + title: + description: The title of the Product + type: string + subtitle: + description: The subtitle of the Product + type: string + description: + description: A description of the Product. + type: string + is_giftcard: + description: >- + A flag to indicate if the Product represents a Gift Card. Purchasing + Products with this flag set to `true` will result in a Gift Card being + created. + type: boolean + default: false + discountable: + description: >- + A flag to indicate if discounts can be applied to the LineItems generated + from this Product + type: boolean + default: true + images: + description: Images of the Product. + type: array + items: + type: string + thumbnail: + description: The thumbnail to use for the Product. + type: string + handle: + description: A unique handle to identify the Product by. + type: string + status: + description: The status of the product. + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + type: + description: The Product Type to associate the Product with. + type: object + required: + - value + properties: + id: + description: The ID of the Product Type. + type: string + value: + description: The value of the Product Type. + type: string + collection_id: + description: The ID of the Collection the Product should belong to. + type: string + tags: + description: Tags to associate the Product with. + type: array + items: + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: The value of the Tag, these will be upserted. + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + options: + description: >- + The Options that the Product should have. These define on which properties + the Product's Product Variants will differ. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + required: + - amount + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + required: + - value + properties: + value: + description: >- + The value to give for the Product Option at the same index in + the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object diff --git a/docs/api/admin/components/schemas/AdminPostProductsToCollectionReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsToCollectionReq.yaml new file mode 100644 index 0000000000..6311a4138b --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductsToCollectionReq.yaml @@ -0,0 +1,10 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq.yaml new file mode 100644 index 0000000000..3e7c404f26 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq.yaml @@ -0,0 +1,15 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml b/docs/api/admin/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml new file mode 100644 index 0000000000..aeed291732 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + title: + description: A title to update for the key. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostPublishableApiKeysReq.yaml b/docs/api/admin/components/schemas/AdminPostPublishableApiKeysReq.yaml new file mode 100644 index 0000000000..fa0807e2e7 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostPublishableApiKeysReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - title +properties: + title: + description: A title for the publishable api key + type: string diff --git a/docs/api/admin/components/schemas/AdminPostRegionsRegionCountriesReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsRegionCountriesReq.yaml new file mode 100644 index 0000000000..92f579df49 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsRegionCountriesReq.yaml @@ -0,0 +1,11 @@ +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. diff --git a/docs/api/admin/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq.yaml new file mode 100644 index 0000000000..6552d1244b --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - provider_id +properties: + provider_id: + description: The ID of the Fulfillment Provider to add. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostRegionsRegionPaymentProvidersReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsRegionPaymentProvidersReq.yaml new file mode 100644 index 0000000000..325284c651 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsRegionPaymentProvidersReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - provider_id +properties: + provider_id: + description: The ID of the Payment Provider to add. + type: string diff --git a/docs/api/admin/components/schemas/AdminPostRegionsRegionReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsRegionReq.yaml new file mode 100644 index 0000000000..e55bed24f3 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsRegionReq.yaml @@ -0,0 +1,50 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostRegionsReq.yaml b/docs/api/admin/components/schemas/AdminPostRegionsReq.yaml new file mode 100644 index 0000000000..1c48e5380c --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostRegionsReq.yaml @@ -0,0 +1,46 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostReturnReasonsReasonReq.yaml b/docs/api/admin/components/schemas/AdminPostReturnReasonsReasonReq.yaml new file mode 100644 index 0000000000..383ba92bfc --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostReturnReasonsReasonReq.yaml @@ -0,0 +1,14 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostReturnReasonsReq.yaml b/docs/api/admin/components/schemas/AdminPostReturnReasonsReq.yaml new file mode 100644 index 0000000000..ce30d0eefe --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostReturnReasonsReq.yaml @@ -0,0 +1,20 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml b/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml new file mode 100644 index 0000000000..68ee28260e --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml @@ -0,0 +1,21 @@ +type: object +required: + - items +properties: + items: + description: The Line Items that have been received. + type: array + items: + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number diff --git a/docs/api/admin/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq.yaml new file mode 100644 index 0000000000..90b5b227c9 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq.yaml @@ -0,0 +1,15 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostSalesChannelsReq.yaml b/docs/api/admin/components/schemas/AdminPostSalesChannelsReq.yaml new file mode 100644 index 0000000000..20fa813fa5 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostSalesChannelsReq.yaml @@ -0,0 +1,13 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostSalesChannelsSalesChannelReq.yaml b/docs/api/admin/components/schemas/AdminPostSalesChannelsSalesChannelReq.yaml new file mode 100644 index 0000000000..50df11bd37 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostSalesChannelsSalesChannelReq.yaml @@ -0,0 +1,11 @@ +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. diff --git a/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml new file mode 100644 index 0000000000..91f0798ca7 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml @@ -0,0 +1,41 @@ +type: object +required: + - requirements +properties: + name: + description: The name of the Shipping Option + type: string + amount: + description: The amount to charge for the Shipping Option. + type: integer + admin_only: + description: If true, the option can be used for draft orders + type: boolean + metadata: + description: An optional set of key-value pairs with additional information. + type: object + requirements: + description: >- + The requirements that must be satisfied for the Shipping Option to be + available. + type: array + items: + required: + - type + - amount + properties: + id: + description: The ID of the requirement + type: string + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml new file mode 100644 index 0000000000..d5088992f1 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml @@ -0,0 +1,67 @@ +type: object +required: + - name + - region_id + - provider_id + - data + - price_type +properties: + name: + description: The name of the Shipping Option + type: string + region_id: + description: The ID of the Region in which the Shipping Option will be available. + type: string + provider_id: + description: The ID of the Fulfillment Provider that handles the Shipping Option. + type: string + profile_id: + description: The ID of the Shipping Profile to add the Shipping Option to. + type: number + data: + description: >- + The data needed for the Fulfillment Provider to handle shipping with this + Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. + type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: >- + The requirements that must be satisfied for the Shipping Option to be + available. + type: array + items: + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: If true, the option can be used for draft orders + type: boolean + default: false + metadata: + description: An optional set of key-value pairs with additional information. + type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml new file mode 100644 index 0000000000..5f0da87a1a --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml @@ -0,0 +1,5 @@ +type: object +properties: + name: + description: The name of the Shipping Profile + type: string diff --git a/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml new file mode 100644 index 0000000000..790a1e4704 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - name +properties: + name: + description: The name of the Shipping Profile + type: string diff --git a/docs/api/admin/components/schemas/AdminPostStoreReq.yaml b/docs/api/admin/components/schemas/AdminPostStoreReq.yaml new file mode 100644 index 0000000000..6a6f746821 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostStoreReq.yaml @@ -0,0 +1,32 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesReq.yaml new file mode 100644 index 0000000000..ac7bcd0575 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesReq.yaml @@ -0,0 +1,33 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq.yaml new file mode 100644 index 0000000000..74ee9a8d35 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq.yaml @@ -0,0 +1,9 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductsReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductsReq.yaml new file mode 100644 index 0000000000..74c55626a9 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateProductsReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - products +properties: + products: + type: array + description: The IDs of the products to associate with this tax rate + items: + type: string diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateReq.yaml new file mode 100644 index 0000000000..93b1597180 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateReq.yaml @@ -0,0 +1,29 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq.yaml b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq.yaml new file mode 100644 index 0000000000..1a7110b271 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq.yaml @@ -0,0 +1,9 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostUploadsDownloadUrlReq.yaml b/docs/api/admin/components/schemas/AdminPostUploadsDownloadUrlReq.yaml new file mode 100644 index 0000000000..c3b01ef725 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostUploadsDownloadUrlReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - file_key +properties: + file_key: + description: key of the file to obtain the download link for + type: string diff --git a/docs/api/admin/components/schemas/AdminResetPasswordRequest.yaml b/docs/api/admin/components/schemas/AdminResetPasswordRequest.yaml new file mode 100644 index 0000000000..149a0bddd6 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminResetPasswordRequest.yaml @@ -0,0 +1,16 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminResetPasswordTokenRequest.yaml b/docs/api/admin/components/schemas/AdminResetPasswordTokenRequest.yaml new file mode 100644 index 0000000000..22f7609d2e --- /dev/null +++ b/docs/api/admin/components/schemas/AdminResetPasswordTokenRequest.yaml @@ -0,0 +1,8 @@ +type: object +required: + - email +properties: + email: + description: The Users email. + type: string + format: email diff --git a/docs/api/admin/components/schemas/AdminUpdatePaymentCollectionsReq.yaml b/docs/api/admin/components/schemas/AdminUpdatePaymentCollectionsReq.yaml new file mode 100644 index 0000000000..11f57ce8db --- /dev/null +++ b/docs/api/admin/components/schemas/AdminUpdatePaymentCollectionsReq.yaml @@ -0,0 +1,8 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminUpdateUserRequest.yaml b/docs/api/admin/components/schemas/AdminUpdateUserRequest.yaml new file mode 100644 index 0000000000..df01dd696d --- /dev/null +++ b/docs/api/admin/components/schemas/AdminUpdateUserRequest.yaml @@ -0,0 +1,21 @@ +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 diff --git a/docs/api/store/components/schemas/batch_job.yaml b/docs/api/admin/components/schemas/BatchJob.yaml similarity index 99% rename from docs/api/store/components/schemas/batch_job.yaml rename to docs/api/admin/components/schemas/BatchJob.yaml index c06c261ba5..92a81b4576 100644 --- a/docs/api/store/components/schemas/batch_job.yaml +++ b/docs/api/admin/components/schemas/BatchJob.yaml @@ -1,6 +1,5 @@ title: Batch Job description: A Batch Job. -x-resourceId: batch_job type: object required: - type diff --git a/docs/api/store/components/schemas/cart.yaml b/docs/api/admin/components/schemas/Cart.yaml similarity index 95% rename from docs/api/store/components/schemas/cart.yaml rename to docs/api/admin/components/schemas/Cart.yaml index de1d520a2d..aef4b274ff 100644 --- a/docs/api/store/components/schemas/cart.yaml +++ b/docs/api/admin/components/schemas/Cart.yaml @@ -1,6 +1,5 @@ title: Cart description: Represents a user cart -x-resourceId: cart type: object properties: id: @@ -17,19 +16,19 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml items: description: Available if the relation `items` is expanded. type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml region_id: type: string description: The region's ID @@ -58,24 +57,24 @@ properties: type: object payment_session: description: The selected payment session in the cart. - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: ./payment.yaml + $ref: ./Payment.yaml shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml type: type: string description: The cart's type. diff --git a/docs/api/admin/components/schemas/claim_image.yaml b/docs/api/admin/components/schemas/ClaimImage.yaml similarity index 97% rename from docs/api/admin/components/schemas/claim_image.yaml rename to docs/api/admin/components/schemas/ClaimImage.yaml index 783d89c06d..721cfcf6a5 100644 --- a/docs/api/admin/components/schemas/claim_image.yaml +++ b/docs/api/admin/components/schemas/ClaimImage.yaml @@ -1,6 +1,5 @@ title: Claim Image description: Represents photo documentation of a claim. -x-resourceId: claim_image type: object required: - claim_item_id diff --git a/docs/api/store/components/schemas/claim_item.yaml b/docs/api/admin/components/schemas/ClaimItem.yaml similarity index 95% rename from docs/api/store/components/schemas/claim_item.yaml rename to docs/api/admin/components/schemas/ClaimItem.yaml index cb7e85c9dd..6fc251960c 100644 --- a/docs/api/store/components/schemas/claim_item.yaml +++ b/docs/api/admin/components/schemas/ClaimItem.yaml @@ -2,7 +2,6 @@ title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. -x-resourceId: claim_item type: object required: - claim_order_id @@ -19,7 +18,7 @@ properties: type: array description: Available if the relation `images` is expanded. items: - $ref: ./claim_image.yaml + $ref: ./ClaimImage.yaml claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -32,7 +31,7 @@ properties: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml variant_id: description: The ID of the product variant that is claimed. type: string @@ -64,7 +63,7 @@ properties: relation 'tags' is expanded. type: array items: - $ref: ./claim_tag.yaml + $ref: ./ClaimTag.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/claim_order.yaml b/docs/api/admin/components/schemas/ClaimOrder.yaml similarity index 95% rename from docs/api/store/components/schemas/claim_order.yaml rename to docs/api/admin/components/schemas/ClaimOrder.yaml index ed55db009d..561dbec67d 100644 --- a/docs/api/store/components/schemas/claim_order.yaml +++ b/docs/api/admin/components/schemas/ClaimOrder.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: claim_order type: object required: - type @@ -43,14 +42,14 @@ properties: description: The items that have been claimed type: array items: - $ref: ./claim_item.yaml + $ref: ./ClaimItem.yaml additional_items: description: >- Refers to the new items to be shipped when the claim order has the type `replace` type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml order_id: description: The ID of the order that the claim comes from. type: string @@ -69,17 +68,17 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer diff --git a/docs/api/store/components/schemas/claim_tag.yaml b/docs/api/admin/components/schemas/ClaimTag.yaml similarity index 97% rename from docs/api/store/components/schemas/claim_tag.yaml rename to docs/api/admin/components/schemas/ClaimTag.yaml index 46a23e4da8..bf557fcc6d 100644 --- a/docs/api/store/components/schemas/claim_tag.yaml +++ b/docs/api/admin/components/schemas/ClaimTag.yaml @@ -2,7 +2,6 @@ title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. -x-resourceId: claim_tag type: object required: - value diff --git a/docs/api/store/components/schemas/country.yaml b/docs/api/admin/components/schemas/Country.yaml similarity index 98% rename from docs/api/store/components/schemas/country.yaml rename to docs/api/admin/components/schemas/Country.yaml index d8a7a18e36..c28bb31871 100644 --- a/docs/api/store/components/schemas/country.yaml +++ b/docs/api/admin/components/schemas/Country.yaml @@ -1,6 +1,5 @@ title: Country description: Country details -x-resourceId: country type: object required: - iso_2 diff --git a/docs/api/admin/components/schemas/currency.yaml b/docs/api/admin/components/schemas/Currency.yaml similarity index 97% rename from docs/api/admin/components/schemas/currency.yaml rename to docs/api/admin/components/schemas/Currency.yaml index be164ffa9e..c553448ec2 100644 --- a/docs/api/admin/components/schemas/currency.yaml +++ b/docs/api/admin/components/schemas/Currency.yaml @@ -1,6 +1,5 @@ title: Currency description: Currency -x-resourceId: currency type: object required: - code diff --git a/docs/api/admin/components/schemas/custom_shipping_option.yaml b/docs/api/admin/components/schemas/CustomShippingOption.yaml similarity index 97% rename from docs/api/admin/components/schemas/custom_shipping_option.yaml rename to docs/api/admin/components/schemas/CustomShippingOption.yaml index 40ff8c8229..619df289c4 100644 --- a/docs/api/admin/components/schemas/custom_shipping_option.yaml +++ b/docs/api/admin/components/schemas/CustomShippingOption.yaml @@ -3,7 +3,6 @@ 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 -x-resourceId: custom_shipping_option type: object required: - price diff --git a/docs/api/store/components/schemas/customer.yaml b/docs/api/admin/components/schemas/Customer.yaml similarity index 94% rename from docs/api/store/components/schemas/customer.yaml rename to docs/api/admin/components/schemas/Customer.yaml index aa0e83a77c..9c91270354 100644 --- a/docs/api/store/components/schemas/customer.yaml +++ b/docs/api/admin/components/schemas/Customer.yaml @@ -1,6 +1,5 @@ title: Customer description: Represents a customer -x-resourceId: customer type: object required: - email @@ -27,12 +26,12 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: ./address.yaml + $ref: ./Address.yaml phone: type: string description: The customer's phone number @@ -53,7 +52,7 @@ properties: `groups` is expanded. type: array items: - $ref: ./customer_group.yaml + $ref: ./CustomerGroup.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/customer_group.yaml b/docs/api/admin/components/schemas/CustomerGroup.yaml similarity index 95% rename from docs/api/store/components/schemas/customer_group.yaml rename to docs/api/admin/components/schemas/CustomerGroup.yaml index 0d4769c7ad..69e2edfe7c 100644 --- a/docs/api/store/components/schemas/customer_group.yaml +++ b/docs/api/admin/components/schemas/CustomerGroup.yaml @@ -1,6 +1,5 @@ title: Customer Group description: Represents a customer group -x-resourceId: customer_group type: object required: - name @@ -27,7 +26,7 @@ properties: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: ./price_list.yaml + $ref: ./PriceList.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount.yaml b/docs/api/admin/components/schemas/Discount.yaml similarity index 97% rename from docs/api/store/components/schemas/discount.yaml rename to docs/api/admin/components/schemas/Discount.yaml index 1950a503cb..72c9365c95 100644 --- a/docs/api/store/components/schemas/discount.yaml +++ b/docs/api/admin/components/schemas/Discount.yaml @@ -1,6 +1,5 @@ title: Discount description: Represents a discount that can be applied to a cart for promotional purposes. -x-resourceId: discount type: object required: - code @@ -28,7 +27,7 @@ properties: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: ./discount_rule.yaml + $ref: ./DiscountRule.yaml is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -43,7 +42,7 @@ properties: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: ./discount.yaml + $ref: ./Discount.yaml starts_at: description: The time at which the discount can be used. type: string diff --git a/docs/api/store/components/schemas/discount_condition.yaml b/docs/api/admin/components/schemas/DiscountCondition.yaml similarity index 97% rename from docs/api/store/components/schemas/discount_condition.yaml rename to docs/api/admin/components/schemas/DiscountCondition.yaml index 794e839eb3..40f5247a38 100644 --- a/docs/api/store/components/schemas/discount_condition.yaml +++ b/docs/api/admin/components/schemas/DiscountCondition.yaml @@ -1,6 +1,5 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable -x-resourceId: discount_condition type: object required: - type @@ -32,7 +31,7 @@ properties: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: ./discount_rule.yaml + $ref: ./DiscountRule.yaml products: description: >- products associated with this condition if type = products. Available if diff --git a/docs/api/admin/components/schemas/discount_condition_customer_group.yaml b/docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml similarity index 89% rename from docs/api/admin/components/schemas/discount_condition_customer_group.yaml rename to docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml index 51867349ad..143c2c2a50 100644 --- a/docs/api/admin/components/schemas/discount_condition_customer_group.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml @@ -1,6 +1,5 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group -x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: ./customer_group.yaml + $ref: ./CustomerGroup.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_condition_product.yaml b/docs/api/admin/components/schemas/DiscountConditionProduct.yaml similarity index 90% rename from docs/api/admin/components/schemas/discount_condition_product.yaml rename to docs/api/admin/components/schemas/DiscountConditionProduct.yaml index b88eac53c2..ca1540fcbb 100644 --- a/docs/api/admin/components/schemas/discount_condition_product.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProduct.yaml @@ -1,6 +1,5 @@ title: Product Discount Condition description: Associates a discount condition with a product -x-resourceId: discount_condition_product type: object required: - product_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: ./product.yaml + $ref: ./Product.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_condition_product_collection.yaml b/docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml similarity index 89% rename from docs/api/store/components/schemas/discount_condition_product_collection.yaml rename to docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml index bc0065ef9f..49e19e9590 100644 --- a/docs/api/store/components/schemas/discount_condition_product_collection.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml @@ -1,6 +1,5 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection -x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: ./product_collection.yaml + $ref: ./ProductCollection.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_condition_product_tag.yaml b/docs/api/admin/components/schemas/DiscountConditionProductTag.yaml similarity index 90% rename from docs/api/store/components/schemas/discount_condition_product_tag.yaml rename to docs/api/admin/components/schemas/DiscountConditionProductTag.yaml index d3ba121f43..3b7c0738f0 100644 --- a/docs/api/store/components/schemas/discount_condition_product_tag.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProductTag.yaml @@ -1,6 +1,5 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag -x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: ./product_tag.yaml + $ref: ./ProductTag.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_condition_product_type.yaml b/docs/api/admin/components/schemas/DiscountConditionProductType.yaml similarity index 90% rename from docs/api/admin/components/schemas/discount_condition_product_type.yaml rename to docs/api/admin/components/schemas/DiscountConditionProductType.yaml index 03a6393c44..471000a1e7 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_type.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProductType.yaml @@ -1,6 +1,5 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type -x-resourceId: discount_condition_product type: object required: - product_type_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_rule.yaml b/docs/api/admin/components/schemas/DiscountRule.yaml similarity index 98% rename from docs/api/store/components/schemas/discount_rule.yaml rename to docs/api/admin/components/schemas/DiscountRule.yaml index ab6ab1a80e..1a6ec45afb 100644 --- a/docs/api/store/components/schemas/discount_rule.yaml +++ b/docs/api/admin/components/schemas/DiscountRule.yaml @@ -2,7 +2,6 @@ title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. -x-resourceId: discount_rule type: object required: - type diff --git a/docs/api/store/components/schemas/draft-order.yaml b/docs/api/admin/components/schemas/DraftOrder.yaml similarity index 98% rename from docs/api/store/components/schemas/draft-order.yaml rename to docs/api/admin/components/schemas/DraftOrder.yaml index 1c96c22bc7..5e18ec0f8f 100644 --- a/docs/api/store/components/schemas/draft-order.yaml +++ b/docs/api/admin/components/schemas/DraftOrder.yaml @@ -1,6 +1,5 @@ title: DraftOrder description: Represents a draft order -x-resourceId: draft-order type: object properties: id: diff --git a/docs/api/admin/components/schemas/error.yaml b/docs/api/admin/components/schemas/Error.yaml similarity index 93% rename from docs/api/admin/components/schemas/error.yaml rename to docs/api/admin/components/schemas/Error.yaml index cad9495918..787671c4a4 100644 --- a/docs/api/admin/components/schemas/error.yaml +++ b/docs/api/admin/components/schemas/Error.yaml @@ -1,5 +1,4 @@ title: Response Error -x-resourceId: error type: object properties: code: diff --git a/docs/api/admin/components/schemas/fulfillment.yaml b/docs/api/admin/components/schemas/Fulfillment.yaml similarity index 96% rename from docs/api/admin/components/schemas/fulfillment.yaml rename to docs/api/admin/components/schemas/Fulfillment.yaml index d6ee5c6960..0c34d6607b 100644 --- a/docs/api/admin/components/schemas/fulfillment.yaml +++ b/docs/api/admin/components/schemas/Fulfillment.yaml @@ -7,7 +7,6 @@ description: >- plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. -x-resourceId: fulfillment type: object required: - provider_id @@ -45,7 +44,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml items: description: >- The Fulfillment Items in the Fulfillment - these hold information about @@ -53,7 +52,7 @@ properties: `items` is expanded. type: array items: - $ref: ./fulfillment_item.yaml + $ref: ./FulfillmentItem.yaml tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -61,7 +60,7 @@ properties: Available if the relation `tracking_links` is expanded. type: array items: - $ref: ./tracking_link.yaml + $ref: ./TrackingLink.yaml tracking_numbers: deprecated: true description: >- diff --git a/docs/api/store/components/schemas/fulfillment_item.yaml b/docs/api/admin/components/schemas/FulfillmentItem.yaml similarity index 93% rename from docs/api/store/components/schemas/fulfillment_item.yaml rename to docs/api/admin/components/schemas/FulfillmentItem.yaml index f233f45f68..8578f6a4d7 100644 --- a/docs/api/store/components/schemas/fulfillment_item.yaml +++ b/docs/api/admin/components/schemas/FulfillmentItem.yaml @@ -2,7 +2,6 @@ title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. -x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -22,7 +21,7 @@ properties: type: object item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer diff --git a/docs/api/store/components/schemas/fulfillment_provider.yaml b/docs/api/admin/components/schemas/FulfillmentProvider.yaml similarity index 93% rename from docs/api/store/components/schemas/fulfillment_provider.yaml rename to docs/api/admin/components/schemas/FulfillmentProvider.yaml index 584c933111..bbd8801420 100644 --- a/docs/api/store/components/schemas/fulfillment_provider.yaml +++ b/docs/api/admin/components/schemas/FulfillmentProvider.yaml @@ -1,6 +1,5 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. -x-resourceId: fulfillment_provider type: object properties: id: diff --git a/docs/api/admin/components/schemas/gift_card.yaml b/docs/api/admin/components/schemas/GiftCard.yaml similarity index 94% rename from docs/api/admin/components/schemas/gift_card.yaml rename to docs/api/admin/components/schemas/GiftCard.yaml index 054f93319f..d169d35e54 100644 --- a/docs/api/admin/components/schemas/gift_card.yaml +++ b/docs/api/admin/components/schemas/GiftCard.yaml @@ -2,7 +2,6 @@ title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. -x-resourceId: gift_card type: object required: - code @@ -52,6 +51,10 @@ properties: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/gift_card_transaction.yaml b/docs/api/admin/components/schemas/GiftCardTransaction.yaml similarity index 97% rename from docs/api/admin/components/schemas/gift_card_transaction.yaml rename to docs/api/admin/components/schemas/GiftCardTransaction.yaml index fb16341851..df738aa63b 100644 --- a/docs/api/admin/components/schemas/gift_card_transaction.yaml +++ b/docs/api/admin/components/schemas/GiftCardTransaction.yaml @@ -2,7 +2,6 @@ title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order -x-resourceId: gift_card_transaction type: object required: - gift_card_id diff --git a/docs/api/store/components/schemas/idempotency_key.yaml b/docs/api/admin/components/schemas/IdempotencyKey.yaml similarity index 98% rename from docs/api/store/components/schemas/idempotency_key.yaml rename to docs/api/admin/components/schemas/IdempotencyKey.yaml index 9bff9c0f90..b496aadde3 100644 --- a/docs/api/store/components/schemas/idempotency_key.yaml +++ b/docs/api/admin/components/schemas/IdempotencyKey.yaml @@ -2,7 +2,6 @@ title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. -x-resourceId: idempotency_key type: object required: - idempotency_key diff --git a/docs/api/admin/components/schemas/image.yaml b/docs/api/admin/components/schemas/Image.yaml similarity index 97% rename from docs/api/admin/components/schemas/image.yaml rename to docs/api/admin/components/schemas/Image.yaml index 61bc475c32..5250816766 100644 --- a/docs/api/admin/components/schemas/image.yaml +++ b/docs/api/admin/components/schemas/Image.yaml @@ -1,6 +1,5 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. -x-resourceId: image type: object required: - url diff --git a/docs/api/store/components/schemas/invite.yaml b/docs/api/admin/components/schemas/Invite.yaml similarity index 98% rename from docs/api/store/components/schemas/invite.yaml rename to docs/api/admin/components/schemas/Invite.yaml index aac3ce0b7f..9e16e818ea 100644 --- a/docs/api/store/components/schemas/invite.yaml +++ b/docs/api/admin/components/schemas/Invite.yaml @@ -1,6 +1,5 @@ title: Invite description: Represents an invite -x-resourceId: invite type: object required: - user_email diff --git a/docs/api/store/components/schemas/line_item.yaml b/docs/api/admin/components/schemas/LineItem.yaml similarity index 98% rename from docs/api/store/components/schemas/line_item.yaml rename to docs/api/admin/components/schemas/LineItem.yaml index ae9ed1eaa0..0e0c64de6f 100644 --- a/docs/api/store/components/schemas/line_item.yaml +++ b/docs/api/admin/components/schemas/LineItem.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: line_item type: object required: - title @@ -47,12 +46,12 @@ properties: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: ./line_item_tax_line.yaml + $ref: ./LineItemTaxLine.yaml adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: ./line_item_adjustment.yaml + $ref: ./LineItemAdjustment.yaml title: description: >- The title of the Line Item, this should be easily identifiable by the diff --git a/docs/api/admin/components/schemas/line_item_adjustment.yaml b/docs/api/admin/components/schemas/LineItemAdjustment.yaml similarity index 87% rename from docs/api/admin/components/schemas/line_item_adjustment.yaml rename to docs/api/admin/components/schemas/LineItemAdjustment.yaml index 677f69388a..28b41b9566 100644 --- a/docs/api/admin/components/schemas/line_item_adjustment.yaml +++ b/docs/api/admin/components/schemas/LineItemAdjustment.yaml @@ -1,6 +1,5 @@ title: Line Item Adjustment -description: Represents an Line Item Adjustment -x-resourceId: line_item_adjustment +description: Represents a Line Item Adjustment type: object required: - item_id @@ -17,7 +16,7 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml description: type: string description: The line item's adjustment description @@ -28,7 +27,7 @@ properties: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: ./discount.yaml + $ref: ./Discount.yaml amount: type: number description: The adjustment amount diff --git a/docs/api/admin/components/schemas/line_item_tax_line.yaml b/docs/api/admin/components/schemas/LineItemTaxLine.yaml similarity index 90% rename from docs/api/admin/components/schemas/line_item_tax_line.yaml rename to docs/api/admin/components/schemas/LineItemTaxLine.yaml index b149f62d42..2ee2e0a546 100644 --- a/docs/api/admin/components/schemas/line_item_tax_line.yaml +++ b/docs/api/admin/components/schemas/LineItemTaxLine.yaml @@ -1,6 +1,5 @@ title: Line Item Tax Line -description: Represents an Line Item Tax Line -x-resourceId: line_item_tax_line +description: Represents a Line Item Tax Line type: object required: - item_id @@ -17,7 +16,7 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml code: description: A code to identify the tax type by type: string diff --git a/docs/api/admin/components/schemas/money_amount.yaml b/docs/api/admin/components/schemas/MoneyAmount.yaml similarity index 97% rename from docs/api/admin/components/schemas/money_amount.yaml rename to docs/api/admin/components/schemas/MoneyAmount.yaml index 929194a759..223ddf5f44 100644 --- a/docs/api/admin/components/schemas/money_amount.yaml +++ b/docs/api/admin/components/schemas/MoneyAmount.yaml @@ -5,7 +5,6 @@ description: >- 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. -x-resourceId: money_amount type: object required: - currency_code @@ -24,7 +23,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to charge @@ -49,7 +48,7 @@ properties: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: ./price_list.yaml + $ref: ./PriceList.yaml variant_id: description: The id of the Product Variant contained in the Line Item. type: string diff --git a/docs/api/store/components/schemas/multiple_errors.yaml b/docs/api/admin/components/schemas/MultipleErrors.yaml similarity index 82% rename from docs/api/store/components/schemas/multiple_errors.yaml rename to docs/api/admin/components/schemas/MultipleErrors.yaml index 0327c94e70..7ca18cda3b 100644 --- a/docs/api/store/components/schemas/multiple_errors.yaml +++ b/docs/api/admin/components/schemas/MultipleErrors.yaml @@ -1,12 +1,11 @@ title: Multiple Errors -x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: ./error.yaml + $ref: ./Error.yaml message: type: string default: >- diff --git a/docs/api/store/components/schemas/note.yaml b/docs/api/admin/components/schemas/Note.yaml similarity index 97% rename from docs/api/store/components/schemas/note.yaml rename to docs/api/admin/components/schemas/Note.yaml index 16f1e9fe50..2decb4f715 100644 --- a/docs/api/store/components/schemas/note.yaml +++ b/docs/api/admin/components/schemas/Note.yaml @@ -2,7 +2,6 @@ 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. -x-resourceId: note type: object required: - value @@ -31,7 +30,7 @@ properties: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: ./user.yaml + $ref: ./User.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/notification.yaml b/docs/api/admin/components/schemas/Notification.yaml similarity index 95% rename from docs/api/store/components/schemas/notification.yaml rename to docs/api/admin/components/schemas/Notification.yaml index 9db10fe27a..ddc77a9c73 100644 --- a/docs/api/store/components/schemas/notification.yaml +++ b/docs/api/admin/components/schemas/Notification.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: notification type: object required: - resource_type @@ -50,14 +49,14 @@ properties: description: The resends that have been completed after the original Notification. type: array items: - $ref: ./notification_resend.yaml + $ref: ./NotificationResend.yaml provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: ./notification_provider.yaml + $ref: ./NotificationProvider.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/notification_provider.yaml b/docs/api/admin/components/schemas/NotificationProvider.yaml similarity index 93% rename from docs/api/admin/components/schemas/notification_provider.yaml rename to docs/api/admin/components/schemas/NotificationProvider.yaml index dacf80d189..fbc83c6837 100644 --- a/docs/api/admin/components/schemas/notification_provider.yaml +++ b/docs/api/admin/components/schemas/NotificationProvider.yaml @@ -1,6 +1,5 @@ title: Notification Provider description: Represents a notification provider plugin and holds its installation status. -x-resourceId: notification_provider type: object required: - id diff --git a/docs/api/store/components/schemas/notification_resend.yaml b/docs/api/admin/components/schemas/NotificationResend.yaml similarity index 95% rename from docs/api/store/components/schemas/notification_resend.yaml rename to docs/api/admin/components/schemas/NotificationResend.yaml index 2b15999aa6..cd88d291ae 100644 --- a/docs/api/store/components/schemas/notification_resend.yaml +++ b/docs/api/admin/components/schemas/NotificationResend.yaml @@ -1,6 +1,5 @@ title: Notification Resend description: A resend of a Notification. -x-resourceId: notification_resend type: object properties: id: @@ -44,14 +43,14 @@ properties: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: ./notification.yaml + $ref: ./Notification.yaml provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: ./notification_provider.yaml + $ref: ./NotificationProvider.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/OAuth.yaml b/docs/api/admin/components/schemas/OAuth.yaml index 6b6cb8b660..9f22524f3e 100644 --- a/docs/api/admin/components/schemas/OAuth.yaml +++ b/docs/api/admin/components/schemas/OAuth.yaml @@ -1,6 +1,5 @@ title: OAuth description: Represent an OAuth app -x-resourceId: OAuth type: object required: - id diff --git a/docs/api/store/components/schemas/order.yaml b/docs/api/admin/components/schemas/Order.yaml similarity index 96% rename from docs/api/store/components/schemas/order.yaml rename to docs/api/admin/components/schemas/Order.yaml index 464edc17fb..fbc5185c9b 100644 --- a/docs/api/store/components/schemas/order.yaml +++ b/docs/api/admin/components/schemas/Order.yaml @@ -1,6 +1,5 @@ title: Order description: Represents an order -x-resourceId: order type: object required: - customer_id @@ -76,14 +75,14 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml region_id: type: string description: The region's ID @@ -100,7 +99,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml tax_rate: description: The order's tax rate type: number @@ -127,21 +126,21 @@ properties: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: ./payment.yaml + $ref: ./Payment.yaml fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml returns: type: array description: >- @@ -187,21 +186,21 @@ properties: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: ./order_edit.yaml + $ref: ./OrderEdit.yaml gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: ./gift_card_transaction.yaml + $ref: ./GiftCardTransaction.yaml canceled_at: type: string description: The date the order was canceled on. diff --git a/docs/api/admin/components/schemas/order_edit.yaml b/docs/api/admin/components/schemas/OrderEdit.yaml similarity index 95% rename from docs/api/admin/components/schemas/order_edit.yaml rename to docs/api/admin/components/schemas/OrderEdit.yaml index 5574c2b6f2..ea53ce0b14 100644 --- a/docs/api/admin/components/schemas/order_edit.yaml +++ b/docs/api/admin/components/schemas/OrderEdit.yaml @@ -1,6 +1,5 @@ title: Order Edit description: Order edit keeps track of order items changes. -x-resourceId: order_edit type: object required: - order_id @@ -18,12 +17,12 @@ properties: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: ./order.yaml + $ref: ./Order.yaml changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: ./order_item_change.yaml + $ref: ./OrderItemChange.yaml internal_note: description: An optional note with additional details about the order edit. type: string @@ -106,14 +105,14 @@ properties: type: array description: Available if the relation `items` is expanded. items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: ./payment_collection.yaml + $ref: ./PaymentCollection.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/order_item_change.yaml b/docs/api/admin/components/schemas/OrderItemChange.yaml similarity index 93% rename from docs/api/store/components/schemas/order_item_change.yaml rename to docs/api/admin/components/schemas/OrderItemChange.yaml index 9bc3b3a826..49d0ecab5b 100644 --- a/docs/api/store/components/schemas/order_item_change.yaml +++ b/docs/api/admin/components/schemas/OrderItemChange.yaml @@ -1,6 +1,5 @@ title: Order Item Change description: Represents an order edit item change -x-resourceId: order_item_change type: object required: - type @@ -23,21 +22,21 @@ properties: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: ./order_edit.yaml + $ref: ./OrderEdit.yaml original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/payment.yaml b/docs/api/admin/components/schemas/Payment.yaml similarity index 98% rename from docs/api/store/components/schemas/payment.yaml rename to docs/api/admin/components/schemas/Payment.yaml index 384e04b16c..d224dca6cf 100644 --- a/docs/api/store/components/schemas/payment.yaml +++ b/docs/api/admin/components/schemas/Payment.yaml @@ -2,7 +2,6 @@ title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. -x-resourceId: payment type: object required: - amount @@ -46,7 +45,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml amount_refunded: description: >- The amount of the original Payment amount that has been refunded back to diff --git a/docs/api/admin/components/schemas/payment_collection.yaml b/docs/api/admin/components/schemas/PaymentCollection.yaml similarity index 93% rename from docs/api/admin/components/schemas/payment_collection.yaml rename to docs/api/admin/components/schemas/PaymentCollection.yaml index 3f5663b39a..096abf613c 100644 --- a/docs/api/admin/components/schemas/payment_collection.yaml +++ b/docs/api/admin/components/schemas/PaymentCollection.yaml @@ -1,6 +1,5 @@ title: Payment Collection description: Payment Collection -x-resourceId: payment_collection type: object required: - type @@ -43,7 +42,7 @@ properties: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: ./region.yaml + $ref: ./Region.yaml currency_code: description: The 3 character ISO code for the currency. type: string @@ -53,17 +52,17 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: ./payment.yaml + $ref: ./Payment.yaml created_by: type: string description: The ID of the user that created the payment collection. diff --git a/docs/api/store/components/schemas/payment_provider.yaml b/docs/api/admin/components/schemas/PaymentProvider.yaml similarity index 94% rename from docs/api/store/components/schemas/payment_provider.yaml rename to docs/api/admin/components/schemas/PaymentProvider.yaml index 081a6b7462..57cf719a28 100644 --- a/docs/api/store/components/schemas/payment_provider.yaml +++ b/docs/api/admin/components/schemas/PaymentProvider.yaml @@ -1,6 +1,5 @@ title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. -x-resourceId: payment_provider type: object required: - id diff --git a/docs/api/admin/components/schemas/payment_session.yaml b/docs/api/admin/components/schemas/PaymentSession.yaml similarity index 98% rename from docs/api/admin/components/schemas/payment_session.yaml rename to docs/api/admin/components/schemas/PaymentSession.yaml index ca8c513a26..3d7e87862b 100644 --- a/docs/api/admin/components/schemas/payment_session.yaml +++ b/docs/api/admin/components/schemas/PaymentSession.yaml @@ -6,7 +6,6 @@ description: >- with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. -x-resourceId: payment_session type: object required: - cart_id diff --git a/docs/api/admin/components/schemas/price_list.yaml b/docs/api/admin/components/schemas/PriceList.yaml similarity index 95% rename from docs/api/admin/components/schemas/price_list.yaml rename to docs/api/admin/components/schemas/PriceList.yaml index b774028314..6c1fc7de25 100644 --- a/docs/api/admin/components/schemas/price_list.yaml +++ b/docs/api/admin/components/schemas/PriceList.yaml @@ -2,7 +2,6 @@ title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. -x-resourceId: price_list type: object required: - name @@ -57,8 +56,8 @@ properties: type: array items: oneOf: - - $ref: ./money_amount.yaml - - $ref: ./customer_group.yaml + - $ref: ./MoneyAmount.yaml + - $ref: ./CustomerGroup.yaml includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean diff --git a/docs/api/admin/components/schemas/product.yaml b/docs/api/admin/components/schemas/Product.yaml similarity index 96% rename from docs/api/admin/components/schemas/product.yaml rename to docs/api/admin/components/schemas/Product.yaml index e0116cc51d..5112dc072f 100644 --- a/docs/api/admin/components/schemas/product.yaml +++ b/docs/api/admin/components/schemas/Product.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: product type: object required: - title @@ -48,7 +47,7 @@ properties: description: Images of the Product. Available if the relation `images` is expanded. type: array items: - $ref: ./image.yaml + $ref: ./Image.yaml thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -60,7 +59,7 @@ properties: Available if the relation `options` is expanded. type: array items: - $ref: ./product_option.yaml + $ref: ./ProductOption.yaml variants: description: >- The Product Variants that belong to the Product. Each will have a unique @@ -68,7 +67,7 @@ properties: is expanded. type: array items: - $ref: ./product_variant.yaml + $ref: ./ProductVariant.yaml profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -78,7 +77,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: ./shipping_profile.yaml + $ref: ./ShippingProfile.yaml weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -144,14 +143,14 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml tags: description: >- The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: - $ref: ./product_tag.yaml + $ref: ./ProductTag.yaml discountable: description: >- Whether the Product can be discounted. Discounts will not apply to Line diff --git a/docs/api/store/components/schemas/product_collection.yaml b/docs/api/admin/components/schemas/ProductCollection.yaml similarity index 97% rename from docs/api/store/components/schemas/product_collection.yaml rename to docs/api/admin/components/schemas/ProductCollection.yaml index a3fd98cefb..0f215f050c 100644 --- a/docs/api/store/components/schemas/product_collection.yaml +++ b/docs/api/admin/components/schemas/ProductCollection.yaml @@ -1,6 +1,5 @@ title: Product Collection description: Product Collections represents a group of Products that are related. -x-resourceId: product_collection type: object required: - title diff --git a/docs/api/admin/components/schemas/product_option.yaml b/docs/api/admin/components/schemas/ProductOption.yaml similarity index 95% rename from docs/api/admin/components/schemas/product_option.yaml rename to docs/api/admin/components/schemas/ProductOption.yaml index aaaf0d58c1..0179d34d93 100644 --- a/docs/api/admin/components/schemas/product_option.yaml +++ b/docs/api/admin/components/schemas/ProductOption.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: product_option type: object required: - title @@ -23,7 +22,7 @@ properties: Available if the relation `values` is expanded. type: array items: - $ref: ./product_option_value.yaml + $ref: ./ProductOptionValue.yaml product_id: description: The ID of the Product that the Product Option is defined for. type: string diff --git a/docs/api/store/components/schemas/product_option_value.yaml b/docs/api/admin/components/schemas/ProductOptionValue.yaml similarity index 94% rename from docs/api/store/components/schemas/product_option_value.yaml rename to docs/api/admin/components/schemas/ProductOptionValue.yaml index 407e69a536..467e538803 100644 --- a/docs/api/store/components/schemas/product_option_value.yaml +++ b/docs/api/admin/components/schemas/ProductOptionValue.yaml @@ -2,7 +2,6 @@ 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. -x-resourceId: product_option_value type: object required: - value @@ -26,7 +25,7 @@ properties: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: ./product_option.yaml + $ref: ./ProductOption.yaml variant_id: description: >- The ID of the Product Variant that the Product Option Value is defined @@ -35,7 +34,7 @@ properties: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: ./product_variant.yaml + $ref: ./ProductVariant.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/product_tag.yaml b/docs/api/admin/components/schemas/ProductTag.yaml similarity index 97% rename from docs/api/store/components/schemas/product_tag.yaml rename to docs/api/admin/components/schemas/ProductTag.yaml index 8240386ddf..615174509c 100644 --- a/docs/api/store/components/schemas/product_tag.yaml +++ b/docs/api/admin/components/schemas/ProductTag.yaml @@ -1,6 +1,5 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. -x-resourceId: product_tag type: object required: - value diff --git a/docs/api/admin/components/schemas/product_tax_rate.yaml b/docs/api/admin/components/schemas/ProductTaxRate.yaml similarity index 92% rename from docs/api/admin/components/schemas/product_tax_rate.yaml rename to docs/api/admin/components/schemas/ProductTaxRate.yaml index db175e899d..a179b64cdd 100644 --- a/docs/api/admin/components/schemas/product_tax_rate.yaml +++ b/docs/api/admin/components/schemas/ProductTaxRate.yaml @@ -2,7 +2,6 @@ title: Product Tax Rate description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way -x-resourceId: product_tax_rate type: object required: - product_id @@ -14,14 +13,14 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: ./product.yaml + $ref: ./Product.yaml 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. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/product_type.yaml b/docs/api/admin/components/schemas/ProductType.yaml similarity index 97% rename from docs/api/admin/components/schemas/product_type.yaml rename to docs/api/admin/components/schemas/ProductType.yaml index b6e06d4190..88555b5bf4 100644 --- a/docs/api/admin/components/schemas/product_type.yaml +++ b/docs/api/admin/components/schemas/ProductType.yaml @@ -1,6 +1,5 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. -x-resourceId: product_type type: object required: - value diff --git a/docs/api/admin/components/schemas/product_type_tax_rate.yaml b/docs/api/admin/components/schemas/ProductTypeTaxRate.yaml similarity index 91% rename from docs/api/admin/components/schemas/product_type_tax_rate.yaml rename to docs/api/admin/components/schemas/ProductTypeTaxRate.yaml index 48445a6b80..a11a7ba760 100644 --- a/docs/api/admin/components/schemas/product_type_tax_rate.yaml +++ b/docs/api/admin/components/schemas/ProductTypeTaxRate.yaml @@ -2,7 +2,6 @@ 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 -x-resourceId: product_type_tax_rate type: object required: - product_type_id @@ -14,14 +13,14 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml 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. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/product_variant.yaml b/docs/api/admin/components/schemas/ProductVariant.yaml similarity index 97% rename from docs/api/store/components/schemas/product_variant.yaml rename to docs/api/admin/components/schemas/ProductVariant.yaml index a0cb2eacc9..3079f7bb14 100644 --- a/docs/api/store/components/schemas/product_variant.yaml +++ b/docs/api/admin/components/schemas/ProductVariant.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: product_variant type: object required: - title @@ -34,7 +33,7 @@ properties: Available if the relation `prices` is expanded. type: array items: - $ref: ./money_amount.yaml + $ref: ./MoneyAmount.yaml sku: description: >- The unique stock keeping unit used to identify the Product Variant. This @@ -130,7 +129,7 @@ properties: the relation `options` is expanded. type: array items: - $ref: ./product_option_value.yaml + $ref: ./ProductOptionValue.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/product_variant_prices_fields.yaml b/docs/api/admin/components/schemas/ProductVariantPricesFields.yaml similarity index 96% rename from docs/api/admin/components/schemas/product_variant_prices_fields.yaml rename to docs/api/admin/components/schemas/ProductVariantPricesFields.yaml index aee4659828..3bece0c504 100644 --- a/docs/api/admin/components/schemas/product_variant_prices_fields.yaml +++ b/docs/api/admin/components/schemas/ProductVariantPricesFields.yaml @@ -1,6 +1,5 @@ title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. -x-resourceId: product_variant_prices_fields type: object properties: original_price: diff --git a/docs/api/admin/components/schemas/publishable_api_key.yaml b/docs/api/admin/components/schemas/PublishableApiKey.yaml similarity index 97% rename from docs/api/admin/components/schemas/publishable_api_key.yaml rename to docs/api/admin/components/schemas/PublishableApiKey.yaml index 061b34b8c8..38818bccaf 100644 --- a/docs/api/admin/components/schemas/publishable_api_key.yaml +++ b/docs/api/admin/components/schemas/PublishableApiKey.yaml @@ -2,7 +2,6 @@ title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. -x-resourceId: publishable_api_key type: object properties: id: diff --git a/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml b/docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml similarity index 89% rename from docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml rename to docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml index d0ab55c29a..e2461daba5 100644 --- a/docs/api/store/components/schemas/publishable_api_key_sales_channel.yaml +++ b/docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml @@ -1,6 +1,5 @@ title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels -x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: diff --git a/docs/api/admin/components/schemas/refund.yaml b/docs/api/admin/components/schemas/Refund.yaml similarity index 98% rename from docs/api/admin/components/schemas/refund.yaml rename to docs/api/admin/components/schemas/Refund.yaml index fae6a881f3..936eb3842c 100644 --- a/docs/api/admin/components/schemas/refund.yaml +++ b/docs/api/admin/components/schemas/Refund.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: refund type: object required: - order_id diff --git a/docs/api/admin/components/schemas/region.yaml b/docs/api/admin/components/schemas/Region.yaml similarity index 93% rename from docs/api/admin/components/schemas/region.yaml rename to docs/api/admin/components/schemas/Region.yaml index 15b245b470..89b86870dc 100644 --- a/docs/api/admin/components/schemas/region.yaml +++ b/docs/api/admin/components/schemas/Region.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: region type: object required: - name @@ -30,7 +29,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -41,7 +40,7 @@ properties: `tax_rates` is expanded. type: array items: - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml tax_code: description: >- The tax code used on purchases in the Region. This may be used by other @@ -62,28 +61,28 @@ properties: `countries` is expanded. type: array items: - $ref: ./country.yaml + $ref: ./Country.yaml tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: ./tax_provider.yaml + $ref: ./TaxProvider.yaml 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: ./payment_provider.yaml + $ref: ./PaymentProvider.yaml fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean diff --git a/docs/api/admin/components/schemas/return.yaml b/docs/api/admin/components/schemas/Return.yaml similarity index 97% rename from docs/api/admin/components/schemas/return.yaml rename to docs/api/admin/components/schemas/Return.yaml index 7ba545dcdc..406389b61d 100644 --- a/docs/api/admin/components/schemas/return.yaml +++ b/docs/api/admin/components/schemas/Return.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: return type: object required: - refund_amount @@ -27,7 +26,7 @@ properties: the relation `items` is expanded. type: array items: - $ref: ./return_item.yaml + $ref: ./ReturnItem.yaml swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -56,7 +55,7 @@ properties: the relation `shipping_method` is expanded. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml shipping_data: description: >- Data about the return shipment as provided by the Fulfilment Provider that diff --git a/docs/api/store/components/schemas/return_item.yaml b/docs/api/admin/components/schemas/ReturnItem.yaml similarity index 93% rename from docs/api/store/components/schemas/return_item.yaml rename to docs/api/admin/components/schemas/ReturnItem.yaml index 4ecc64bc8d..d56d8604a5 100644 --- a/docs/api/store/components/schemas/return_item.yaml +++ b/docs/api/admin/components/schemas/ReturnItem.yaml @@ -2,7 +2,6 @@ title: Return Item description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. -x-resourceId: return_item type: object required: - return_id @@ -14,14 +13,14 @@ properties: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: ./return.yaml + $ref: ./Return.yaml item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -46,7 +45,7 @@ properties: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml note: description: An optional note with additional details about the Return. type: string diff --git a/docs/api/store/components/schemas/return_reason.yaml b/docs/api/admin/components/schemas/ReturnReason.yaml similarity index 94% rename from docs/api/store/components/schemas/return_reason.yaml rename to docs/api/admin/components/schemas/ReturnReason.yaml index 2e4d4d83ef..ff9a50bf3f 100644 --- a/docs/api/store/components/schemas/return_reason.yaml +++ b/docs/api/admin/components/schemas/ReturnReason.yaml @@ -2,7 +2,6 @@ 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. -x-resourceId: return_reason type: object required: - value @@ -30,10 +29,10 @@ properties: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/sales_channel.yaml b/docs/api/admin/components/schemas/SalesChannel.yaml similarity index 97% rename from docs/api/store/components/schemas/sales_channel.yaml rename to docs/api/admin/components/schemas/SalesChannel.yaml index 7c4e1f2920..a79b3fd206 100644 --- a/docs/api/store/components/schemas/sales_channel.yaml +++ b/docs/api/admin/components/schemas/SalesChannel.yaml @@ -1,6 +1,5 @@ title: Sales Channel description: A Sales Channel -x-resourceId: sales_channel type: object required: - name diff --git a/docs/api/store/components/schemas/shipping_method.yaml b/docs/api/admin/components/schemas/ShippingMethod.yaml similarity index 96% rename from docs/api/store/components/schemas/shipping_method.yaml rename to docs/api/admin/components/schemas/ShippingMethod.yaml index 4ac18c8e93..9ac6b87cc6 100644 --- a/docs/api/store/components/schemas/shipping_method.yaml +++ b/docs/api/admin/components/schemas/ShippingMethod.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: shipping_method type: object required: - shipping_option_id @@ -20,7 +19,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -60,7 +59,7 @@ properties: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: ./shipping_method_tax_line.yaml + $ref: ./ShippingMethodTaxLine.yaml price: description: >- The amount to charge for the Shipping Method. The currency of the price is diff --git a/docs/api/admin/components/schemas/shipping_method_tax_line.yaml b/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml similarity index 94% rename from docs/api/admin/components/schemas/shipping_method_tax_line.yaml rename to docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml index 3387bfbfe2..1089796789 100644 --- a/docs/api/admin/components/schemas/shipping_method_tax_line.yaml +++ b/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml @@ -1,6 +1,5 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line -x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -17,7 +16,7 @@ properties: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml code: description: A code to identify the tax type by type: string diff --git a/docs/api/admin/components/schemas/shipping_option.yaml b/docs/api/admin/components/schemas/ShippingOption.yaml similarity index 95% rename from docs/api/admin/components/schemas/shipping_option.yaml rename to docs/api/admin/components/schemas/ShippingOption.yaml index a0e1c6538a..0efbef070c 100644 --- a/docs/api/admin/components/schemas/shipping_option.yaml +++ b/docs/api/admin/components/schemas/ShippingOption.yaml @@ -6,7 +6,6 @@ description: >- 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. -x-resourceId: shipping_option type: object required: - name @@ -41,7 +40,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: ./shipping_profile.yaml + $ref: ./ShippingProfile.yaml provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -50,7 +49,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml price_type: description: >- The type of pricing calculation that is used when creatin Shipping Methods @@ -78,7 +77,7 @@ properties: expanded. type: array items: - $ref: ./shipping_option_requirement.yaml + $ref: ./ShippingOptionRequirement.yaml data: description: >- The data needed for the Fulfillment Provider to identify the Shipping diff --git a/docs/api/store/components/schemas/shipping_option_requirement.yaml b/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml similarity index 94% rename from docs/api/store/components/schemas/shipping_option_requirement.yaml rename to docs/api/admin/components/schemas/ShippingOptionRequirement.yaml index 57d9719312..bebafda0ea 100644 --- a/docs/api/store/components/schemas/shipping_option_requirement.yaml +++ b/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml @@ -2,7 +2,6 @@ title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. -x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -21,7 +20,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml type: description: >- The type of the requirement, this defines how the value will be compared diff --git a/docs/api/store/components/schemas/shipping_profile.yaml b/docs/api/admin/components/schemas/ShippingProfile.yaml similarity index 96% rename from docs/api/store/components/schemas/shipping_profile.yaml rename to docs/api/admin/components/schemas/ShippingProfile.yaml index ba479ece92..0afd646078 100644 --- a/docs/api/store/components/schemas/shipping_profile.yaml +++ b/docs/api/admin/components/schemas/ShippingProfile.yaml @@ -2,7 +2,6 @@ title: Shipping Profile description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. -x-resourceId: shipping_profile type: object required: - name @@ -43,7 +42,7 @@ properties: expanded. type: array items: - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/shipping_tax_rate.yaml b/docs/api/admin/components/schemas/ShippingTaxRate.yaml similarity index 91% rename from docs/api/store/components/schemas/shipping_tax_rate.yaml rename to docs/api/admin/components/schemas/ShippingTaxRate.yaml index 30058a09af..7ab7938fb0 100644 --- a/docs/api/store/components/schemas/shipping_tax_rate.yaml +++ b/docs/api/admin/components/schemas/ShippingTaxRate.yaml @@ -2,7 +2,6 @@ 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 -x-resourceId: shipping_tax_rate type: object required: - shipping_option_id @@ -14,14 +13,14 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml 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. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/staged_job.yaml b/docs/api/admin/components/schemas/StagedJob.yaml similarity index 93% rename from docs/api/admin/components/schemas/staged_job.yaml rename to docs/api/admin/components/schemas/StagedJob.yaml index 055ceaee0e..a31192dbdc 100644 --- a/docs/api/admin/components/schemas/staged_job.yaml +++ b/docs/api/admin/components/schemas/StagedJob.yaml @@ -1,6 +1,5 @@ title: Staged Job description: A staged job resource -x-resourceId: staged_job type: object required: - event_name diff --git a/docs/api/store/components/schemas/store.yaml b/docs/api/admin/components/schemas/Store.yaml similarity index 96% rename from docs/api/store/components/schemas/store.yaml rename to docs/api/admin/components/schemas/Store.yaml index 98b90e81f4..d96015e522 100644 --- a/docs/api/store/components/schemas/store.yaml +++ b/docs/api/admin/components/schemas/Store.yaml @@ -1,6 +1,5 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. -x-resourceId: store type: object properties: id: @@ -20,14 +19,14 @@ properties: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml currencies: description: >- The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. type: array items: - $ref: ./currency.yaml + $ref: ./Currency.yaml swap_link_template: description: >- A template to generate Swap links from. Use {{cart_id}} to include the diff --git a/docs/api/admin/components/schemas/swap.yaml b/docs/api/admin/components/schemas/Swap.yaml similarity index 96% rename from docs/api/admin/components/schemas/swap.yaml rename to docs/api/admin/components/schemas/Swap.yaml index 31694ff199..d5a43a79d8 100644 --- a/docs/api/admin/components/schemas/swap.yaml +++ b/docs/api/admin/components/schemas/Swap.yaml @@ -7,7 +7,6 @@ description: >- 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. -x-resourceId: swap type: object required: - fulfillment_status @@ -57,7 +56,7 @@ properties: `additional_items` is expanded. type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml return_order: description: >- A return order object. The Return that is issued for the return part of @@ -69,13 +68,13 @@ properties: relation `fulfillments` is expanded. type: array items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml 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. - $ref: ./payment.yaml + $ref: ./Payment.yaml difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May be @@ -91,14 +90,14 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml 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: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string diff --git a/docs/api/store/components/schemas/tax_line.yaml b/docs/api/admin/components/schemas/TaxLine.yaml similarity index 97% rename from docs/api/store/components/schemas/tax_line.yaml rename to docs/api/admin/components/schemas/TaxLine.yaml index 3faaf02eb7..3300d86797 100644 --- a/docs/api/store/components/schemas/tax_line.yaml +++ b/docs/api/admin/components/schemas/TaxLine.yaml @@ -1,6 +1,5 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. -x-resourceId: tax_line type: object required: - rate diff --git a/docs/api/store/components/schemas/tax_provider.yaml b/docs/api/admin/components/schemas/TaxProvider.yaml similarity index 94% rename from docs/api/store/components/schemas/tax_provider.yaml rename to docs/api/admin/components/schemas/TaxProvider.yaml index 7f53c424a5..dc2b7ef07e 100644 --- a/docs/api/store/components/schemas/tax_provider.yaml +++ b/docs/api/admin/components/schemas/TaxProvider.yaml @@ -1,6 +1,5 @@ title: Tax Provider description: The tax service used to calculate taxes -x-resourceId: tax_provider type: object properties: id: diff --git a/docs/api/store/components/schemas/tax_rate.yaml b/docs/api/admin/components/schemas/TaxRate.yaml similarity index 98% rename from docs/api/store/components/schemas/tax_rate.yaml rename to docs/api/admin/components/schemas/TaxRate.yaml index cbe718652e..48ff10fd0c 100644 --- a/docs/api/store/components/schemas/tax_rate.yaml +++ b/docs/api/admin/components/schemas/TaxRate.yaml @@ -2,7 +2,6 @@ title: Tax Rate description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region -x-resourceId: line_item type: object required: - name diff --git a/docs/api/store/components/schemas/tracking_link.yaml b/docs/api/admin/components/schemas/TrackingLink.yaml similarity index 96% rename from docs/api/store/components/schemas/tracking_link.yaml rename to docs/api/admin/components/schemas/TrackingLink.yaml index 25867d8a97..85a7f696e7 100644 --- a/docs/api/store/components/schemas/tracking_link.yaml +++ b/docs/api/admin/components/schemas/TrackingLink.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: tracking_link type: object required: - tracking_number @@ -27,7 +26,7 @@ properties: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml idempotency_key: type: string description: >- diff --git a/docs/api/admin/components/schemas/user.yaml b/docs/api/admin/components/schemas/User.yaml similarity index 98% rename from docs/api/admin/components/schemas/user.yaml rename to docs/api/admin/components/schemas/User.yaml index 042cd46cb2..c35e299a8f 100644 --- a/docs/api/admin/components/schemas/user.yaml +++ b/docs/api/admin/components/schemas/User.yaml @@ -1,6 +1,5 @@ title: User description: Represents a User who can manage store settings. -x-resourceId: user type: object required: - email diff --git a/docs/api/admin/openapi.yaml b/docs/api/admin/openapi.yaml index b762f21692..6ba3e06b4c 100644 --- a/docs/api/admin/openapi.yaml +++ b/docs/api/admin/openapi.yaml @@ -108,106 +108,77 @@ tags: sessions. - name: App description: App endpoints that allow handling apps in Medusa. - x-resourceId: OAuth - name: Batch Job description: Batch Job endpoints that allow handling batch jobs in Medusa. - x-resourceId: batch_job - name: Claim description: Claim endpoints that allow handling claims in Medusa. - x-resourceId: claim_order - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Customer Group description: Customer Group endpoints that allow handling customer groups in Medusa. - x-resourceId: customer_group - name: Discount description: Discount endpoints that allow handling discounts in Medusa. - x-resourceId: discount - name: Discount Condition description: >- Discount Condition endpoints that allow handling discount conditions in Medusa. - x-resourceId: discount_condition - name: Draft Order description: Draft Order endpoints that allow handling draft orders in Medusa. - x-resourceId: draft-order - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Invite description: Invite endpoints that allow handling invites in Medusa. - x-resourceId: invite - name: Note description: Note endpoints that allow handling notes in Medusa. - x-resourceId: note - name: Notification description: Notification endpoints that allow handling notifications in Medusa. - x-resourceId: notification - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Price List description: Price List endpoints that allow handling price lists in Medusa. - x-resourceId: price_list - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Tag description: Product Tag endpoints that allow handling product tags in Medusa. - x-resourceId: product_tag - name: Product Type description: Product Types endpoints that allow handling product types in Medusa. - x-resourceId: product_type - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Sales Channel description: Sales Channel endpoints that allow handling sales channels in Medusa. - x-resourceId: sales_channel - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Shipping Profile description: >- Shipping Profile endpoints that allow handling shipping profiles in Medusa. - x-resourceId: shipping_profile - name: Store description: Store endpoints that allow handling stores in Medusa. - x-resourceId: store - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap - name: Tax Rate description: Tax Rate endpoints that allow handling tax rates in Medusa. - x-resourceId: tax_rate - name: Upload description: Upload endpoints that allow handling uploads in Medusa. - name: User description: User endpoints that allow handling users in Medusa. - x-resourceId: user servers: - url: https://api.medusa-commerce.com/admin paths: + /apps/authorizations: + $ref: paths/apps_authorizations.yaml + /apps: + $ref: paths/apps.yaml /auth: $ref: paths/auth.yaml - /currencies: - $ref: paths/currencies.yaml - /currencies/{code}: - $ref: paths/currencies_{code}.yaml /batch-jobs/{id}/cancel: $ref: paths/batch-jobs_{id}_cancel.yaml /batch-jobs/{id}/confirm: @@ -230,26 +201,14 @@ paths: $ref: paths/customer-groups_{id}.yaml /customer-groups/{id}/customers: $ref: paths/customer-groups_{id}_customers.yaml - /apps/authorizations: - $ref: paths/apps_authorizations.yaml - /apps: - $ref: paths/apps.yaml + /currencies: + $ref: paths/currencies.yaml + /currencies/{code}: + $ref: paths/currencies_{code}.yaml /customers: $ref: paths/customers.yaml /customers/{id}: $ref: paths/customers_{id}.yaml - /draft-orders: - $ref: paths/draft-orders.yaml - /draft-orders/{id}/line-items: - $ref: paths/draft-orders_{id}_line-items.yaml - /draft-orders/{id}: - $ref: paths/draft-orders_{id}.yaml - /draft-orders/{id}/line-items/{line_id}: - $ref: paths/draft-orders_{id}_line-items_{line_id}.yaml - /draft-orders/{id}/pay: - $ref: paths/draft-orders_{id}_pay.yaml - /admin/draft-orders/{id}: - $ref: paths/admin_draft-orders_{id}.yaml /discounts/{id}/regions/{region_id}: $ref: paths/discounts_{id}_regions_{region_id}.yaml /discounts/{discount_id}/conditions/{condition_id}/batch: @@ -272,6 +231,18 @@ paths: $ref: paths/gift-cards.yaml /gift-cards/{id}: $ref: paths/gift-cards_{id}.yaml + /draft-orders: + $ref: paths/draft-orders.yaml + /draft-orders/{id}/line-items: + $ref: paths/draft-orders_{id}_line-items.yaml + /draft-orders/{id}: + $ref: paths/draft-orders_{id}.yaml + /draft-orders/{id}/line-items/{line_id}: + $ref: paths/draft-orders_{id}_line-items_{line_id}.yaml + /draft-orders/{id}/pay: + $ref: paths/draft-orders_{id}_pay.yaml + /admin/draft-orders/{id}: + $ref: paths/admin_draft-orders_{id}.yaml /invites/accept: $ref: paths/invites_accept.yaml /invites: @@ -288,6 +259,22 @@ paths: $ref: paths/notifications.yaml /notifications/{id}/resend: $ref: paths/notifications_{id}_resend.yaml + /order-edits/{id}/items: + $ref: paths/order-edits_{id}_items.yaml + /order-edits/{id}/cancel: + $ref: paths/order-edits_{id}_cancel.yaml + /order-edits/{id}/confirm: + $ref: paths/order-edits_{id}_confirm.yaml + /order-edits: + $ref: paths/order-edits.yaml + /order-edits/{id}/items/{item_id}: + $ref: paths/order-edits_{id}_items_{item_id}.yaml + /order-edits/{id}/changes/{change_id}: + $ref: paths/order-edits_{id}_changes_{change_id}.yaml + /order-edits/{id}: + $ref: paths/order-edits_{id}.yaml + /order-edits/{id}/request: + $ref: paths/order-edits_{id}_request.yaml /orders/{id}/shipping-methods: $ref: paths/orders_{id}_shipping-methods.yaml /orders/{id}/archive: @@ -338,32 +325,10 @@ paths: $ref: paths/orders_{id}_return.yaml /order/{id}/claims/{claim_id}: $ref: paths/order_{id}_claims_{claim_id}.yaml - /order-edits/{id}/items: - $ref: paths/order-edits_{id}_items.yaml - /order-edits/{id}/cancel: - $ref: paths/order-edits_{id}_cancel.yaml - /order-edits/{id}/confirm: - $ref: paths/order-edits_{id}_confirm.yaml - /order-edits: - $ref: paths/order-edits.yaml - /order-edits/{id}/items/{item_id}: - $ref: paths/order-edits_{id}_items_{item_id}.yaml - /order-edits/{id}/changes/{change_id}: - $ref: paths/order-edits_{id}_changes_{change_id}.yaml - /order-edits/{id}: - $ref: paths/order-edits_{id}.yaml - /order-edits/{id}/request: - $ref: paths/order-edits_{id}_request.yaml /payment-collections/{id}: $ref: paths/payment-collections_{id}.yaml /payment-collections/{id}/authorize: $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: @@ -376,10 +341,10 @@ paths: $ref: paths/price-lists_{id}_variants_{variant_id}_prices.yaml /price-lists/{id}/products: $ref: paths/price-lists_{id}_products.yaml - /product-tags: - $ref: paths/product-tags.yaml /product-types: $ref: paths/product-types.yaml + /product-tags: + $ref: paths/product-tags.yaml /products/{id}/options: $ref: paths/products_{id}_options.yaml /products: @@ -398,6 +363,12 @@ paths: $ref: paths/products_types.yaml /products/{id}/metadata: $ref: paths/products_{id}_metadata.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 /publishable-api-keys/{id}/sales-channels/batch: $ref: paths/publishable-api-keys_{id}_sales-channels_batch.yaml /publishable-api-keys: @@ -448,10 +419,6 @@ paths: $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 /store/currencies/{code}: $ref: paths/store_currencies_{code}.yaml /store: @@ -474,6 +441,10 @@ paths: $ref: paths/tax-rates.yaml /tax-rates/{id}: $ref: paths/tax-rates_{id}.yaml + /shipping-profiles: + $ref: paths/shipping-profiles.yaml + /shipping-profiles/{id}: + $ref: paths/shipping-profiles_{id}.yaml /uploads/protected: $ref: paths/uploads_protected.yaml /uploads: diff --git a/docs/api/admin/paths/admin_draft-orders_{id}.yaml b/docs/api/admin/paths/admin_draft-orders_{id}.yaml index 09630a97d9..2840671094 100644 --- a/docs/api/admin/paths/admin_draft-orders_{id}.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}.yaml @@ -14,51 +14,7 @@ post: content: application/json: schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Draft Order in. - country_code: - type: string - description: The 2 character ISO code for the Country. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Draft Order. - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: ../components/schemas/address_fields.yaml - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: ../components/schemas/address_fields.yaml - - 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 + $ref: ../components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -82,7 +38,7 @@ post: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/apps_authorizations.yaml b/docs/api/admin/paths/apps_authorizations.yaml index 083b1c4d48..fe5c56aefd 100644 --- a/docs/api/admin/paths/apps_authorizations.yaml +++ b/docs/api/admin/paths/apps_authorizations.yaml @@ -7,21 +7,7 @@ post: content: application/json: schema: - type: object - required: - - application_name - - state - - code - properties: - application_name: - type: string - description: Name of the application for the token to be generated for. - state: - type: string - description: State of the application. - code: - type: string - description: The code for the generated token. + $ref: ../components/schemas/AdminPostAppsReq.yaml x-codeSamples: - lang: Shell label: cURL diff --git a/docs/api/admin/paths/auth.yaml b/docs/api/admin/paths/auth.yaml index d9eb880401..7df22e8372 100644 --- a/docs/api/admin/paths/auth.yaml +++ b/docs/api/admin/paths/auth.yaml @@ -39,7 +39,7 @@ post: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -114,7 +114,7 @@ get: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/batch-jobs.yaml b/docs/api/admin/paths/batch-jobs.yaml index fb7b06064c..620314d7bb 100644 --- a/docs/api/admin/paths/batch-jobs.yaml +++ b/docs/api/admin/paths/batch-jobs.yaml @@ -7,42 +7,7 @@ post: content: application/json: schema: - type: object - required: - - type - - context - properties: - type: - type: string - description: The type of batch job to start. - example: product-export - context: - type: object - description: >- - Additional infomration regarding the batch to be used for - processing. - example: - shape: - prices: - - region: null - currency_code: eur - dynamicImageColumnCount: 4 - dynamicOptionColumnCount: 2 - list_config: - skip: 0 - take: 50 - order: - created_at: DESC - relations: - - variants - - variant.prices - - images - dry_run: - type: boolean - description: >- - Set a batch job in dry_run mode to get some information on what - will be done without applying any modifications. - default: false + $ref: ../components/schemas/AdminPostBatchesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -66,7 +31,7 @@ post: type: object properties: batch_job: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -345,7 +310,7 @@ get: batch_jobs: type: array items: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/batch-jobs_{id}.yaml b/docs/api/admin/paths/batch-jobs_{id}.yaml index 2278e04dfb..590a2bcf81 100644 --- a/docs/api/admin/paths/batch-jobs_{id}.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}.yaml @@ -33,7 +33,7 @@ get: type: object properties: batch_job: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml index cddbde3b9e..1802061a1c 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml @@ -33,7 +33,7 @@ post: type: object properties: batch_job: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml index ed31dff4fe..e2230ad52a 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml @@ -33,7 +33,7 @@ post: type: object properties: batch_job: - $ref: ../components/schemas/batch_job.yaml + $ref: ../components/schemas/BatchJob.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/collections.yaml b/docs/api/admin/paths/collections.yaml index 3dd991bf7c..fbd79a669c 100644 --- a/docs/api/admin/paths/collections.yaml +++ b/docs/api/admin/paths/collections.yaml @@ -7,23 +7,7 @@ post: content: application/json: schema: - type: object - required: - - title - properties: - title: - type: string - description: The title to identify the Collection by. - handle: - type: string - description: >- - An optional handle to be used in slugs, if none is provided we - will kebab-case the title. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostCollectionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -47,7 +31,7 @@ post: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -189,7 +173,7 @@ get: collections: type: array items: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/collections_{id}.yaml b/docs/api/admin/paths/collections_{id}.yaml index 2b75a31ee1..a98116c2bf 100644 --- a/docs/api/admin/paths/collections_{id}.yaml +++ b/docs/api/admin/paths/collections_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,21 +119,7 @@ post: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminPostCollectionsCollectionReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -157,7 +143,7 @@ post: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/collections_{id}_products_batch.yaml b/docs/api/admin/paths/collections_{id}_products_batch.yaml index 50cda5b52b..2d696a0484 100644 --- a/docs/api/admin/paths/collections_{id}_products_batch.yaml +++ b/docs/api/admin/paths/collections_{id}_products_batch.yaml @@ -14,16 +14,7 @@ post: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to add to the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: ../components/schemas/AdminPostProductsToCollectionReq.yaml x-codeSamples: - lang: Shell label: cURL @@ -43,7 +34,7 @@ post: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -72,16 +63,7 @@ delete: content: application/json: schema: - type: object - required: - - product_ids - properties: - product_ids: - description: An array of Product IDs to remove from the Product Collection. - type: array - items: - description: The ID of a Product to add to the Product Collection. - type: string + $ref: ../components/schemas/AdminDeleteProductsFromCollectionReq.yaml x-codeSamples: - lang: Shell label: cURL diff --git a/docs/api/admin/paths/currencies.yaml b/docs/api/admin/paths/currencies.yaml index b707270a89..739390489f 100644 --- a/docs/api/admin/paths/currencies.yaml +++ b/docs/api/admin/paths/currencies.yaml @@ -53,7 +53,7 @@ get: currencies: type: array items: - $ref: ../components/schemas/currency.yaml + $ref: ../components/schemas/Currency.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/currencies_{code}.yaml b/docs/api/admin/paths/currencies_{code}.yaml index 70d8229a93..fc68439223 100644 --- a/docs/api/admin/paths/currencies_{code}.yaml +++ b/docs/api/admin/paths/currencies_{code}.yaml @@ -14,11 +14,7 @@ post: content: application/json: schema: - type: object - properties: - includes_tax: - type: boolean - description: '[EXPERIMENTAL] Tax included in prices of currency.' + $ref: ../components/schemas/AdminPostCurrenciesCurrencyReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -39,4 +35,4 @@ post: type: object properties: currency: - $ref: ../components/schemas/currency.yaml + $ref: ../components/schemas/Currency.yaml diff --git a/docs/api/admin/paths/customer-groups.yaml b/docs/api/admin/paths/customer-groups.yaml index 9d9787b29c..f3358f5dae 100644 --- a/docs/api/admin/paths/customer-groups.yaml +++ b/docs/api/admin/paths/customer-groups.yaml @@ -27,7 +27,7 @@ post: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -201,7 +201,7 @@ get: customer_groups: type: array items: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/customer-groups_{id}.yaml b/docs/api/admin/paths/customer-groups_{id}.yaml index 2d0b5c1fca..be757bb093 100644 --- a/docs/api/admin/paths/customer-groups_{id}.yaml +++ b/docs/api/admin/paths/customer-groups_{id}.yaml @@ -100,7 +100,7 @@ get: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -129,14 +129,7 @@ post: content: application/json: schema: - type: object - properties: - name: - description: Name of the customer group - type: string - metadata: - description: Metadata for the customer. - type: object + $ref: ../components/schemas/AdminPostCustomerGroupsGroupReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -160,7 +153,7 @@ post: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/customer-groups_{id}_customers.yaml b/docs/api/admin/paths/customer-groups_{id}_customers.yaml index 602adf0ae9..1e0f51e3a2 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers.yaml @@ -35,7 +35,7 @@ get: customers: type: array items: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml index a45e279435..026d2d010a 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml @@ -14,20 +14,8 @@ post: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to add - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + ../components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -53,7 +41,7 @@ post: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -82,20 +70,8 @@ delete: content: application/json: schema: - type: object - required: - - customer_ids - properties: - customer_ids: - description: The ids of the customers to remove - type: array - items: - required: - - id - properties: - id: - description: ID of the customer - type: string + $ref: >- + ../components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -121,7 +97,7 @@ delete: type: object properties: customer_group: - $ref: ../components/schemas/customer_group.yaml + $ref: ../components/schemas/CustomerGroup.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/customers.yaml b/docs/api/admin/paths/customers.yaml index 0b67b4bc8e..6a2c283eb8 100644 --- a/docs/api/admin/paths/customers.yaml +++ b/docs/api/admin/paths/customers.yaml @@ -7,35 +7,7 @@ post: content: application/json: schema: - type: object - required: - - email - - first_name - - last_name - - password - properties: - email: - type: string - description: The customer's email. - format: email - first_name: - type: string - description: The customer's first name. - last_name: - type: string - description: The customer's last name. - password: - type: string - description: The customer's password. - format: password - phone: - type: string - description: The customer's phone number. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostCustomersReq.yaml tags: - Customer x-codeSamples: @@ -59,7 +31,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -125,7 +97,7 @@ get: customers: type: array items: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/customers_{id}.yaml b/docs/api/admin/paths/customers_{id}.yaml index 4b729d7f9f..5295e0bd70 100644 --- a/docs/api/admin/paths/customers_{id}.yaml +++ b/docs/api/admin/paths/customers_{id}.yaml @@ -43,7 +43,7 @@ get: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -82,40 +82,7 @@ post: content: application/json: schema: - type: object - properties: - email: - type: string - description: The Customer's email. - format: email - first_name: - type: string - description: The Customer's first name. - last_name: - type: string - description: The Customer's last name. - phone: - type: string - description: The Customer's phone number. - password: - type: string - description: The Customer's password. - format: password - groups: - type: array - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - description: A list of customer groups to which the customer belongs. - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostCustomersCustomerReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -139,7 +106,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts.yaml b/docs/api/admin/paths/discounts.yaml index da81dcaf2e..48e56e3da4 100644 --- a/docs/api/admin/paths/discounts.yaml +++ b/docs/api/admin/paths/discounts.yaml @@ -20,141 +20,7 @@ post: content: application/json: schema: - type: object - required: - - code - - rule - - regions - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: boolean - description: >- - Whether the Discount should have multiple instances of itself, - each with a different code. This can be useful for automatically - generated codes that all have to follow a common set of rules. - default: false - rule: - description: The Discount Rule that defines how Discounts are calculated - type: object - required: - - type - - value - - allocation - properties: - description: - type: string - description: A short description of the discount - type: - type: string - description: >- - The type of the Discount, can be `fixed` for discounts that - reduce the price by a fixed amount, `percentage` for - percentage reductions or `free_shipping` for shipping - vouchers. - enum: - - fixed - - percentage - - free_shipping - value: - type: number - description: >- - The value that the discount represents; this will depend on - the type of the discount - allocation: - type: string - description: The scope that the discount should apply to. - enum: - - total - - item - conditions: - type: array - description: >- - A set of conditions that can be used to limit when the - discount can be used. Only one of `products`, - `product_types`, `product_collections`, `product_tags`, and - `customer_groups` should be provided. - items: - type: object - required: - - operator - properties: - operator: - type: string - description: Operator of the condition - enum: - - in - - not_in - products: - type: array - description: >- - list of product IDs if the condition is applied on - products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied - on product types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is - applied on product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied - on customer groups. - items: - type: string - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will have - to enable it later to make it available to Customers. - default: false - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: The time at which the Discount should no longer be available. - valid_duration: - type: string - description: Duration the discount runs between - example: P3Y6M4DT12H30M5S - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - usage_limit: - type: number - description: Maximum times the discount can be used - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostDiscountsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -178,7 +44,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -278,7 +144,7 @@ get: discounts: type: array items: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/discounts_code_{code}.yaml b/docs/api/admin/paths/discounts_code_{code}.yaml index b290e9417a..5d5997d34b 100644 --- a/docs/api/admin/paths/discounts_code_{code}.yaml +++ b/docs/api/admin/paths/discounts_code_{code}.yaml @@ -43,7 +43,7 @@ get: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml index 377c96c705..8ff0e9eef1 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml @@ -31,49 +31,7 @@ post: content: application/json: schema: - type: object - required: - - operator - properties: - operator: - description: Operator of the condition - type: string - enum: - - in - - not_in - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on product - types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied on - product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on product - tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: ../components/schemas/AdminPostDiscountsDiscountConditions.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -98,7 +56,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml index af581bd4e3..9730b4108e 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml @@ -65,7 +65,7 @@ delete: default: true discount: description: The Discount to which the condition used to belong - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -131,7 +131,7 @@ get: type: object properties: discount_condition: - $ref: ../components/schemas/discount_condition.yaml + $ref: ../components/schemas/DiscountCondition.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -183,41 +183,8 @@ post: content: application/json: schema: - type: object - properties: - products: - type: array - description: list of product IDs if the condition is applied on products. - items: - type: string - product_types: - type: array - description: >- - list of product type IDs if the condition is applied on product - types. - items: - type: string - product_collections: - type: array - description: >- - list of product collection IDs if the condition is applied on - product collections. - items: - type: string - product_tags: - type: array - description: >- - list of product tag IDs if the condition is applied on product - tags. - items: - type: string - customer_groups: - type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. - items: - type: string + $ref: >- + ../components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -243,7 +210,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml index dcfb03cc4c..104bd794c5 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml @@ -1,6 +1,6 @@ post: operationId: PostDiscountsDiscountConditionsConditionBatch - summary: Add a batch of resources to a discount condition + summary: Add Batch Resources description: Add a batch of resources to a discount condition. x-authenticated: true parameters: @@ -34,20 +34,8 @@ post: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be added to the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + ../components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -73,7 +61,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -88,7 +76,7 @@ post: $ref: ../components/responses/500_error.yaml delete: operationId: DeleteDiscountsDiscountConditionsConditionBatch - summary: Delete a batch of resources from a discount condition + summary: Delete Batch Resources description: Delete a batch of resources from a discount condition. x-authenticated: true parameters: @@ -122,20 +110,8 @@ delete: content: application/json: schema: - type: object - required: - - resources - properties: - resources: - description: The resources to be deleted from the discount condition - type: array - items: - required: - - id - properties: - id: - description: The id of the item - type: string + $ref: >- + ../components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -161,7 +137,7 @@ delete: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{id}.yaml b/docs/api/admin/paths/discounts_{id}.yaml index 571033e59e..bd7cf157c8 100644 --- a/docs/api/admin/paths/discounts_{id}.yaml +++ b/docs/api/admin/paths/discounts_{id}.yaml @@ -100,7 +100,7 @@ get: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -145,120 +145,7 @@ post: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminPostDiscountsDiscountReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -282,7 +169,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml index 4b1fccd709..f84d9639e1 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml @@ -35,7 +35,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml index a6203c3997..d1f2a7c71a 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml @@ -41,7 +41,7 @@ delete: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml index 85dc282dc2..da2a06418b 100644 --- a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml +++ b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml @@ -40,7 +40,7 @@ post: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -96,7 +96,7 @@ delete: type: object properties: discount: - $ref: ../components/schemas/discount.yaml + $ref: ../components/schemas/Discount.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/draft-orders.yaml b/docs/api/admin/paths/draft-orders.yaml index b15bf56296..7c57cc7065 100644 --- a/docs/api/admin/paths/draft-orders.yaml +++ b/docs/api/admin/paths/draft-orders.yaml @@ -7,106 +7,7 @@ post: content: application/json: schema: - type: object - required: - - email - - items - - region_id - - shipping_methods - properties: - status: - description: The status of the draft order - type: string - enum: - - open - - completed - email: - description: The email of the customer of the draft order - type: string - format: email - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: ../components/schemas/address_fields.yaml - - type: string - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: ../components/schemas/address_fields.yaml - - 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 + $ref: ../components/schemas/AdminPostDraftOrdersReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -130,7 +31,7 @@ post: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -193,7 +94,7 @@ get: draft_orders: type: array items: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/draft-orders_{id}.yaml b/docs/api/admin/paths/draft-orders_{id}.yaml index 76c2c7d7fe..c65beb2cff 100644 --- a/docs/api/admin/paths/draft-orders_{id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml index e0bbd3de00..843f755985 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml @@ -14,28 +14,8 @@ post: content: application/json: schema: - type: object - required: - - quantity - properties: - variant_id: - description: The ID of the Product Variant to generate the Line Item from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - default: Custom item - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object + $ref: >- + ../components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -59,7 +39,7 @@ post: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml index d91330afa7..7c10c48c6a 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml @@ -41,7 +41,7 @@ delete: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -76,22 +76,8 @@ post: content: application/json: schema: - type: object - properties: - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object + $ref: >- + ../components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -117,7 +103,7 @@ post: type: object properties: draft_order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/draft-orders_{id}_pay.yaml b/docs/api/admin/paths/draft-orders_{id}_pay.yaml index 9865df7c71..33498b2817 100644 --- a/docs/api/admin/paths/draft-orders_{id}_pay.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_pay.yaml @@ -33,7 +33,7 @@ post: type: object properties: order: - $ref: ../components/schemas/draft-order.yaml + $ref: ../components/schemas/DraftOrder.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/gift-cards.yaml b/docs/api/admin/paths/gift-cards.yaml index 9b7b83be5e..6a2bd0f9e4 100644 --- a/docs/api/admin/paths/gift-cards.yaml +++ b/docs/api/admin/paths/gift-cards.yaml @@ -9,30 +9,7 @@ post: content: application/json: schema: - type: object - required: - - region_id - properties: - value: - type: integer - description: The value (excluding VAT) that the Gift Card should represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have to - enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: The time at which the Gift Card should no longer be available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostGiftCardsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -56,7 +33,7 @@ post: type: object properties: gift_card: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -117,7 +94,7 @@ get: gift_cards: type: array items: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/gift-cards_{id}.yaml b/docs/api/admin/paths/gift-cards_{id}.yaml index f607e44f74..736536499e 100644 --- a/docs/api/admin/paths/gift-cards_{id}.yaml +++ b/docs/api/admin/paths/gift-cards_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: gift_card: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -121,28 +121,7 @@ post: content: application/json: schema: - type: object - properties: - balance: - type: integer - description: The value (excluding VAT) that the Gift Card should represent. - is_disabled: - type: boolean - description: >- - Whether the Gift Card is disabled on creation. You will have to - enable it later to make it available to Customers. - ends_at: - type: string - format: date-time - description: The time at which the Gift Card should no longer be available. - region_id: - description: The ID of the Region in which the Gift Card can be used. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostGiftCardsGiftCardReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -166,7 +145,7 @@ post: type: object properties: gift_card: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/invites.yaml b/docs/api/admin/paths/invites.yaml index ef4a2f8449..6de86e8dbf 100644 --- a/docs/api/admin/paths/invites.yaml +++ b/docs/api/admin/paths/invites.yaml @@ -7,22 +7,7 @@ post: content: application/json: schema: - type: object - required: - - user - - role - properties: - user: - description: The email for the user to be created. - type: string - format: email - role: - description: The role of the user to be created. - type: string - enum: - - admin - - member - - developer + $ref: ../components/schemas/AdminPostInvitesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -82,7 +67,7 @@ get: invites: type: array items: - $ref: ../components/schemas/invite.yaml + $ref: ../components/schemas/Invite.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/invites_accept.yaml b/docs/api/admin/paths/invites_accept.yaml index ec434b2eac..a6f393d12b 100644 --- a/docs/api/admin/paths/invites_accept.yaml +++ b/docs/api/admin/paths/invites_accept.yaml @@ -6,32 +6,7 @@ post: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminPostInvitesInviteAcceptReq.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/notes.yaml b/docs/api/admin/paths/notes.yaml index 38e4dfed12..a92fea1245 100644 --- a/docs/api/admin/paths/notes.yaml +++ b/docs/api/admin/paths/notes.yaml @@ -7,21 +7,7 @@ post: content: application/json: schema: - type: object - required: - - resource_id - - resource_type - - value - properties: - resource_id: - type: string - description: The ID of the resource which the Note relates to. - resource_type: - type: string - description: The type of resource which the Note relates to. - value: - type: string - description: The content of the Note to create. + $ref: ../components/schemas/AdminPostNotesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +31,7 @@ post: type: object properties: note: - $ref: ../components/schemas/note.yaml + $ref: ../components/schemas/Note.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -106,7 +92,7 @@ get: notes: type: array items: - $ref: ../components/schemas/note.yaml + $ref: ../components/schemas/Note.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/notes_{id}.yaml b/docs/api/admin/paths/notes_{id}.yaml index 6df867754a..2a363e121e 100644 --- a/docs/api/admin/paths/notes_{id}.yaml +++ b/docs/api/admin/paths/notes_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: note: - $ref: ../components/schemas/note.yaml + $ref: ../components/schemas/Note.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,13 +119,7 @@ post: content: application/json: schema: - type: object - required: - - value - properties: - value: - type: string - description: The updated description of the Note. + $ref: ../components/schemas/AdminPostNotesNoteReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -149,7 +143,7 @@ post: type: object properties: note: - $ref: ../components/schemas/note.yaml + $ref: ../components/schemas/Note.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/notifications.yaml b/docs/api/admin/paths/notifications.yaml index 5eef45e280..d34b6f4804 100644 --- a/docs/api/admin/paths/notifications.yaml +++ b/docs/api/admin/paths/notifications.yaml @@ -82,7 +82,7 @@ get: notifications: type: array items: - $ref: ../components/schemas/notification.yaml + $ref: ../components/schemas/Notification.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/notifications_{id}_resend.yaml b/docs/api/admin/paths/notifications_{id}_resend.yaml index 1a782230ef..4ac15c94f6 100644 --- a/docs/api/admin/paths/notifications_{id}_resend.yaml +++ b/docs/api/admin/paths/notifications_{id}_resend.yaml @@ -16,13 +16,8 @@ post: content: application/json: schema: - type: object - properties: - to: - description: >- - A new address or user identifier that the Notification should be - sent to - type: string + $ref: >- + ../components/schemas/AdminPostNotificationsNotificationResendReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -46,7 +41,7 @@ post: type: object properties: notification: - $ref: ../components/schemas/notification.yaml + $ref: ../components/schemas/Notification.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits.yaml b/docs/api/admin/paths/order-edits.yaml index d0fd4c5836..7f1af81759 100644 --- a/docs/api/admin/paths/order-edits.yaml +++ b/docs/api/admin/paths/order-edits.yaml @@ -6,16 +6,7 @@ post: content: application/json: schema: - type: object - required: - - order_id - properties: - order_id: - description: The ID of the order to create the edit for. - type: string - internal_note: - description: An optional note to create for the order edit. - type: string + $ref: ../components/schemas/AdminPostOrderEditsReq.yaml x-authenticated: true x-codeSamples: - lang: JavaScript @@ -40,7 +31,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -115,7 +106,7 @@ get: properties: order_edits: type: array - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/order-edits_{id}.yaml b/docs/api/admin/paths/order-edits_{id}.yaml index 5c4b92f53e..b968c8f7b8 100644 --- a/docs/api/admin/paths/order-edits_{id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}.yaml @@ -1,7 +1,7 @@ delete: operationId: DeleteOrderEditsOrderEdit summary: Delete an Order Edit - description: Deletes an Order Edit + description: Delete an Order Edit x-authenticated: true parameters: - in: path @@ -47,7 +47,7 @@ delete: $ref: ../components/responses/400_error.yaml get: operationId: GetOrderEditsOrderEdit - summary: Retrieve an OrderEdit + summary: Get an OrderEdit description: Retrieves a OrderEdit. x-authenticated: true parameters: @@ -90,7 +90,7 @@ get: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -105,7 +105,7 @@ get: $ref: ../components/responses/500_error.yaml post: operationId: PostOrderEditsOrderEdit - summary: Updates an OrderEdit + summary: Update an OrderEdit description: Updates a OrderEdit. x-authenticated: true parameters: @@ -119,11 +119,7 @@ post: content: application/json: schema: - type: object - properties: - internal_note: - description: An optional note to create or update for the order edit. - type: string + $ref: ../components/schemas/AdminPostOrderEditsOrderEditReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -147,7 +143,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_cancel.yaml b/docs/api/admin/paths/order-edits_{id}_cancel.yaml index ac8584dc54..e378f19a34 100644 --- a/docs/api/admin/paths/order-edits_{id}_cancel.yaml +++ b/docs/api/admin/paths/order-edits_{id}_cancel.yaml @@ -33,7 +33,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml b/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml index a564f649b3..c4cbba55dd 100644 --- a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml @@ -1,6 +1,6 @@ delete: operationId: DeleteOrderEditsOrderEditItemChange - summary: Delete an Order Edit Item Change + summary: Delete a Line Item Change description: Deletes an Order Edit Item Change x-authenticated: true parameters: diff --git a/docs/api/admin/paths/order-edits_{id}_confirm.yaml b/docs/api/admin/paths/order-edits_{id}_confirm.yaml index 5614450bda..0f035a3369 100644 --- a/docs/api/admin/paths/order-edits_{id}_confirm.yaml +++ b/docs/api/admin/paths/order-edits_{id}_confirm.yaml @@ -33,7 +33,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_items.yaml b/docs/api/admin/paths/order-edits_{id}_items.yaml index aa105f7af6..cdb50f40b3 100644 --- a/docs/api/admin/paths/order-edits_{id}_items.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items.yaml @@ -1,6 +1,6 @@ post: operationId: PostOrderEditsEditLineItems - summary: Add an line item to an order (edit) + summary: Add a Line Item description: Create an OrderEdit LineItem. parameters: - in: path @@ -13,22 +13,7 @@ post: content: application/json: schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the variant ID to add - type: string - quantity: - description: The quantity to add - type: number - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml x-authenticated: true x-codeSamples: - lang: JavaScript @@ -53,7 +38,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml index 4cc271b53b..30b79062b8 100644 --- a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml @@ -1,6 +1,6 @@ delete: operationId: DeleteOrderEditsOrderEditLineItemsLineItem - summary: Delete line items from an order edit and create change item + summary: Delete a Line Item description: Delete line items from an order edit and create change item x-authenticated: true parameters: @@ -40,7 +40,7 @@ delete: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -55,7 +55,7 @@ delete: $ref: ../components/responses/500_error.yaml post: operationId: PostOrderEditsEditLineItemsLineItem - summary: Create or update the order edit change holding the line item changes + summary: Upsert Line Item Change description: Create or update the order edit change holding the line item changes x-authenticated: true parameters: @@ -75,13 +75,8 @@ post: content: application/json: schema: - type: object - required: - - quantity - properties: - quantity: - description: The quantity to update - type: number + $ref: >- + ../components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -106,7 +101,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order-edits_{id}_request.yaml b/docs/api/admin/paths/order-edits_{id}_request.yaml index 145cc617b6..c0a23d74bf 100644 --- a/docs/api/admin/paths/order-edits_{id}_request.yaml +++ b/docs/api/admin/paths/order-edits_{id}_request.yaml @@ -1,6 +1,6 @@ post: operationId: PostOrderEditsOrderEditRequest - summary: Request order edit confirmation + summary: Request Confirmation description: Request customer confirmation of an Order Edit x-authenticated: true parameters: @@ -33,7 +33,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order_{id}_claims.yaml b/docs/api/admin/paths/order_{id}_claims.yaml index b337301ed5..2d4aee6462 100644 --- a/docs/api/admin/paths/order_{id}_claims.yaml +++ b/docs/api/admin/paths/order_{id}_claims.yaml @@ -14,124 +14,7 @@ post: content: application/json: schema: - type: object - required: - - type - - claim_items - properties: - type: - description: >- - The type of the Claim. This will determine how the Claim is - treated: `replace` Claims will result in a Fulfillment with new - items being created, while a `refund` Claim will refund the - amount paid for the claimed items. - type: string - enum: - - replace - - refund - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: Short text describing the Claim Item in further detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: string - images: - description: >- - A list of image URL's that will be associated with the - Claim - items: - type: string - return_shipping: - description: >- - Optional details for the Return Shipping Method, if the items - are to be sent back. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping Method - from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - shipping_address: - type: object - description: >- - An optional shipping address to send the claim to. Defaults to - the parent order's shipping address - $ref: ../components/schemas/address.yaml - 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 + $ref: ../components/schemas/AdminPostOrdersOrderClaimsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -155,7 +38,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml index 4378a9fcc9..0554d754b8 100644 --- a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml +++ b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml @@ -20,94 +20,7 @@ post: content: application/json: schema: - type: object - properties: - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - required: - - id - - images - - tags - properties: - id: - description: The ID of the Claim Item. - type: string - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: Short text describing the Claim Item in further detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: object - properties: - id: - type: string - description: Tag ID - value: - type: string - description: Tag value - images: - description: >- - A list of image URL's that will be associated with the - Claim - type: array - items: - type: object - properties: - id: - type: string - description: Image ID - url: - type: string - description: Image URL - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The ID of an existing Shipping Method - type: string - option_id: - description: >- - The ID of the Shipping Option to create a Shipping Method - from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -131,7 +44,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/order_{id}_swaps.yaml b/docs/api/admin/paths/order_{id}_swaps.yaml index 01dcb5f09e..3730e0c5d1 100644 --- a/docs/api/admin/paths/order_{id}_swaps.yaml +++ b/docs/api/admin/paths/order_{id}_swaps.yaml @@ -16,85 +16,7 @@ post: content: application/json: schema: - type: object - required: - - return_items - properties: - return_items: - description: The Line Items to return as part of the Swap. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - return_shipping: - description: How the Swap will be returned. - type: object - required: - - option_id - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: The new items to send to the Customer. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: The ID of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - custom_shipping_options: - description: >- - The custom shipping options to potentially create a Shipping - Method from. - type: array - items: - required: - - option_id - - price - properties: - option_id: - description: >- - The ID of the Shipping Option to override with a custom - price. - type: string - price: - description: The custom price of the Shipping Option. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - allow_backorder: - description: If true, swaps can be completed with items out of stock - type: boolean - default: true + $ref: ../components/schemas/AdminPostOrdersOrderSwapsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -118,7 +40,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders.yaml b/docs/api/admin/paths/orders.yaml index 435a893e15..fd89f2bd8a 100644 --- a/docs/api/admin/paths/orders.yaml +++ b/docs/api/admin/paths/orders.yaml @@ -242,7 +242,7 @@ get: orders: type: array items: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/orders_{id}.yaml b/docs/api/admin/paths/orders_{id}.yaml index 98e4b6e24e..8d172d6e7c 100644 --- a/docs/api/admin/paths/orders_{id}.yaml +++ b/docs/api/admin/paths/orders_{id}.yaml @@ -33,7 +33,7 @@ get: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -62,71 +62,7 @@ post: content: application/json: schema: - type: object - properties: - email: - description: the email for the order - type: string - billing_address: - description: Billing address - anyOf: - - $ref: ../components/schemas/address_fields.yaml - shipping_address: - description: Shipping address - anyOf: - - $ref: ../components/schemas/address_fields.yaml - items: - description: The Line Items for the order - type: array - items: - $ref: ../components/schemas/line_item.yaml - 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.yaml - customer_id: - description: ID of the customer - type: string - payment_method: - description: payment method chosen for the order - type: object - properties: - provider_id: - type: string - description: ID of the payment provider - data: - description: Data relevant for the given payment method - type: object - shipping_method: - description: The Shipping Method used for shipping the order. - type: object - properties: - provider_id: - type: string - description: The ID of the shipping provider. - profile_id: - type: string - description: The ID of the shipping profile. - price: - type: integer - description: The price of the shipping. - data: - type: object - description: Data relevant to the specific shipping method. - items: - type: array - items: - $ref: ../components/schemas/line_item.yaml - description: Items to ship - no_notification: - description: >- - A flag to indicate if no notifications should be emitted related - to the updated order. - type: boolean + $ref: ../components/schemas/AdminPostOrdersOrderReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -150,7 +86,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_archive.yaml b/docs/api/admin/paths/orders_{id}_archive.yaml index 0975e57931..d2e57d0960 100644 --- a/docs/api/admin/paths/orders_{id}_archive.yaml +++ b/docs/api/admin/paths/orders_{id}_archive.yaml @@ -33,7 +33,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_cancel.yaml index edb1c6636c..2f46c1853b 100644 --- a/docs/api/admin/paths/orders_{id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_cancel.yaml @@ -36,7 +36,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_capture.yaml b/docs/api/admin/paths/orders_{id}_capture.yaml index a9ced207e1..2640a03b48 100644 --- a/docs/api/admin/paths/orders_{id}_capture.yaml +++ b/docs/api/admin/paths/orders_{id}_capture.yaml @@ -33,7 +33,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml index 2016427c17..04951b25c7 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml @@ -41,7 +41,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml index 99c746a51d..8a4e372cdc 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml @@ -20,18 +20,8 @@ post: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + ../components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -57,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml index af476dc33a..957be39b25 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -47,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml index 41690eaf23..30814ec8da 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml @@ -20,18 +20,8 @@ post: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string + $ref: >- + ../components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -57,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_complete.yaml b/docs/api/admin/paths/orders_{id}_complete.yaml index b5b778944f..3c51f1298a 100644 --- a/docs/api/admin/paths/orders_{id}_complete.yaml +++ b/docs/api/admin/paths/orders_{id}_complete.yaml @@ -33,7 +33,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_fulfillment.yaml b/docs/api/admin/paths/orders_{id}_fulfillment.yaml index 79a007905c..1d2fac8cf6 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillment.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillment.yaml @@ -16,34 +16,7 @@ post: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items to include in the Fulfillment. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of Line Item to fulfill. - type: string - quantity: - description: The quantity of the Line Item to fulfill. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -67,7 +40,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml index af2e69f609..1eaef848b0 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -41,7 +41,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_refund.yaml b/docs/api/admin/paths/orders_{id}_refund.yaml index 78cc3ae1fc..9ec6262938 100644 --- a/docs/api/admin/paths/orders_{id}_refund.yaml +++ b/docs/api/admin/paths/orders_{id}_refund.yaml @@ -14,25 +14,7 @@ post: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Refund. - type: boolean + $ref: ../components/schemas/AdminPostOrdersOrderRefundsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -56,7 +38,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.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/orders_{id}_return.yaml index cc705d9908..b1a6e0387d 100644 --- a/docs/api/admin/paths/orders_{id}_return.yaml +++ b/docs/api/admin/paths/orders_{id}_return.yaml @@ -16,59 +16,7 @@ post: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that will be returned. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - reason_id: - description: The ID of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - return_shipping: - description: The Shipping Method to be used to handle the return shipment. - type: object - properties: - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - price: - type: integer - description: The price to charge for the Shipping Method. - note: - description: An optional note with information about the Return. - 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 + $ref: ../components/schemas/AdminPostOrdersOrderReturnsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -93,7 +41,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_shipment.yaml b/docs/api/admin/paths/orders_{id}_shipment.yaml index 30c6c49b3b..342b5e38cb 100644 --- a/docs/api/admin/paths/orders_{id}_shipment.yaml +++ b/docs/api/admin/paths/orders_{id}_shipment.yaml @@ -14,23 +14,7 @@ post: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Shipment. - type: boolean + $ref: ../components/schemas/AdminPostOrdersOrderShipmentReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -54,7 +38,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml index 5383f21bb6..044c460284 100644 --- a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml +++ b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml @@ -35,7 +35,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml index 4df3ddca51..7bdc8fdcfd 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml @@ -40,7 +40,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml index 5fa53506cb..3c87673b34 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml @@ -20,18 +20,8 @@ post: content: application/json: schema: - type: object - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean + $ref: >- + ../components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -57,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml index 1e2101fa3c..b4924eb557 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -47,7 +47,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml index 2124ae886c..180c2c8172 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml @@ -44,7 +44,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml index 302533759c..46e984cd91 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml @@ -20,23 +20,7 @@ post: content: application/json: schema: - type: object - required: - - fulfillment_id - properties: - fulfillment_id: - description: The ID of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be sent related to this - Claim. - type: boolean + $ref: ../components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -62,7 +46,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payment-collections_{id}.yaml b/docs/api/admin/paths/payment-collections_{id}.yaml index 23ef45ecb0..7ea1b8c985 100644 --- a/docs/api/admin/paths/payment-collections_{id}.yaml +++ b/docs/api/admin/paths/payment-collections_{id}.yaml @@ -1,6 +1,6 @@ delete: operationId: DeletePaymentCollectionsPaymentCollection - summary: Delete a Payment Collection + summary: Del a PaymentCollection description: Deletes a Payment Collection x-authenticated: true parameters: @@ -49,7 +49,7 @@ delete: $ref: ../components/responses/unauthorized.yaml get: operationId: GetPaymentCollectionsPaymentCollection - summary: Retrieve an PaymentCollection + summary: Get a PaymentCollection description: Retrieves a PaymentCollection. x-authenticated: true parameters: @@ -92,7 +92,7 @@ get: type: object properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -107,7 +107,7 @@ get: $ref: ../components/responses/500_error.yaml post: operationId: PostPaymentCollectionsPaymentCollection - summary: Updates a PaymentCollection + summary: Update PaymentCollection description: Updates a PaymentCollection. x-authenticated: true parameters: @@ -121,18 +121,7 @@ post: content: application/json: schema: - type: object - properties: - description: - description: >- - An optional description to create or update the payment - collection. - type: string - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object + $ref: ../components/schemas/AdminUpdatePaymentCollectionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -156,7 +145,7 @@ post: type: object properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payment-collections_{id}_authorize.yaml b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml index f70e0629ef..023819f387 100644 --- a/docs/api/admin/paths/payment-collections_{id}_authorize.yaml +++ b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml @@ -1,6 +1,6 @@ post: operationId: PostPaymentCollectionsPaymentCollectionAuthorize - summary: Set the status of PaymentCollection as Authorized + summary: Mark Authorized description: Sets the status of PaymentCollection as Authorized. x-authenticated: true parameters: @@ -34,7 +34,7 @@ post: type: object properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payments_{id}.yaml b/docs/api/admin/paths/payments_{id}.yaml index 298c23a4dd..261c03bc84 100644 --- a/docs/api/admin/paths/payments_{id}.yaml +++ b/docs/api/admin/paths/payments_{id}.yaml @@ -33,7 +33,7 @@ get: type: object properties: payment: - $ref: ../components/schemas/payment.yaml + $ref: ../components/schemas/Payment.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payments_{id}_capture.yaml b/docs/api/admin/paths/payments_{id}_capture.yaml index 1a2f9a6ffd..c60c0f33e9 100644 --- a/docs/api/admin/paths/payments_{id}_capture.yaml +++ b/docs/api/admin/paths/payments_{id}_capture.yaml @@ -33,7 +33,7 @@ post: type: object properties: payment: - $ref: ../components/schemas/payment.yaml + $ref: ../components/schemas/Payment.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/payments_{id}_refund.yaml b/docs/api/admin/paths/payments_{id}_refund.yaml index c25d1eef1e..4e2b2feb56 100644 --- a/docs/api/admin/paths/payments_{id}_refund.yaml +++ b/docs/api/admin/paths/payments_{id}_refund.yaml @@ -14,20 +14,7 @@ post: content: application/json: schema: - type: object - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. - type: string - note: - description: A note with additional details about the Refund. - type: string + $ref: ../components/schemas/AdminPostPaymentRefundsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -51,7 +38,7 @@ post: type: object properties: refund: - $ref: ../components/schemas/refund.yaml + $ref: ../components/schemas/Refund.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/price-lists.yaml b/docs/api/admin/paths/price-lists.yaml index 6d69d0c6b5..a80ea6ebaa 100644 --- a/docs/api/admin/paths/price-lists.yaml +++ b/docs/api/admin/paths/price-lists.yaml @@ -7,85 +7,7 @@ post: content: application/json: schema: - type: object - required: - - name - - description - - type - - prices - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: The date with timezone that the Price List starts being valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - variant_id: - description: The ID of the Variant for which the price is used. - type: string - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: ../components/schemas/AdminPostPriceListsPriceListReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -109,7 +31,7 @@ post: type: object properties: price_list: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -293,7 +215,7 @@ get: price_lists: type: array items: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/price-lists_{id}.yaml b/docs/api/admin/paths/price-lists_{id}.yaml index e5d440d8a7..a4262d9979 100644 --- a/docs/api/admin/paths/price-lists_{id}.yaml +++ b/docs/api/admin/paths/price-lists_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: price_list: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,83 +119,7 @@ post: content: application/json: schema: - type: object - properties: - name: - description: The name of the Price List - type: string - description: - description: A description of the Price List. - type: string - starts_at: - description: The date with timezone that the Price List starts being valid. - type: string - format: date - ends_at: - description: The date with timezone that the Price List ends being valid. - type: string - format: date - type: - description: The type of the Price List. - type: string - enum: - - sale - - override - status: - description: The status of the Price List. - type: string - enum: - - active - - draft - prices: - description: The prices of the Price List. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - customer_groups: - type: array - description: A list of customer groups that the Price List applies to. - items: - required: - - id - properties: - id: - description: The ID of a customer group - type: string - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of price list' - type: boolean + $ref: ../components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -219,7 +143,7 @@ post: type: object properties: price_list: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml index 8cd6653167..489dc91870 100644 --- a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml +++ b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml @@ -14,49 +14,7 @@ post: content: application/json: schema: - type: object - properties: - prices: - description: The prices to update or add. - type: array - items: - required: - - amount - - variant_id - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - variant_id: - description: The ID of the Variant for which the price is used. - type: string - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - override: - description: >- - If true the prices will replace all existing prices associated - with the Price List. - type: boolean + $ref: ../components/schemas/AdminPostPriceListPricesPricesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -80,7 +38,7 @@ post: type: object properties: price_list: - $ref: ../components/schemas/price_list.yaml + $ref: ../components/schemas/PriceList.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -111,13 +69,7 @@ delete: content: application/json: schema: - type: object - properties: - price_ids: - description: The price id's of the Money Amounts to delete. - type: array - items: - type: string + $ref: ../components/schemas/AdminDeletePriceListPricesPricesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/price-lists_{id}_products.yaml b/docs/api/admin/paths/price-lists_{id}_products.yaml index 8ab10beb00..66d89f48b1 100644 --- a/docs/api/admin/paths/price-lists_{id}_products.yaml +++ b/docs/api/admin/paths/price-lists_{id}_products.yaml @@ -201,7 +201,7 @@ get: products: type: array items: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/product-tags.yaml b/docs/api/admin/paths/product-tags.yaml index af33fea80e..dbf6d2eed6 100644 --- a/docs/api/admin/paths/product-tags.yaml +++ b/docs/api/admin/paths/product-tags.yaml @@ -116,7 +116,7 @@ get: type: object properties: product_tags: - $ref: ../components/schemas/product_tag.yaml + $ref: ../components/schemas/ProductTag.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/product-types.yaml b/docs/api/admin/paths/product-types.yaml index 00a5779158..32c4deb44f 100644 --- a/docs/api/admin/paths/product-types.yaml +++ b/docs/api/admin/paths/product-types.yaml @@ -116,7 +116,7 @@ get: type: object properties: product_types: - $ref: ../components/schemas/product_type.yaml + $ref: ../components/schemas/ProductType.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/products.yaml b/docs/api/admin/paths/products.yaml index 9501af2435..f8751763ad 100644 --- a/docs/api/admin/paths/products.yaml +++ b/docs/api/admin/paths/products.yaml @@ -7,241 +7,7 @@ post: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product - type: string - subtitle: - description: The subtitle of the Product - type: string - description: - description: A description of the Product. - type: string - is_giftcard: - description: >- - A flag to indicate if the Product represents a Gift Card. - Purchasing Products with this flag set to `true` will result in - a Gift Card being created. - type: boolean - default: false - discountable: - description: >- - A flag to indicate if discounts can be applied to the LineItems - generated from this Product - type: boolean - default: true - images: - description: Images of the Product. - type: array - items: - type: string - thumbnail: - description: The thumbnail to use for the Product. - type: string - handle: - description: A unique handle to identify the Product by. - type: string - status: - description: The status of the product. - type: string - enum: - - draft - - proposed - - published - - rejected - default: draft - type: - description: The Product Type to associate the Product with. - type: object - required: - - value - properties: - id: - description: The ID of the Product Type. - type: string - value: - description: The value of the Product Type. - type: string - collection_id: - description: The ID of the Collection the Product should belong to. - type: string - tags: - description: Tags to associate the Product with. - type: array - items: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: The value of the Tag, these will be upserted. - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - options: - description: >- - The Options that the Product should have. These define on which - properties the Product's Product Variants will differ. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Option by. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - required: - - title - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - region_id: - description: >- - The ID of the Region for which the price is used. - Only required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id is - not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - value - properties: - value: - description: >- - The value to give for the Product Option at the same - index in the Product's `options` field. - type: string - weight: - description: The weight of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostProductsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -265,7 +31,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -480,6 +246,11 @@ get: result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -505,7 +276,7 @@ get: products: type: array items: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/products_types.yaml b/docs/api/admin/paths/products_types.yaml index 0e66866033..3a59bf42c9 100644 --- a/docs/api/admin/paths/products_types.yaml +++ b/docs/api/admin/paths/products_types.yaml @@ -29,7 +29,7 @@ get: types: type: array items: - $ref: ../components/schemas/product_type.yaml + $ref: ../components/schemas/ProductType.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}.yaml b/docs/api/admin/paths/products_{id}.yaml index 8f5a1fb944..9aa12442b0 100644 --- a/docs/api/admin/paths/products_{id}.yaml +++ b/docs/api/admin/paths/products_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,222 +119,7 @@ post: content: application/json: schema: - 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: - required: - - value - properties: - id: - description: The ID of an existing Tag. - type: string - value: - description: The value of the Tag, these will be upserted. - type: string - sales_channels: - description: '[EXPERIMENTAL] Sales channels to associate the Product with.' - type: array - items: - required: - - id - properties: - id: - description: The ID of an existing Sales channel. - type: string - variants: - description: A list of Product Variants to create with the Product. - type: array - items: - properties: - id: - description: The ID of the Product Variant. - type: string - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: >- - The Manufacturer Identification code for the Product - Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the Price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. - Only required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the - price will be used. Only required if region_id is - not provided. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: >- - The minimum quantity for which the price will be - used. - type: integer - max_quantity: - description: >- - The maximum quantity for which the price will be - used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Option. - type: string - value: - description: >- - The value to give for the Product Option at the same - index in the Product's `options` field. - type: string - weight: - description: The wieght of the Product. - type: number - length: - description: The length of the Product. - type: number - height: - description: The height of the Product. - type: number - width: - description: The width of the Product. - type: number - origin_country: - description: The country of origin of the Product. - type: string - mid_code: - description: The Manufacturer Identification code for the Product. - type: string - material: - description: The material composition of the Product. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostProductsProductReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -358,7 +143,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}_metadata.yaml b/docs/api/admin/paths/products_{id}_metadata.yaml index a12924da0e..3763a0bd21 100644 --- a/docs/api/admin/paths/products_{id}_metadata.yaml +++ b/docs/api/admin/paths/products_{id}_metadata.yaml @@ -14,17 +14,7 @@ post: content: application/json: schema: - type: object - required: - - key - - value - properties: - key: - description: The metadata key - type: string - value: - description: The metadata value - type: string + $ref: ../components/schemas/AdminPostProductsProductMetadataReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -48,7 +38,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}_options.yaml b/docs/api/admin/paths/products_{id}_options.yaml index 1759a58c75..e3dfbe91ad 100644 --- a/docs/api/admin/paths/products_{id}_options.yaml +++ b/docs/api/admin/paths/products_{id}_options.yaml @@ -14,13 +14,7 @@ post: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title the Product Option will be identified by i.e. "Size" - type: string + $ref: ../components/schemas/AdminPostProductsProductOptionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -44,7 +38,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml index f508f113c0..8ddc2ab70f 100644 --- a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml +++ b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml @@ -55,7 +55,7 @@ delete: description: Whether or not the items were deleted. default: true product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -90,13 +90,7 @@ post: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: The title of the Product Option - type: string + $ref: ../components/schemas/AdminPostProductsProductOptionsOption.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -121,7 +115,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/products_{id}_variants.yaml b/docs/api/admin/paths/products_{id}_variants.yaml index 63efd59531..2f9f540936 100644 --- a/docs/api/admin/paths/products_{id}_variants.yaml +++ b/docs/api/admin/paths/products_{id}_variants.yaml @@ -16,110 +16,7 @@ post: content: application/json: schema: - type: object - required: - - title - - prices - - options - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - default: 0 - allow_backorder: - description: Whether the Product Variant can be purchased when out of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The wieght of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: The Manufacturer Identification code for the Product Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: ../components/schemas/AdminPostProductsProductVariantsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -143,7 +40,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -211,7 +108,7 @@ get: variants: type: array items: - $ref: ../components/schemas/product_variant.yaml + $ref: ../components/schemas/ProductVariant.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml index e72e74992b..97be489152 100644 --- a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml +++ b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml @@ -52,7 +52,7 @@ delete: description: Whether or not the items were deleted. default: true product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -87,107 +87,8 @@ post: content: application/json: schema: - type: object - required: - - prices - properties: - title: - description: The title to identify the Product Variant by. - type: string - sku: - description: The unique SKU for the Product Variant. - type: string - ean: - description: The EAN number of the item. - type: string - upc: - description: The UPC number of the item. - type: string - barcode: - description: A generic GTIN field for the Product Variant. - type: string - hs_code: - description: The Harmonized System code for the Product Variant. - type: string - inventory_quantity: - description: The amount of stock kept for the Product Variant. - type: integer - allow_backorder: - description: Whether the Product Variant can be purchased when out of stock. - type: boolean - manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. - type: boolean - weight: - description: The weight of the Product Variant. - type: number - length: - description: The length of the Product Variant. - type: number - height: - description: The height of the Product Variant. - type: number - width: - description: The width of the Product Variant. - type: number - origin_country: - description: The country of origin of the Product Variant. - type: string - mid_code: - description: The Manufacturer Identification code for the Product Variant. - type: string - material: - description: The material composition of the Product Variant. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object - prices: - type: array - items: - required: - - amount - properties: - id: - description: The ID of the price. - type: string - region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. - type: string - currency_code: - description: >- - The 3 character ISO currency code for which the price will - be used. Only required if region_id is not provided. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - amount: - description: The amount to charge for the Product Variant. - type: integer - min_quantity: - description: The minimum quantity for which the price will be used. - type: integer - max_quantity: - description: The maximum quantity for which the price will be used. - type: integer - options: - type: array - items: - required: - - option_id - - value - properties: - option_id: - description: The ID of the Product Option to set the value for. - type: string - value: - description: The value to give for the Product Option. - type: string + $ref: >- + ../components/schemas/AdminPostProductsProductVariantsVariantReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -213,7 +114,7 @@ post: type: object properties: product: - $ref: ../components/schemas/product.yaml + $ref: ../components/schemas/Product.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-key_{id}.yaml b/docs/api/admin/paths/publishable-api-key_{id}.yaml index 9708176000..a8153dbf1c 100644 --- a/docs/api/admin/paths/publishable-api-key_{id}.yaml +++ b/docs/api/admin/paths/publishable-api-key_{id}.yaml @@ -1,6 +1,6 @@ post: operationId: PostPublishableApiKysPublishableApiKey - summary: Updates a PublishableApiKey + summary: Update PublishableApiKey description: Updates a PublishableApiKey. x-authenticated: true parameters: @@ -14,11 +14,8 @@ post: content: application/json: schema: - type: object - properties: - title: - description: A title to update for the key. - type: string + $ref: >- + ../components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -42,7 +39,7 @@ post: type: object properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys.yaml b/docs/api/admin/paths/publishable-api-keys.yaml index 3b0fec67e5..515c76488d 100644 --- a/docs/api/admin/paths/publishable-api-keys.yaml +++ b/docs/api/admin/paths/publishable-api-keys.yaml @@ -1,18 +1,12 @@ post: operationId: PostPublishableApiKeys - summary: Create a PublishableApiKey + summary: Create PublishableApiKey description: Creates a PublishableApiKey. requestBody: content: application/json: schema: - type: object - required: - - title - properties: - title: - description: A title for the publishable api key - type: string + $ref: ../components/schemas/AdminPostPublishableApiKeysReq.yaml x-authenticated: true x-codeSamples: - lang: JavaScript @@ -37,7 +31,7 @@ post: type: object properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -107,7 +101,7 @@ get: properties: publishable_api_keys: type: array - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys_{id}.yaml b/docs/api/admin/paths/publishable-api-keys_{id}.yaml index d4352511a2..2866fb8cad 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}.yaml @@ -1,6 +1,6 @@ delete: operationId: DeletePublishableApiKeysPublishableApiKey - summary: Delete a PublishableApiKey + summary: Delete PublishableApiKey description: Deletes a PublishableApiKeys x-authenticated: true parameters: @@ -47,7 +47,7 @@ delete: $ref: ../components/responses/400_error.yaml get: operationId: GetPublishableApiKeysPublishableApiKey - summary: Get a Publishable API Key + summary: Get a PublishableApiKey description: Retrieve the Publishable Api Key. parameters: - in: path @@ -80,7 +80,7 @@ get: type: object properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml index f97a61a77a..5520c369e5 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml @@ -1,6 +1,6 @@ post: operationId: PostPublishableApiKeysPublishableApiKeyRevoke - summary: Revoke a PublishableApiKey + summary: Revoke PublishableApiKey description: Revokes a PublishableApiKey. parameters: - in: path @@ -34,7 +34,7 @@ post: type: object properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml index e3b2336dd7..8ae7c7c18a 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml @@ -1,6 +1,6 @@ get: operationId: GetPublishableApiKeySalesChannels - summary: List PublishableApiKey's SalesChannels + summary: List SalesChannels description: List PublishableApiKey's SalesChannels x-authenticated: true parameters: @@ -10,6 +10,11 @@ get: 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-codeSamples: - lang: JavaScript label: JS Client @@ -36,7 +41,7 @@ get: sales_channels: type: array items: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml index 6ee16f2114..fcd71624d7 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml @@ -1,6 +1,6 @@ post: operationId: PostPublishableApiKeySalesChannelsChannelsBatch - summary: Add sales channel to a publishable api key scope + summary: Add SalesChannels description: Assign a batch of sales channels to a publishable api key. x-authenticated: true parameters: @@ -14,20 +14,8 @@ post: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: The IDs of the sales channels to add to the publishable api key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + ../components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -52,7 +40,7 @@ post: schema: properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -67,7 +55,7 @@ post: $ref: ../components/responses/500_error.yaml delete: operationId: DeletePublishableApiKeySalesChannelsChannelsBatch - summary: Remove sales channel from a publishable api key scope + summary: Delete SalesChannels description: Remove a batch of sales channels from a publishable api key. x-authenticated: true parameters: @@ -81,22 +69,8 @@ delete: content: application/json: schema: - required: - - sales_channel_ids - properties: - sales_channel_ids: - description: >- - The IDs of the sales channels to delete from the publishable api - key - type: array - items: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the sales channel + $ref: >- + ../components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -121,7 +95,7 @@ delete: schema: properties: publishable_api_key: - $ref: ../components/schemas/publishable_api_key.yaml + $ref: ../components/schemas/PublishableApiKey.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions.yaml b/docs/api/admin/paths/regions.yaml index 08eb2548f9..cb9689cadb 100644 --- a/docs/api/admin/paths/regions.yaml +++ b/docs/api/admin/paths/regions.yaml @@ -7,56 +7,7 @@ post: content: application/json: schema: - type: object - required: - - name - - currency_code - - tax_rate - - payment_providers - - fulfillment_providers - - countries - properties: - name: - description: The name of the Region - type: string - currency_code: - description: The 3 character ISO currency code to use for the Region. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - tax_code: - description: An optional tax code the Region. - 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 + $ref: ../components/schemas/AdminPostRegionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -80,7 +31,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -162,7 +113,7 @@ get: regions: type: array items: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/regions_{id}.yaml b/docs/api/admin/paths/regions_{id}.yaml index a029d709ab..3af3854927 100644 --- a/docs/api/admin/paths/regions_{id}.yaml +++ b/docs/api/admin/paths/regions_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,63 +119,7 @@ post: content: application/json: schema: - type: object - properties: - name: - description: The name of the Region - type: string - currency_code: - description: The 3 character ISO currency code to use for the Region. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - automatic_taxes: - description: >- - If true Medusa will automatically calculate taxes for carts in - this region. If false you have to manually call POST - /carts/:id/taxes. - type: boolean - gift_cards_taxable: - description: >- - Whether gift cards in this region should be applied sales tax - when purchasing a gift card - type: boolean - tax_provider_id: - description: >- - The ID of the tax provider to use; if null the system tax - provider is used - type: string - tax_code: - description: An optional tax code the Region. - type: string - tax_rate: - description: The tax rate to use on Orders in the Region. - type: number - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of region' - type: boolean - payment_providers: - description: >- - A list of Payment Provider IDs that should be enabled for the - Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled for - the Region - type: array - items: - type: string - countries: - description: >- - A list of countries' 2 ISO Characters that should be included in - the Region. - type: array - items: - type: string + $ref: ../components/schemas/AdminPostRegionsRegionReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -199,7 +143,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_countries.yaml b/docs/api/admin/paths/regions_{id}_countries.yaml index a319e40210..67bb512250 100644 --- a/docs/api/admin/paths/regions_{id}_countries.yaml +++ b/docs/api/admin/paths/regions_{id}_countries.yaml @@ -14,17 +14,7 @@ post: content: application/json: schema: - type: object - required: - - country_code - properties: - country_code: - description: The 2 character ISO code for the Country. - type: string - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. + $ref: ../components/schemas/AdminPostRegionsRegionCountriesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -48,7 +38,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml index 95ea1544cb..c68d9ce238 100644 --- a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml +++ b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml @@ -44,7 +44,7 @@ delete: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml index 805220e108..1683a5f2e2 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml @@ -14,13 +14,8 @@ post: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Fulfillment Provider to add. - type: string + $ref: >- + ../components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +40,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml index 45bc96c7bf..cd9097439e 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml @@ -41,7 +41,7 @@ delete: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_payment-providers.yaml b/docs/api/admin/paths/regions_{id}_payment-providers.yaml index 04fbd3e380..83abf118c3 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers.yaml @@ -14,13 +14,7 @@ post: content: application/json: schema: - type: object - required: - - provider_id - properties: - provider_id: - description: The ID of the Payment Provider to add. - type: string + $ref: ../components/schemas/AdminPostRegionsRegionPaymentProvidersReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +39,7 @@ post: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml index c9f71b3f23..3d2c890ef7 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml @@ -41,7 +41,7 @@ delete: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/return-reasons.yaml b/docs/api/admin/paths/return-reasons.yaml index 3174ac1317..9f837be913 100644 --- a/docs/api/admin/paths/return-reasons.yaml +++ b/docs/api/admin/paths/return-reasons.yaml @@ -7,28 +7,7 @@ post: content: application/json: schema: - type: object - required: - - label - - value - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must be - unique. - type: string - parent_return_reason_id: - description: The ID of the parent return reason. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostReturnReasonsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -52,7 +31,7 @@ post: type: object properties: return_reason: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -95,7 +74,7 @@ get: return_reasons: type: array items: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/return-reasons_{id}.yaml b/docs/api/admin/paths/return-reasons_{id}.yaml index 14657da2d4..7d33d59612 100644 --- a/docs/api/admin/paths/return-reasons_{id}.yaml +++ b/docs/api/admin/paths/return-reasons_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: return_reason: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,22 +119,7 @@ post: content: application/json: schema: - type: object - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must be - unique. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostReturnReasonsReasonReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -158,7 +143,7 @@ post: type: object properties: return_reason: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/returns.yaml b/docs/api/admin/paths/returns.yaml index f290bd7af5..556bf4fb98 100644 --- a/docs/api/admin/paths/returns.yaml +++ b/docs/api/admin/paths/returns.yaml @@ -40,7 +40,7 @@ get: returns: type: array items: - $ref: ../components/schemas/return.yaml + $ref: ../components/schemas/Return.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/returns_{id}_cancel.yaml b/docs/api/admin/paths/returns_{id}_cancel.yaml index 5960e68332..6eb4ddc4d9 100644 --- a/docs/api/admin/paths/returns_{id}_cancel.yaml +++ b/docs/api/admin/paths/returns_{id}_cancel.yaml @@ -32,7 +32,7 @@ post: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/returns_{id}_receive.yaml b/docs/api/admin/paths/returns_{id}_receive.yaml index 10e260fbed..a9b568196a 100644 --- a/docs/api/admin/paths/returns_{id}_receive.yaml +++ b/docs/api/admin/paths/returns_{id}_receive.yaml @@ -15,27 +15,7 @@ post: content: application/json: schema: - type: object - required: - - items - properties: - items: - description: The Line Items that have been received. - type: array - items: - required: - - item_id - - quantity - properties: - item_id: - description: The ID of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: number + $ref: ../components/schemas/AdminPostReturnsReturnReceiveReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -59,7 +39,7 @@ post: type: object properties: return: - $ref: ../components/schemas/return.yaml + $ref: ../components/schemas/Return.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/sales-channels.yaml b/docs/api/admin/paths/sales-channels.yaml index a3f067eb41..ab7bab6a69 100644 --- a/docs/api/admin/paths/sales-channels.yaml +++ b/docs/api/admin/paths/sales-channels.yaml @@ -7,19 +7,7 @@ post: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminPostSalesChannelsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -43,7 +31,7 @@ post: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -204,7 +192,7 @@ get: sales_channels: type: array items: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/sales-channels_{id}.yaml b/docs/api/admin/paths/sales-channels_{id}.yaml index f4f09ece87..df2e649fdc 100644 --- a/docs/api/admin/paths/sales-channels_{id}.yaml +++ b/docs/api/admin/paths/sales-channels_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,17 +119,7 @@ post: content: application/json: schema: - type: object - properties: - name: - type: string - description: Name of the sales channel. - description: - type: string - description: Sales Channel description. - is_disabled: - type: boolean - description: Indication of if the sales channel is active. + $ref: ../components/schemas/AdminPostSalesChannelsSalesChannelReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -153,7 +143,7 @@ post: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml index c703ac2dc5..e85bfabb81 100644 --- a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml +++ b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml @@ -14,21 +14,8 @@ post: content: application/json: schema: - 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 + $ref: >- + ../components/schemas/AdminPostSalesChannelsChannelProductsBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -53,7 +40,7 @@ post: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -82,21 +69,8 @@ delete: content: application/json: schema: - 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 + $ref: >- + ../components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -122,7 +96,7 @@ delete: type: object properties: sales_channel: - $ref: ../components/schemas/sales_channel.yaml + $ref: ../components/schemas/SalesChannel.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/shipping-options.yaml b/docs/api/admin/paths/shipping-options.yaml index e8b543375a..0e3d88bb08 100644 --- a/docs/api/admin/paths/shipping-options.yaml +++ b/docs/api/admin/paths/shipping-options.yaml @@ -7,77 +7,7 @@ post: content: application/json: schema: - type: object - required: - - name - - region_id - - provider_id - - data - - price_type - properties: - name: - description: The name of the Shipping Option - type: string - region_id: - description: >- - The ID of the Region in which the Shipping Option will be - available. - type: string - provider_id: - description: >- - The ID of the Fulfillment Provider that handles the Shipping - Option. - type: string - profile_id: - description: The ID of the Shipping Profile to add the Shipping Option to. - type: number - data: - description: >- - The data needed for the Fulfillment Provider to handle shipping - with this Shipping Option. - type: object - price_type: - description: The type of the Shipping Option price. - type: string - enum: - - flat_rate - - calculated - amount: - description: The amount to charge for the Shipping Option. - type: integer - requirements: - description: >- - The requirements that must be satisfied for the Shipping Option - to be available. - type: array - items: - required: - - type - - amount - properties: - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - is_return: - description: Whether the Shipping Option defines a return shipment. - type: boolean - default: false - admin_only: - description: If true, the option can be used for draft orders - type: boolean - default: false - metadata: - description: An optional set of key-value pairs with additional information. - type: object - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: ../components/schemas/AdminPostShippingOptionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -101,7 +31,7 @@ post: type: object properties: shipping_option: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -160,7 +90,7 @@ get: shipping_options: type: array items: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/shipping-options_{id}.yaml b/docs/api/admin/paths/shipping-options_{id}.yaml index 71b9682338..32f77bde79 100644 --- a/docs/api/admin/paths/shipping-options_{id}.yaml +++ b/docs/api/admin/paths/shipping-options_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: shipping_option: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,47 +119,7 @@ post: content: application/json: schema: - type: object - required: - - requirements - properties: - name: - description: The name of the Shipping Option - type: string - amount: - description: The amount to charge for the Shipping Option. - type: integer - admin_only: - description: If true, the option can be used for draft orders - type: boolean - metadata: - description: An optional set of key-value pairs with additional information. - type: object - requirements: - description: >- - The requirements that must be satisfied for the Shipping Option - to be available. - type: array - items: - required: - - type - - amount - properties: - id: - description: The ID of the requirement - type: string - type: - description: The type of the requirement - type: string - enum: - - max_subtotal - - min_subtotal - amount: - description: The amount to compare with. - type: integer - includes_tax: - description: '[EXPERIMENTAL] Tax included in prices of shipping option' - type: boolean + $ref: ../components/schemas/AdminPostShippingOptionsOptionReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -183,7 +143,7 @@ post: type: object properties: shipping_option: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/shipping-profiles.yaml b/docs/api/admin/paths/shipping-profiles.yaml index 4352be2379..a6d0019d37 100644 --- a/docs/api/admin/paths/shipping-profiles.yaml +++ b/docs/api/admin/paths/shipping-profiles.yaml @@ -7,13 +7,7 @@ post: content: application/json: schema: - type: object - required: - - name - properties: - name: - description: The name of the Shipping Profile - type: string + $ref: ../components/schemas/AdminPostShippingProfilesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -37,7 +31,7 @@ post: type: object properties: shipping_profile: - $ref: ../components/schemas/shipping_profile.yaml + $ref: ../components/schemas/ShippingProfile.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -80,7 +74,7 @@ get: shipping_profiles: type: array items: - $ref: ../components/schemas/shipping_profile.yaml + $ref: ../components/schemas/ShippingProfile.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/shipping-profiles_{id}.yaml b/docs/api/admin/paths/shipping-profiles_{id}.yaml index 319dae965b..7e8ced6ba8 100644 --- a/docs/api/admin/paths/shipping-profiles_{id}.yaml +++ b/docs/api/admin/paths/shipping-profiles_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: shipping_profile: - $ref: ../components/schemas/shipping_profile.yaml + $ref: ../components/schemas/ShippingProfile.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -118,11 +118,7 @@ post: content: application/json: schema: - type: object - properties: - name: - description: The name of the Shipping Profile - type: string + $ref: ../components/schemas/AdminPostShippingProfilesProfileReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -146,7 +142,7 @@ post: type: object properties: shipping_profile: - $ref: ../components/schemas/shipping_profile.yaml + $ref: ../components/schemas/ShippingProfile.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/store.yaml b/docs/api/admin/paths/store.yaml index 73000bd2ef..43e9b03410 100644 --- a/docs/api/admin/paths/store.yaml +++ b/docs/api/admin/paths/store.yaml @@ -26,7 +26,7 @@ get: type: object properties: store: - $ref: ../components/schemas/store.yaml + $ref: ../components/schemas/Store.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -48,40 +48,7 @@ post: content: application/json: schema: - type: object - properties: - name: - description: The name of the Store - type: string - swap_link_template: - description: >- - A template for Swap links - use `{{cart_id}}` to insert the Swap - Cart id - type: string - payment_link_template: - description: >- - A template for payment links links - use `{{cart_id}}` to insert - the Cart id - type: string - invite_link_template: - description: >- - A template for invite links - use `{{invite_token}}` to insert - the invite token - type: string - default_currency_code: - description: The default currency code for the Store. - type: string - externalDocs: - url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes - description: See a list of codes. - currencies: - description: Array of currencies in 2 character ISO code format. - type: array - items: - type: string - metadata: - description: An optional set of key-value pairs with additional information. - type: object + $ref: ../components/schemas/AdminPostStoreReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -105,7 +72,7 @@ post: type: object properties: store: - $ref: ../components/schemas/store.yaml + $ref: ../components/schemas/Store.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/store_currencies_{code}.yaml b/docs/api/admin/paths/store_currencies_{code}.yaml index 5d7f1b006c..651a4d03cb 100644 --- a/docs/api/admin/paths/store_currencies_{code}.yaml +++ b/docs/api/admin/paths/store_currencies_{code}.yaml @@ -36,7 +36,7 @@ post: type: object properties: store: - $ref: ../components/schemas/store.yaml + $ref: ../components/schemas/Store.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -87,7 +87,7 @@ delete: type: object properties: store: - $ref: ../components/schemas/store.yaml + $ref: ../components/schemas/Store.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/store_payment-providers.yaml b/docs/api/admin/paths/store_payment-providers.yaml index f44208295c..87f3db3c05 100644 --- a/docs/api/admin/paths/store_payment-providers.yaml +++ b/docs/api/admin/paths/store_payment-providers.yaml @@ -28,7 +28,7 @@ get: payment_providers: type: array items: - $ref: ../components/schemas/payment_provider.yaml + $ref: ../components/schemas/PaymentProvider.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/store_tax-providers.yaml b/docs/api/admin/paths/store_tax-providers.yaml index 1dc2ca9346..15968f5187 100644 --- a/docs/api/admin/paths/store_tax-providers.yaml +++ b/docs/api/admin/paths/store_tax-providers.yaml @@ -28,7 +28,7 @@ get: tax_providers: type: array items: - $ref: ../components/schemas/tax_provider.yaml + $ref: ../components/schemas/TaxProvider.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/swaps.yaml b/docs/api/admin/paths/swaps.yaml index eef8025b2e..e3ccdbe78b 100644 --- a/docs/api/admin/paths/swaps.yaml +++ b/docs/api/admin/paths/swaps.yaml @@ -41,7 +41,7 @@ get: swaps: type: array items: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/swaps_{id}.yaml b/docs/api/admin/paths/swaps_{id}.yaml index ce9c635afb..4463605886 100644 --- a/docs/api/admin/paths/swaps_{id}.yaml +++ b/docs/api/admin/paths/swaps_{id}.yaml @@ -33,7 +33,7 @@ get: type: object properties: swap: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/tax-rates.yaml b/docs/api/admin/paths/tax-rates.yaml index 089b0007df..44a6f2270a 100644 --- a/docs/api/admin/paths/tax-rates.yaml +++ b/docs/api/admin/paths/tax-rates.yaml @@ -26,39 +26,7 @@ post: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminPostTaxRatesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -82,7 +50,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -199,7 +167,7 @@ get: tax_rates: type: array items: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml count: type: integer description: The total number of items available diff --git a/docs/api/admin/paths/tax-rates_{id}.yaml b/docs/api/admin/paths/tax-rates_{id}.yaml index ad00d6371a..64796ba8d6 100644 --- a/docs/api/admin/paths/tax-rates_{id}.yaml +++ b/docs/api/admin/paths/tax-rates_{id}.yaml @@ -108,7 +108,7 @@ get: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -155,35 +155,7 @@ post: content: application/json: schema: - type: object - properties: - code: - type: string - description: A code to identify the tax type by - name: - type: string - description: A human friendly name for the tax - region_id: - type: string - description: The ID of the Region that the rate belongs to - rate: - type: number - description: The numeric rate to charge - products: - type: array - description: The IDs of the products associated with this tax rate - items: - type: string - shipping_options: - type: array - description: The IDs of the shipping options associated with this tax rate - items: - type: string - product_types: - type: array - description: The IDs of the types of products associated with this tax rate - items: - type: string + $ref: ../components/schemas/AdminPostTaxRatesTaxRateReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -207,7 +179,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml index 29b787caf5..45c9308856 100644 --- a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml @@ -32,15 +32,7 @@ post: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminPostTaxRatesTaxRateProductTypesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -65,7 +57,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -112,17 +104,7 @@ delete: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -148,7 +130,7 @@ delete: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml index db4f16f995..7db58c1b34 100644 --- a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml @@ -32,15 +32,7 @@ post: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: The IDs of the products to associate with this tax rate - items: - type: string + $ref: ../components/schemas/AdminPostTaxRatesTaxRateProductsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -64,7 +56,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -111,15 +103,7 @@ delete: content: application/json: schema: - type: object - required: - - products - properties: - products: - type: array - description: The IDs of the products to remove association with this tax rate - items: - type: string + $ref: ../components/schemas/AdminDeleteTaxRatesTaxRateProductsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -144,7 +128,7 @@ delete: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml index 5cbe03173b..a180a9b0d2 100644 --- a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml @@ -32,15 +32,8 @@ post: content: application/json: schema: - 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 + $ref: >- + ../components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -66,7 +59,7 @@ post: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -113,17 +106,8 @@ delete: content: application/json: schema: - 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 + $ref: >- + ../components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -149,7 +133,7 @@ delete: type: object properties: tax_rate: - $ref: ../components/schemas/tax_rate.yaml + $ref: ../components/schemas/TaxRate.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/uploads_protected.yaml b/docs/api/admin/paths/uploads_protected.yaml index 15a1bc164c..45bf68a6b9 100644 --- a/docs/api/admin/paths/uploads_protected.yaml +++ b/docs/api/admin/paths/uploads_protected.yaml @@ -1,9 +1,9 @@ post: operationId: PostUploadsProtected - summary: Upload files with acl or in a non-public bucket + summary: Protected File Upload description: >- - Uploads at least one file to the specific fileservice that is installed in - Medusa. + 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: diff --git a/docs/api/admin/paths/users.yaml b/docs/api/admin/paths/users.yaml index 71a4ce1f42..33f32882bb 100644 --- a/docs/api/admin/paths/users.yaml +++ b/docs/api/admin/paths/users.yaml @@ -7,32 +7,7 @@ post: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminCreateUserRequest.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -56,7 +31,7 @@ post: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -99,7 +74,7 @@ get: users: type: array items: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/users_password-token.yaml b/docs/api/admin/paths/users_password-token.yaml index d1f0912af2..5a3cbff64a 100644 --- a/docs/api/admin/paths/users_password-token.yaml +++ b/docs/api/admin/paths/users_password-token.yaml @@ -7,14 +7,7 @@ post: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The Users email. - type: string - format: email + $ref: ../components/schemas/AdminResetPasswordTokenRequest.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/users_reset-password.yaml b/docs/api/admin/paths/users_reset-password.yaml index ac2a00085c..bda603c314 100644 --- a/docs/api/admin/paths/users_reset-password.yaml +++ b/docs/api/admin/paths/users_reset-password.yaml @@ -7,22 +7,7 @@ post: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminResetPasswordRequest.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -46,7 +31,7 @@ post: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/users_{id}.yaml b/docs/api/admin/paths/users_{id}.yaml index c702e5d767..7b023f8546 100644 --- a/docs/api/admin/paths/users_{id}.yaml +++ b/docs/api/admin/paths/users_{id}.yaml @@ -90,7 +90,7 @@ get: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -119,27 +119,7 @@ post: content: application/json: schema: - 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 + $ref: ../components/schemas/AdminUpdateUserRequest.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -163,7 +143,7 @@ post: type: object properties: user: - $ref: ../components/schemas/user.yaml + $ref: ../components/schemas/User.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/variants.yaml b/docs/api/admin/paths/variants.yaml index 82985adaf9..c168a933e7 100644 --- a/docs/api/admin/paths/variants.yaml +++ b/docs/api/admin/paths/variants.yaml @@ -118,7 +118,7 @@ get: variants: type: array items: - $ref: ../components/schemas/product_variant.yaml + $ref: ../components/schemas/ProductVariant.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index be32e3a13b..ca4f530a96 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -108,40 +108,28 @@ tags: sessions. - name: Cart description: Cart endpoints that allow handling carts in Medusa. - x-resourceId: cart - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap servers: - url: 'https://api.medusa-commerce.com/store' paths: @@ -190,7 +178,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -289,7 +277,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -355,6 +343,923 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/carts/{id}/shipping-methods': + post: + operationId: PostCartsCartShippingMethod + description: Adds a Shipping Method to the Cart. + summary: Add a Shipping Method + parameters: + - in: path + name: id + required: true + description: The cart ID. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.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: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - option_id + properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: >- + Used to hold any data that the shipping method may need to + process the fulfillment of the order. Look at the + documentation for your installed fulfillment providers to + find out what to send. + '/carts/{id}/taxes': + post: + summary: Calculate Cart Taxes + operationId: PostCartsCartTaxes + description: >- + Calculates taxes for a cart. Depending on the cart's region this may + involve making 3rd party API calls to a Tax Provider service. + parameters: + - in: path + name: id + required: true + description: The Cart ID. + schema: + type: string + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/taxes' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/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-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: + - Cart + 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: + type: object + properties: + type: + type: string + description: The type of the data property. + enum: + - order + - cart + - swap + data: + type: object + description: >- + The data of the result object. Its type depends on the + type field. + oneOf: + - type: object + description: >- + Cart was successfully authorized and order was placed + successfully. + properties: + order: + $ref: '#/components/schemas/Order' + - type: object + description: >- + Cart was successfully authorized but requires further + actions. + properties: + cart: + $ref: '#/components/schemas/Cart' + - type: object + description: >- + When cart is used for a swap and it has been completed + successfully. + properties: + cart: + $ref: '#/components/schemas/Swap' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts: + post: + summary: Create a Cart + operationId: PostCart + description: >- + Creates a Cart within the given region and with the initial items. If no + `region_id` is provided the cart will be associated with the first + Region available. If no items are provided the cart will be empty after + creation. If a user is logged in the cart's customer id and email will + be set. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.create() + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts' + tags: + - Cart + responses: + '200': + description: Successfully created a new Cart + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions': + post: + operationId: PostCartsCartPaymentSessions + summary: Create Payment Sessions + description: >- + Creates Payment Sessions for each of the available Payment Providers in + the Cart's Region. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.createPaymentSessions(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-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: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/line-items/{line_id}': + delete: + operationId: DeleteCartsCartLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + 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: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartLineItemsItem + summary: Update a Line Item + description: Updates a Line Item if the desired quantity can be fulfilled. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + 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: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - quantity + properties: + quantity: + type: integer + description: The quantity to set the Line Item to. + '/carts/{id}/payment-sessions/{provider_id}': + delete: + operationId: DeleteCartsCartPaymentSessionsSession + summary: Delete a Payment Session + description: >- + Deletes a Payment Session on a Cart. May be useful if a payment has + failed. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: >- + The id of the Payment Provider used to create the Payment Session to + be deleted. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + 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: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the payment provider. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.updatePaymentSession(cart_id, 'manual', { + data: { + } + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "data": {} + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. + '/carts/{id}': + get: + operationId: GetCartsCart + summary: Get a Cart + description: Retrieves a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.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: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + 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-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: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions/{provider_id}/refresh': + post: + operationId: PostCartsCartPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the Cart - + this is usually not necessary. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: >- + The id of the Payment Provider that created the Payment Session to + be refreshed. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.refreshPaymentSession(cart_id, 'manual') + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-session': + post: + operationId: PostCartsCartPaymentSession + summary: Select a Payment Session + description: >- + Selects a Payment Session as the session intended to be used towards the + completion of the Cart. + parameters: + - in: path + name: id + required: true + description: The ID of the Cart. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.setPaymentSession(cart_id, { + provider_id: 'manual' + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "provider_id": "manual" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. '/collections/{id}': get: operationId: GetCollectionsCollection @@ -397,7 +1302,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '404': @@ -504,7 +1409,7 @@ paths: collections: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' count: type: integer description: The total number of items available @@ -524,6 +1429,59 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/gift-cards/{code}': + get: + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. + parameters: + - in: path + name: code + required: true + description: The unique Gift Card code. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.giftCards.retrieve(code) + + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/gift-cards/{code}' + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + gift_card: + $ref: '#/components/schemas/GiftCard' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /customers/me/addresses: post: operationId: PostCustomersCustomerAddresses @@ -534,22 +1492,7 @@ paths: content: application/json: schema: - type: object - required: - - address - properties: - address: - description: The Address to add to the Customer. - allOf: - - $ref: '#/components/schemas/address_fields' - - type: object - required: - - first_name - - last_name - - address_1 - - city - - country_code - - postal_code + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -613,7 +1556,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -635,30 +1578,7 @@ paths: content: application/json: schema: - type: object - required: - - first_name - - last_name - - email - - password - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - phone: - description: The Customer's phone number. - type: string + $ref: '#/components/schemas/StorePostCustomersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -703,7 +1623,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '404': @@ -783,7 +1703,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -812,8 +1732,8 @@ paths: content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/address_fields' + $ref: >- + #/components/schemas/StorePostCustomersCustomerAddressesAddressReq x-codeSamples: - lang: JavaScript label: JS Client @@ -858,7 +1778,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -915,7 +1835,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -937,33 +1857,7 @@ paths: content: application/json: schema: - type: object - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - description: The full billing address object - - type: string - description: The ID of an existing billing address - password: - description: The Customer's password. - type: string - phone: - description: The Customer's phone number. - type: string - email: - description: The email of the customer. - type: string - metadata: - description: Metadata about the customer. - type: object + $ref: '#/components/schemas/StorePostCustomersCustomerReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1008,7 +1902,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1300,7 +2194,7 @@ paths: orders: type: array items: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' count: type: integer description: The total number of items available @@ -1334,14 +2228,7 @@ paths: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The email of the customer. - type: string - format: email + $ref: '#/components/schemas/StorePostCustomersCustomerPasswordTokenReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1401,23 +2288,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - password - - token - properties: - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - token: - description: The reset password token - type: string + $ref: '#/components/schemas/StorePostCustomersResetPasswordReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1460,7 +2331,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1473,1080 +2344,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/shipping-methods': - post: - operationId: PostCartsCartShippingMethod - description: Adds a Shipping Method to the Cart. - summary: Add a Shipping Method - parameters: - - in: path - name: id - required: true - description: The cart ID. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.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: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - option_id - properties: - option_id: - type: string - description: ID of the shipping option to create the method from - data: - type: object - description: >- - Used to hold any data that the shipping method may need to - process the fulfillment of the order. Look at the - documentation for your installed fulfillment providers to - find out what to send. - '/carts/{id}/taxes': - post: - summary: Calculate Cart Taxes - operationId: PostCartsCartTaxes - description: >- - Calculates taxes for a cart. Depending on the cart's region this may - involve making 3rd party API calls to a Tax Provider service. - parameters: - - in: path - name: id - required: true - description: The Cart ID. - schema: - type: string - x-codeSamples: - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/taxes' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/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-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: - - Cart - 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: - type: object - properties: - type: - type: string - description: The type of the data property. - enum: - - order - - cart - - swap - data: - type: object - description: >- - The data of the result object. Its type depends on the - type field. - oneOf: - - type: object - description: >- - Cart was successfully authorized and order was placed - successfully. - properties: - order: - $ref: '#/components/schemas/order' - - type: object - description: >- - Cart was successfully authorized but requires further - actions. - properties: - cart: - $ref: '#/components/schemas/cart' - - type: object - description: >- - When cart is used for a swap and it has been completed - successfully. - properties: - cart: - $ref: '#/components/schemas/swap' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /carts: - post: - summary: Create a Cart - operationId: PostCart - description: >- - Creates a Cart within the given region and with the initial items. If no - `region_id` is provided the cart will be associated with the first - Region available. If no items are provided the cart will be empty after - creation. If a user is logged in the cart's customer id and email will - be set. - requestBody: - content: - application/json: - schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Cart in. - sales_channel_id: - type: string - description: >- - [EXPERIMENTAL] The ID of the Sales channel to create the - Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - items: - description: >- - An optional array of `variant_id`, `quantity` pairs to - generate Line Items from. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: >- - The id of the Product Variant to generate a Line Item - from. - type: string - quantity: - description: The quantity of the Product Variant to add - type: integer - context: - description: >- - An optional object to provide context to the Cart. The - `context` field is automatically populated with `ip` and - `user_agent` - type: object - example: - ip: '::1' - user_agent: Chrome - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.create() - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: | - curl --location --request POST 'https://medusa-url.com/store/carts' - tags: - - Cart - responses: - '200': - description: Successfully created a new Cart - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/payment-sessions': - post: - operationId: PostCartsCartPaymentSessions - summary: Create Payment Sessions - description: >- - Creates Payment Sessions for each of the available Payment Providers in - the Cart's Region. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.createPaymentSessions(cart_id) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/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-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: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/line-items/{line_id}': - delete: - operationId: DeleteCartsCartLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Line Item. - schema: - type: string - 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: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCartLineItemsItem - summary: Update a Line Item - description: Updates a Line Item if the desired quantity can be fulfilled. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Line Item. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - 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: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - type: integer - description: The quantity to set the Line Item to. - '/carts/{id}/payment-sessions/{provider_id}': - delete: - operationId: DeleteCartsCartPaymentSessionsSession - summary: Delete a Payment Session - description: >- - Deletes a Payment Session on a Cart. May be useful if a payment has - failed. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: provider_id - required: true - description: >- - The id of the Payment Provider used to create the Payment Session to - be deleted. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - 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: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - post: - operationId: PostCartsCartPaymentSessionUpdate - summary: Update a Payment Session - description: Updates a Payment Session with additional data. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: provider_id - required: true - description: The id of the payment provider. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.updatePaymentSession(cart_id, 'manual', { - data: { - } - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "data": {} - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: object - description: The data to update the payment session with. - '/carts/{id}': - get: - operationId: GetCartsCart - summary: Get a Cart - description: Retrieves a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.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: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - 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: - type: object - properties: - region_id: - type: string - description: The id of the Region to create the Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Cart. - format: email - sales_channel_id: - type: string - description: The ID of the Sales channel to update the Cart with. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - description: A full billing address object. - - type: string - description: The billing address ID - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address' - description: A full shipping address object. - - type: string - description: The shipping address ID - gift_cards: - description: An array of Gift Card codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Gift Card is identified by. - type: string - discounts: - description: An array of Discount codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - customer_id: - description: The ID of the Customer to associate the Cart with. - type: string - context: - description: An optional object to provide context to the Cart. - type: object - example: - ip: '::1' - user_agent: Chrome - 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: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/payment-sessions/{provider_id}/refresh': - post: - operationId: PostCartsCartPaymentSessionsSession - summary: Refresh a Payment Session - description: >- - Refreshes a Payment Session to ensure that it is in sync with the Cart - - this is usually not necessary. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: provider_id - required: true - description: >- - The id of the Payment Provider that created the Payment Session to - be refreshed. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.refreshPaymentSession(cart_id, 'manual') - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/carts/{id}/payment-session': - post: - operationId: PostCartsCartPaymentSession - summary: Select a Payment Session - description: >- - Selects a Payment Session as the session intended to be used towards the - completion of the Cart. - parameters: - - in: path - name: id - required: true - description: The ID of the Cart. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.carts.setPaymentSession(cart_id, { - provider_id: 'manual' - }) - - .then(({ cart }) => { - console.log(cart.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "provider_id": "manual" - }' - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. - parameters: - - in: path - name: code - required: true - description: The unique Gift Card code. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.giftCards.retrieve(code) - - .then(({ gift_card }) => { - console.log(gift_card.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/gift-cards/{code}' - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - gift_card: - $ref: '#/components/schemas/gift_card' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' '/order-edits/{id}/complete': post: operationId: PostOrderEditsOrderEditComplete @@ -2588,7 +2385,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -2613,11 +2410,7 @@ paths: content: application/json: schema: - type: object - properties: - declined_reason: - type: string - description: The reason for declining the OrderEdit. + $ref: '#/components/schemas/StorePostOrderEditsOrderEditDecline' x-codeSamples: - lang: JavaScript label: JS Client @@ -2647,7 +2440,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -2698,7 +2491,7 @@ paths: type: object properties: order_edit: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' '401': @@ -2714,7 +2507,7 @@ paths: /orders/customer/confirm: post: operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept - summary: Verify a claim to orders + summary: Verify an Order Claim description: >- Verifies the claim order token provided to the customer upon request of order ownership @@ -2722,12 +2515,7 @@ paths: content: application/json: schema: - required: - - token - properties: - token: - description: The invite token provided by the admin. - type: string + $ref: '#/components/schemas/StorePostCustomersCustomerAcceptClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2765,7 +2553,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Invite + - Order responses: '200': description: OK @@ -2825,7 +2613,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -2878,7 +2666,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -2954,7 +2742,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -2968,7 +2756,7 @@ paths: /orders/batch/customer/token: post: operationId: PostOrdersCustomerOrderClaim - summary: Claim orders for signed in account + summary: Claim an Order description: >- Sends an email to emails registered to orders provided with link to transfer order ownership @@ -2976,14 +2764,7 @@ paths: content: application/json: schema: - required: - - order_ids - properties: - order_ids: - description: The ids of the orders to claim - type: array - items: - type: string + $ref: '#/components/schemas/StorePostCustomersCustomerOrderClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3040,7 +2821,7 @@ paths: '/payment-collections/{id}/sessions/batch/authorize': post: operationId: PostPaymentCollectionsSessionsBatchAuthorize - summary: Authorize Payment Sessions of a Payment Collection + summary: Authorize PaymentSessions description: Authorizes Payment Sessions of a Payment Collection. x-authenticated: false parameters: @@ -3054,12 +2835,8 @@ paths: content: application/json: schema: - properties: - session_ids: - description: List of Payment Session IDs to authorize. - type: array - items: - type: string + $ref: >- + #/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq x-codeSamples: - lang: JavaScript label: JS Client @@ -3085,7 +2862,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Payment + - PaymentCollection responses: '200': description: OK @@ -3094,7 +2871,7 @@ paths: schema: properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3110,7 +2887,7 @@ paths: '/payment-collections/{id}/sessions/{session_id}/authorize': post: operationId: PostPaymentCollectionsSessionsSessionAuthorize - summary: Authorize a Payment Session of a Payment Collection + summary: Authorize Payment Session description: Authorizes a Payment Session of a Payment Collection. x-authenticated: false parameters: @@ -3151,7 +2928,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Payment + - PaymentCollection responses: '200': description: OK @@ -3160,7 +2937,7 @@ paths: schema: properties: payment_session: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' '400': $ref: '#/components/responses/400_error' '401': @@ -3176,8 +2953,8 @@ paths: '/payment-collections/{id}': get: operationId: GetPaymentCollectionsPaymentCollection - summary: Retrieve an PaymentCollection - description: Retrieves a PaymentCollection. + summary: Get a PaymentCollection + description: Get a Payment Collection x-authenticated: false parameters: - in: path @@ -3230,7 +3007,7 @@ paths: type: object properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3246,7 +3023,7 @@ paths: '/payment-collections/{id}/sessions/batch': post: operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch - summary: Manage Multiple Payment Sessions from Payment Collections + summary: Manage Payment Sessions description: Manages Multiple Payment Sessions from Payment Collections. x-authenticated: false parameters: @@ -3260,28 +3037,7 @@ paths: content: application/json: schema: - properties: - sessions: - description: >- - An array of payment sessions related to the Payment - Collection. If the session_id is not provided, existing - sessions not present will be deleted and the provided ones - will be created. - type: array - items: - required: - - provider_id - - amount - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - amount: - type: integer - description: The amount . - session_id: - type: string - description: The ID of the Payment Session to be updated. + $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3334,7 +3090,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Payment + - PaymentCollection responses: '200': description: OK @@ -3343,7 +3099,7 @@ paths: schema: properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3359,7 +3115,7 @@ paths: '/payment-collections/{id}/sessions': post: operationId: PostPaymentCollectionsSessions - summary: Manage Payment Sessions from Payment Collections + summary: Manage a Payment Session description: Manages Payment Sessions from Payment Collections. x-authenticated: false parameters: @@ -3373,12 +3129,7 @@ paths: content: application/json: schema: - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. + $ref: '#/components/schemas/StorePaymentCollectionSessionsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3409,7 +3160,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Payment + - PaymentCollection responses: '200': description: OK @@ -3418,7 +3169,7 @@ paths: schema: properties: payment_collection: - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3452,21 +3203,6 @@ paths: description: The id of the Payment Session to be refreshed. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - - customer_id - properties: - provider_id: - description: The Payment Provider id. - type: string - customer_id: - description: The Customer id. - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -3477,7 +3213,7 @@ paths: 3 }) medusa.paymentCollections.refreshPaymentSession(payment_collection_id, - session_id, payload) + session_id) .then(({ payment_session }) => { console.log(payment_session.id); @@ -3498,7 +3234,7 @@ paths: type: object properties: payment_session: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' '400': $ref: '#/components/responses/400_error' '404': @@ -3642,7 +3378,7 @@ paths: type: object properties: product_types: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' count: type: integer description: The total number of items available @@ -3731,16 +3467,16 @@ paths: properties: product: allOf: - - $ref: '#/components/schemas/product' + - $ref: '#/components/schemas/Product' - type: object properties: variants: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' + - $ref: '#/components/schemas/ProductVariant' - $ref: >- - #/components/schemas/product_variant_prices_fields + #/components/schemas/ProductVariantPricesFields '400': $ref: '#/components/responses/400_error' '404': @@ -3901,6 +3637,11 @@ paths: the result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -3934,16 +3675,16 @@ paths: type: array items: allOf: - - $ref: '#/components/schemas/product' + - $ref: '#/components/schemas/Product' - type: object properties: variants: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' + - $ref: '#/components/schemas/ProductVariant' - $ref: >- - #/components/schemas/product_variant_prices_fields + #/components/schemas/ProductVariantPricesFields count: type: integer description: The total number of items available @@ -4075,7 +3816,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '404': @@ -4179,119 +3920,7 @@ paths: regions: type: array items: - $ref: '#/components/schemas/region' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - /returns: - post: - operationId: PostReturns - summary: Create Return - description: Creates a Return for an Order. - requestBody: - content: - application/json: - schema: - 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: - 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. - 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: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - return: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '404': @@ -4344,7 +3973,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '404': @@ -4392,7 +4021,78 @@ paths: return_reasons: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /returns: + post: + operationId: PostReturns + summary: Create Return + description: Creates a Return for an Order. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostReturnsReq' + 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: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + return: + $ref: '#/components/schemas/Return' '400': $ref: '#/components/responses/400_error' '404': @@ -4458,7 +4158,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '404': @@ -4513,7 +4213,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '404': @@ -4535,54 +4235,7 @@ paths: content: application/json: schema: - 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: - 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: - 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 + $ref: '#/components/schemas/StorePostSwapsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4645,7 +4298,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '404': @@ -4698,7 +4351,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '404': @@ -4759,8 +4412,8 @@ paths: properties: variant: allOf: - - $ref: '#/components/schemas/product_variant' - - $ref: '#/components/schemas/product_variant_prices_fields' + - $ref: '#/components/schemas/ProductVariant' + - $ref: '#/components/schemas/ProductVariantPricesFields' '400': $ref: '#/components/responses/400_error' '404': @@ -4858,8 +4511,8 @@ paths: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' - - $ref: '#/components/schemas/product_variant_prices_fields' + - $ref: '#/components/schemas/ProductVariant' + - $ref: '#/components/schemas/ProductVariantPricesFields' '400': $ref: '#/components/responses/400_error' '404': @@ -4924,7 +4577,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -4964,7 +4617,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: An unknown error occurred. @@ -4974,7 +4627,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: >- @@ -4986,7 +4639,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: invalid_request_error message: Discount with code TEST already exists. @@ -4996,7 +4649,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: message: Entity with id 1 was not found type: not_found @@ -5006,21 +4659,21 @@ components: application/json: schema: oneOf: - - $ref: '#/components/schemas/error' - - $ref: '#/components/schemas/multiple_errors' + - $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' - multiple_errors: + MultipleErrors: $ref: '#/components/examples/multiple_errors' 500_error: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' examples: database: $ref: '#/components/examples/database_error' @@ -5158,10 +4811,9 @@ components: Where `{sid}` is the value of `connect.sid` that you copied. schemas: - address_fields: + AddressFields: title: Address Fields description: Address fields used when creating/updating an address. - x-resourceId: address type: object properties: company: @@ -5213,10 +4865,9 @@ components: description: An optional key-value map with additional details example: car: white - address: + Address: title: Address description: An address. - x-resourceId: address type: object properties: id: @@ -5297,10 +4948,9 @@ components: description: An optional key-value map with additional details example: car: white - batch_job: + BatchJob: title: Batch Job description: A Batch Job. - x-resourceId: batch_job type: object required: - type @@ -5440,10 +5090,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - cart: + Cart: title: Cart description: Represents a user cart - x-resourceId: cart type: object properties: id: @@ -5460,19 +5109,19 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' region_id: type: string description: The region's ID @@ -5501,24 +5150,24 @@ components: type: object payment_session: description: The selected payment session in the cart. - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' type: type: string description: The cart's type. @@ -5618,10 +5267,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - claim_image: + ClaimImage: title: Claim Image description: Represents photo documentation of a claim. - x-resourceId: claim_image type: object required: - claim_item_id @@ -5660,12 +5308,11 @@ components: description: An optional key-value map with additional details example: car: white - claim_item: + ClaimItem: title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. - x-resourceId: claim_item type: object required: - claim_order_id @@ -5682,7 +5329,7 @@ components: type: array description: Available if the relation `images` is expanded. items: - $ref: '#/components/schemas/claim_image' + $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -5697,7 +5344,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. type: string @@ -5729,7 +5376,7 @@ components: relation 'tags' is expanded. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: '#/components/schemas/ClaimTag' created_at: type: string description: The date with timezone at which the resource was created. @@ -5747,13 +5394,12 @@ components: description: An optional key-value map with additional details example: car: white - claim_order: + 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. - x-resourceId: claim_order type: object required: - type @@ -5793,14 +5439,14 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $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/line_item' + $ref: '#/components/schemas/LineItem' order_id: description: The ID of the order that the claim comes from. type: string @@ -5819,17 +5465,17 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer @@ -5870,12 +5516,11 @@ components: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - claim_tag: + ClaimTag: title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. - x-resourceId: claim_tag type: object required: - value @@ -5905,10 +5550,9 @@ components: description: An optional key-value map with additional details example: car: white - country: + Country: title: Country description: Country details - x-resourceId: country type: object required: - iso_2 @@ -5960,10 +5604,9 @@ components: region: description: A region object. Available if the relation `region` is expanded. type: object - currency: + Currency: title: Currency description: Currency - x-resourceId: currency type: object required: - code @@ -5993,13 +5636,12 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean - custom_shipping_option: + 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 - x-resourceId: custom_shipping_option type: object required: - price @@ -6055,10 +5697,9 @@ components: [EXPERIMENTAL] Indicates if the custom shipping option price include tax type: boolean - customer_group: + CustomerGroup: title: Customer Group description: Represents a customer group - x-resourceId: customer_group type: object required: - name @@ -6085,7 +5726,7 @@ components: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' created_at: type: string description: The date with timezone at which the resource was created. @@ -6103,10 +5744,9 @@ components: description: An optional key-value map with additional details example: car: white - customer: + Customer: title: Customer description: Represents a customer - x-resourceId: customer type: object required: - email @@ -6133,12 +5773,12 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' phone: type: string description: The customer's phone number @@ -6159,7 +5799,7 @@ components: relation `groups` is expanded. type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' created_at: type: string description: The date with timezone at which the resource was created. @@ -6177,10 +5817,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_customer_group: + DiscountConditionCustomerGroup: title: Product Tag Discount Condition description: Associates a discount condition with a customer group - x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -6196,10 +5835,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6213,10 +5852,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_collection: + DiscountConditionProductCollection: title: Product Collection Discount Condition description: Associates a discount condition with a product collection - x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -6232,10 +5870,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6249,10 +5887,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_tag: + DiscountConditionProductTag: title: Product Tag Discount Condition description: Associates a discount condition with a product tag - x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -6268,10 +5905,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6285,10 +5922,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_type: + DiscountConditionProductType: title: Product Type Discount Condition description: Associates a discount condition with a product type - x-resourceId: discount_condition_product type: object required: - product_type_id @@ -6304,10 +5940,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6321,10 +5957,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product: + DiscountConditionProduct: title: Product Discount Condition description: Associates a discount condition with a product - x-resourceId: discount_condition_product type: object required: - product_id @@ -6340,10 +5975,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6357,10 +5992,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition: + DiscountCondition: title: Discount Condition description: Holds rule conditions for when a discount is applicable - x-resourceId: discount_condition type: object required: - type @@ -6392,7 +6026,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' products: description: >- products associated with this condition if type = products. @@ -6453,12 +6087,11 @@ components: description: An optional key-value map with additional details example: car: white - discount_rule: + DiscountRule: title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. - x-resourceId: discount_rule type: object required: - type @@ -6521,12 +6154,11 @@ components: description: An optional key-value map with additional details example: car: white - discount: + Discount: title: Discount description: >- Represents a discount that can be applied to a cart for promotional purposes. - x-resourceId: discount type: object required: - code @@ -6554,7 +6186,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -6569,7 +6201,7 @@ components: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. type: string @@ -6616,10 +6248,9 @@ components: description: An optional key-value map with additional details example: car: white - draft-order: + DraftOrder: title: DraftOrder description: Represents a draft order - x-resourceId: draft-order type: object properties: id: @@ -6689,12 +6320,11 @@ components: description: An optional key-value map with additional details example: car: white - fulfillment_item: + FulfillmentItem: title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. - x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -6716,17 +6346,16 @@ components: type: object item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer example: 1 - fulfillment_provider: + FulfillmentProvider: title: Fulfillment Provider description: >- Represents a fulfillment provider plugin and holds its installation status. - x-resourceId: fulfillment_provider type: object properties: id: @@ -6740,7 +6369,7 @@ components: to `false`. type: boolean example: true - fulfillment: + Fulfillment: title: Fulfillment description: >- Fulfillments are created once store operators can prepare the purchased @@ -6750,7 +6379,6 @@ components: 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. - x-resourceId: fulfillment type: object required: - provider_id @@ -6790,7 +6418,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' items: description: >- The Fulfillment Items in the Fulfillment - these hold information @@ -6798,7 +6426,7 @@ components: the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: '#/components/schemas/FulfillmentItem' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -6806,7 +6434,7 @@ components: Provider. Available if the relation `tracking_links` is expanded. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true description: >- @@ -6861,12 +6489,11 @@ components: description: An optional key-value map with additional details example: car: white - gift_card_transaction: + GiftCardTransaction: title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order - x-resourceId: gift_card_transaction type: object required: - gift_card_id @@ -6908,12 +6535,11 @@ components: description: The tax rate of the transaction type: number example: 0 - gift_card: + GiftCard: title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. - x-resourceId: gift_card type: object required: - code @@ -6963,6 +6589,10 @@ components: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. @@ -6980,12 +6610,11 @@ components: description: An optional key-value map with additional details example: car: white - idempotency_key: + IdempotencyKey: title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. - x-resourceId: idempotency_key type: object required: - idempotency_key @@ -7037,10 +6666,9 @@ components: type: string description: Where to continue from. default: started - image: + Image: title: Image description: Images holds a reference to a URL at which the image file can be found. - x-resourceId: image type: object required: - url @@ -7070,10 +6698,9 @@ components: description: An optional key-value map with additional details example: car: white - invite: + Invite: title: Invite description: Represents an invite - x-resourceId: invite type: object required: - user_email @@ -7122,10 +6749,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_adjustment: + LineItemAdjustment: title: Line Item Adjustment - description: Represents an Line Item Adjustment - x-resourceId: line_item_adjustment + description: Represents a Line Item Adjustment type: object required: - item_id @@ -7142,7 +6768,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' description: type: string description: The line item's adjustment description @@ -7153,7 +6779,7 @@ components: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' amount: type: number description: The adjustment amount @@ -7163,10 +6789,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_tax_line: + LineItemTaxLine: title: Line Item Tax Line - description: Represents an Line Item Tax Line - x-resourceId: line_item_tax_line + description: Represents a Line Item Tax Line type: object required: - item_id @@ -7183,7 +6808,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' code: description: A code to identify the tax type by type: string @@ -7209,7 +6834,7 @@ components: description: An optional key-value map with additional details example: car: white - line_item: + LineItem: title: Line Item description: >- Line Items represent purchasable units that can be added to a Cart for @@ -7217,7 +6842,6 @@ components: resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. - x-resourceId: line_item type: object required: - title @@ -7262,12 +6886,12 @@ components: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: '#/components/schemas/line_item_tax_line' + $ref: '#/components/schemas/LineItemTaxLine' adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: '#/components/schemas/line_item_adjustment' + $ref: '#/components/schemas/LineItemAdjustment' title: description: >- The title of the Line Item, this should be easily identifiable by @@ -7403,7 +7027,7 @@ components: description: An optional key-value map with additional details example: car: white - money_amount: + MoneyAmount: title: Money Amount description: >- Money Amounts represents an amount that a given Product Variant can be @@ -7412,7 +7036,6 @@ components: 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. - x-resourceId: money_amount type: object required: - currency_code @@ -7431,7 +7054,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to @@ -7456,7 +7079,7 @@ components: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' variant_id: description: The id of the Product Variant contained in the Line Item. type: string @@ -7490,13 +7113,12 @@ components: description: An optional key-value map with additional details example: car: white - note: + 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. - x-resourceId: note type: object required: - value @@ -7525,7 +7147,7 @@ components: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' created_at: type: string description: The date with timezone at which the resource was created. @@ -7543,12 +7165,11 @@ components: description: An optional key-value map with additional details example: car: white - notification_provider: + NotificationProvider: title: Notification Provider description: >- Represents a notification provider plugin and holds its installation status. - x-resourceId: notification_provider type: object required: - id @@ -7564,14 +7185,13 @@ components: to `false`. type: boolean default: true - notification: + 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. - x-resourceId: notification type: object required: - resource_type @@ -7620,14 +7240,14 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: '#/components/schemas/NotificationResend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -7636,10 +7256,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - notification_resend: + NotificationResend: title: Notification Resend description: A resend of a Notification. - x-resourceId: notification_resend type: object properties: id: @@ -7684,14 +7303,14 @@ components: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -7703,7 +7322,6 @@ components: OAuth: title: OAuth description: Represent an OAuth app - x-resourceId: OAuth type: object required: - id @@ -7734,10 +7352,9 @@ components: type: object description: Any data necessary to the app. example: {} - order_edit: + OrderEdit: title: Order Edit description: Order edit keeps track of order items changes. - x-resourceId: order_edit type: object required: - order_id @@ -7755,12 +7372,12 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: '#/components/schemas/order_item_change' + $ref: '#/components/schemas/OrderItemChange' internal_note: description: An optional note with additional details about the order edit. type: string @@ -7847,14 +7464,14 @@ components: type: array description: Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' created_at: type: string description: The date with timezone at which the resource was created. @@ -7863,10 +7480,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - order_item_change: + OrderItemChange: title: Order Item Change description: Represents an order edit item change - x-resourceId: order_item_change type: object required: - type @@ -7889,21 +7505,21 @@ components: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' created_at: type: string description: The date with timezone at which the resource was created. @@ -7921,10 +7537,9 @@ components: description: An optional key-value map with additional details example: car: white - order: + Order: title: Order description: Represents an order - x-resourceId: order type: object required: - customer_id @@ -8000,14 +7615,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' region_id: type: string description: The region's ID @@ -8024,7 +7639,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The order's tax rate type: number @@ -8051,21 +7666,21 @@ components: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' returns: type: array description: >- @@ -8113,21 +7728,21 @@ components: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: '#/components/schemas/GiftCardTransaction' canceled_at: type: string description: The date the order was canceled on. @@ -8200,10 +7815,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - payment_collection: + PaymentCollection: title: Payment Collection description: Payment Collection - x-resourceId: payment_collection type: object required: - type @@ -8246,7 +7860,7 @@ components: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' currency_code: description: The 3 character ISO code for the currency. type: string @@ -8256,17 +7870,17 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' created_by: type: string description: The ID of the user that created the payment collection. @@ -8287,10 +7901,9 @@ components: description: An optional key-value map with additional details example: car: white - payment_provider: + PaymentProvider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. - x-resourceId: payment_provider type: object required: - id @@ -8306,7 +7919,7 @@ components: to `false`. type: boolean default: true - payment_session: + PaymentSession: title: Payment Session description: >- Payment Sessions are created when a Customer initilizes the checkout @@ -8315,7 +7928,6 @@ components: communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. - x-resourceId: payment_session type: object required: - cart_id @@ -8384,12 +7996,11 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - payment: + Payment: title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. - x-resourceId: payment type: object required: - amount @@ -8433,7 +8044,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount_refunded: description: >- The amount of the original Payment amount that has been refunded @@ -8482,12 +8093,11 @@ components: description: An optional key-value map with additional details example: car: white - price_list: + PriceList: title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. - x-resourceId: price_list type: object required: - name @@ -8544,8 +8154,8 @@ components: type: array items: oneOf: - - $ref: '#/components/schemas/money_amount' - - $ref: '#/components/schemas/customer_group' + - $ref: '#/components/schemas/MoneyAmount' + - $ref: '#/components/schemas/CustomerGroup' includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean @@ -8561,10 +8171,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - product_collection: + ProductCollection: title: Product Collection description: Product Collections represents a group of Products that are related. - x-resourceId: product_collection type: object required: - title @@ -8608,13 +8217,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option_value: + 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. - x-resourceId: product_option_value type: object required: - value @@ -8640,7 +8248,7 @@ components: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variant_id: description: >- The ID of the Product Variant that the Product Option Value is @@ -8649,7 +8257,7 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' created_at: type: string description: The date with timezone at which the resource was created. @@ -8667,13 +8275,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option: + 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. - x-resourceId: product_option type: object required: - title @@ -8693,7 +8300,7 @@ components: Available if the relation `values` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' product_id: description: The ID of the Product that the Product Option is defined for. type: string @@ -8718,10 +8325,9 @@ components: description: An optional key-value map with additional details example: car: white - product_tag: + ProductTag: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. - x-resourceId: product_tag type: object required: - value @@ -8751,12 +8357,11 @@ components: description: An optional key-value map with additional details example: car: white - product_tax_rate: + ProductTaxRate: title: Product Tax Rate description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way - x-resourceId: product_tax_rate type: object required: - product_id @@ -8768,14 +8373,14 @@ components: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -8789,12 +8394,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type_tax_rate: + 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 - x-resourceId: product_type_tax_rate type: object required: - product_type_id @@ -8806,14 +8410,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -8827,12 +8431,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type: + ProductType: title: Product Type description: >- Product Type can be added to Products for filtering and reporting purposes. - x-resourceId: product_type type: object required: - value @@ -8862,14 +8465,13 @@ components: description: An optional key-value map with additional details example: car: white - product_variant: + 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. - x-resourceId: product_variant type: object required: - title @@ -8900,7 +8502,7 @@ components: Region. Available if the relation `prices` is expanded. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: '#/components/schemas/MoneyAmount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -9002,7 +8604,7 @@ components: Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' created_at: type: string description: The date with timezone at which the resource was created. @@ -9020,10 +8622,9 @@ components: description: An optional key-value map with additional details example: car: white - product_variant_prices_fields: + ProductVariantPricesFields: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. - x-resourceId: product_variant_prices_fields type: object properties: original_price: @@ -9061,13 +8662,12 @@ components: code: type: string description: The code of the tax rate - product: + 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. - x-resourceId: product type: object required: - title @@ -9118,7 +8718,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/image' + $ref: '#/components/schemas/Image' thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -9130,7 +8730,7 @@ components: Option Values. Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variants: description: >- The Product Variants that belong to the Product. Each will have a @@ -9138,7 +8738,7 @@ components: relation `variants` is expanded. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -9148,7 +8748,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -9216,14 +8816,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: '#/components/schemas/product_type' + $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/product_tag' + $ref: '#/components/schemas/ProductTag' discountable: description: >- Whether the Product can be discounted. Discounts will not apply to @@ -9259,10 +8859,9 @@ components: description: An optional key-value map with additional details example: car: white - publishable_api_key_sales_channel: + PublishableApiKeySalesChannel: title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels - x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: @@ -9273,12 +8872,11 @@ components: type: string description: The publishable API key's ID example: pak_01G1G5V21KADXNGH29BJMAJ4B4 - publishable_api_key: + PublishableApiKey: title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. - x-resourceId: publishable_api_key type: object properties: id: @@ -9315,13 +8913,12 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - refund: + 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. - x-resourceId: refund type: object required: - order_id @@ -9381,14 +8978,13 @@ components: description: An optional key-value map with additional details example: car: white - region: + 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. - x-resourceId: region type: object required: - name @@ -9414,7 +9010,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -9425,7 +9021,7 @@ components: relation `tax_rates` is expanded. type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' tax_code: description: >- The tax code used on purchases in the Region. This may be used by @@ -9446,28 +9042,28 @@ components: relation `countries` is expanded. type: array items: - $ref: '#/components/schemas/country' + $ref: '#/components/schemas/Country' tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: '#/components/schemas/tax_provider' + $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/payment_provider' + $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean @@ -9488,12 +9084,11 @@ components: description: An optional key-value map with additional details example: car: white - return_item: + 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. - x-resourceId: return_item type: object required: - return_id @@ -9505,14 +9100,14 @@ components: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -9537,7 +9132,7 @@ components: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' note: description: An optional note with additional details about the Return. type: string @@ -9547,12 +9142,11 @@ components: description: An optional key-value map with additional details example: car: white - return_reason: + 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. - x-resourceId: return_reason type: object required: - value @@ -9580,10 +9174,10 @@ components: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' created_at: type: string description: The date with timezone at which the resource was created. @@ -9601,13 +9195,12 @@ components: description: An optional key-value map with additional details example: car: white - return: + 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. - x-resourceId: return type: object required: - refund_amount @@ -9631,7 +9224,7 @@ components: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/return_item' + $ref: '#/components/schemas/ReturnItem' swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -9662,7 +9255,7 @@ components: Available if the relation `shipping_method` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -9705,10 +9298,9 @@ components: description: An optional key-value map with additional details example: car: white - sales_channel: + SalesChannel: title: Sales Channel description: A Sales Channel - x-resourceId: sales_channel type: object required: - name @@ -9741,10 +9333,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_method_tax_line: + ShippingMethodTaxLine: title: Shipping Method Tax Line description: Shipping Method Tax Line - x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -9761,7 +9352,7 @@ components: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' code: description: A code to identify the tax type by type: string @@ -9787,14 +9378,13 @@ components: description: An optional key-value map with additional details example: car: white - shipping_method: + 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. - x-resourceId: shipping_method type: object required: - shipping_option_id @@ -9812,7 +9402,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -9856,7 +9446,7 @@ components: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: '#/components/schemas/shipping_method_tax_line' + $ref: '#/components/schemas/ShippingMethodTaxLine' price: description: >- The amount to charge for the Shipping Method. The currency of the @@ -9874,12 +9464,11 @@ components: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean - shipping_option_requirement: + ShippingOptionRequirement: title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. - x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -9898,7 +9487,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' type: description: >- The type of the requirement, this defines how the value will be @@ -9919,7 +9508,7 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_option: + ShippingOption: title: Shipping Option description: >- Shipping Options represent a way in which an Order or Return can be @@ -9928,7 +9517,6 @@ components: 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. - x-resourceId: shipping_option type: object required: - name @@ -9963,7 +9551,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -9972,7 +9560,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' price_type: description: >- The type of pricing calculation that is used when creatin Shipping @@ -10003,7 +9591,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: '#/components/schemas/ShippingOptionRequirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -10030,12 +9618,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_profile: + 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. - x-resourceId: shipping_profile type: object required: - name @@ -10076,7 +9663,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' created_at: type: string description: The date with timezone at which the resource was created. @@ -10094,12 +9681,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_tax_rate: + 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 - x-resourceId: shipping_tax_rate type: object required: - shipping_option_id @@ -10111,14 +9697,14 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -10132,10 +9718,9 @@ components: description: An optional key-value map with additional details example: car: white - staged_job: + StagedJob: title: Staged Job description: A staged job resource - x-resourceId: staged_job type: object required: - event_name @@ -10152,10 +9737,9 @@ components: description: Data necessary for the job type: object example: {} - store: + Store: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' - x-resourceId: store type: object properties: id: @@ -10175,14 +9759,14 @@ components: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: '#/components/schemas/currency' + $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' + $ref: '#/components/schemas/Currency' swap_link_template: description: >- A template to generate Swap links from. Use {{cart_id}} to include @@ -10213,7 +9797,7 @@ components: description: An optional key-value map with additional details example: car: white - swap: + Swap: title: Swap description: >- Swaps can be created when a Customer wishes to exchange Products that @@ -10223,7 +9807,6 @@ components: 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. - x-resourceId: swap type: object required: - fulfillment_status @@ -10275,7 +9858,7 @@ components: relation `additional_items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' return_order: description: >- A return order object. The Return that is issued for the return part @@ -10287,13 +9870,13 @@ components: relation `fulfillments` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May @@ -10309,14 +9892,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $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/shipping_method' + $ref: '#/components/schemas/ShippingMethod' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string @@ -10368,10 +9951,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_line: + TaxLine: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. - x-resourceId: tax_line type: object required: - rate @@ -10406,10 +9988,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_provider: + TaxProvider: title: Tax Provider description: The tax service used to calculate taxes - x-resourceId: tax_provider type: object properties: id: @@ -10423,12 +10004,11 @@ components: to `false`. type: boolean default: true - tax_rate: + TaxRate: title: Tax Rate description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region - x-resourceId: line_item type: object required: - name @@ -10506,13 +10086,12 @@ components: description: An optional key-value map with additional details example: car: white - tracking_link: + 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. - x-resourceId: tracking_link type: object required: - tracking_number @@ -10536,7 +10115,7 @@ components: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string description: >- @@ -10563,10 +10142,9 @@ components: description: An optional key-value map with additional details example: car: white - user: + User: title: User description: Represents a User who can manage store settings. - x-resourceId: user type: object required: - email @@ -10608,24 +10186,22 @@ components: description: An optional key-value map with additional details example: car: white - multiple_errors: + MultipleErrors: title: Multiple Errors - x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' message: type: string default: >- Provided request body contains errors. Please check the data and retry the request - error: + Error: title: Response Error - x-resourceId: error type: object properties: code: @@ -10637,3 +10213,363 @@ components: type: type: string description: A slug indicating the type of the error. + 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: + 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 + 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/Address' + description: A full billing address object. + - type: string + description: The billing address ID + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/Address' + description: A full shipping address object. + - type: string + description: The shipping address ID + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Gift Card is identified by. + type: string + discounts: + description: An array of Discount codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The ID of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. + type: object + example: + ip: '::1' + user_agent: Chrome + StorePostCustomersCustomerAddressesReq: + type: object + required: + - address + properties: + address: + description: The Address to add to the Customer. + allOf: + - $ref: '#/components/schemas/AddressFields' + - type: object + required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code + 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 + StorePostCustomersCustomerPasswordTokenReq: + type: object + required: + - email + properties: + email: + description: The email of the customer. + type: string + format: email + 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 + StorePostCustomersCustomerAddressesAddressReq: + anyOf: + - $ref: '#/components/schemas/AddressFields' + 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/AddressFields' + 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 + StorePostOrderEditsOrderEditDecline: + type: object + properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. + StorePostCustomersCustomerAcceptClaimReq: + type: object + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + StorePostCustomersCustomerOrderClaimReq: + type: object + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + 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: + 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. + StorePaymentCollectionSessionsReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + 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: + 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. + 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: + 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: + 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 diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 5f35d6cf56..007084881c 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -108,40 +108,28 @@ tags: sessions. - name: Cart description: Cart endpoints that allow handling carts in Medusa. - x-resourceId: cart - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap servers: - url: 'https://api.medusa-commerce.com/store' paths: @@ -190,7 +178,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -289,7 +277,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -397,7 +385,7 @@ paths: type: object properties: collection: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' '400': $ref: '#/components/responses/400_error' '404': @@ -504,7 +492,7 @@ paths: collections: type: array items: - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' count: type: integer description: The total number of items available @@ -574,7 +562,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -634,7 +622,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -715,21 +703,21 @@ paths: successfully. properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' - type: object description: >- Cart was successfully authorized but requires further actions. properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' - type: object description: >- When cart is used for a swap and it has been completed successfully. properties: cart: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '404': @@ -754,50 +742,7 @@ paths: content: application/json: schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Cart in. - sales_channel_id: - type: string - description: >- - [EXPERIMENTAL] The ID of the Sales channel to create the - Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - items: - description: >- - An optional array of `variant_id`, `quantity` pairs to - generate Line Items from. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: >- - The id of the Product Variant to generate a Line Item - from. - type: string - quantity: - description: The quantity of the Product Variant to add - type: integer - context: - description: >- - An optional object to provide context to the Cart. The - `context` field is automatically populated with `ip` and - `user_agent` - type: object - example: - ip: '::1' - user_agent: Chrome + $ref: '#/components/schemas/StorePostCartReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -827,7 +772,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -882,7 +827,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -941,7 +886,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1000,7 +945,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1066,7 +1011,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1140,7 +1085,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1207,7 +1152,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1271,7 +1216,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1297,68 +1242,7 @@ paths: content: application/json: schema: - type: object - properties: - region_id: - type: string - description: The id of the Region to create the Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Cart. - format: email - sales_channel_id: - type: string - description: The ID of the Sales channel to update the Cart with. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - description: A full billing address object. - - type: string - description: The billing address ID - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address' - description: A full shipping address object. - - type: string - description: The shipping address ID - gift_cards: - description: An array of Gift Card codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Gift Card is identified by. - type: string - discounts: - description: An array of Discount codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - customer_id: - description: The ID of the Customer to associate the Cart with. - type: string - context: - description: An optional object to provide context to the Cart. - type: object - example: - ip: '::1' - user_agent: Chrome + $ref: '#/components/schemas/StorePostCartsCartReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1397,7 +1281,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1460,7 +1344,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1523,7 +1407,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -1545,59 +1429,6 @@ paths: provider_id: type: string description: The ID of the Payment Provider. - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. - parameters: - - in: path - name: code - required: true - description: The unique Gift Card code. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.giftCards.retrieve(code) - - .then(({ gift_card }) => { - console.log(gift_card.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/gift-cards/{code}' - tags: - - Gift Card - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - gift_card: - $ref: '#/components/schemas/gift_card' - '400': - $ref: '#/components/responses/400_error' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' /customers/me/addresses: post: operationId: PostCustomersCustomerAddresses @@ -1608,22 +1439,7 @@ paths: content: application/json: schema: - type: object - required: - - address - properties: - address: - description: The Address to add to the Customer. - allOf: - - $ref: '#/components/schemas/address_fields' - - type: object - required: - - first_name - - last_name - - address_1 - - city - - country_code - - postal_code + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1687,7 +1503,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1709,30 +1525,7 @@ paths: content: application/json: schema: - type: object - required: - - first_name - - last_name - - email - - password - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - phone: - description: The Customer's phone number. - type: string + $ref: '#/components/schemas/StorePostCustomersReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -1777,7 +1570,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '404': @@ -1857,7 +1650,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1886,8 +1679,8 @@ paths: content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/address_fields' + $ref: >- + #/components/schemas/StorePostCustomersCustomerAddressesAddressReq x-codeSamples: - lang: JavaScript label: JS Client @@ -1932,7 +1725,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -1989,7 +1782,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2011,33 +1804,7 @@ paths: content: application/json: schema: - type: object - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address_fields' - description: The full billing address object - - type: string - description: The ID of an existing billing address - password: - description: The Customer's password. - type: string - phone: - description: The Customer's phone number. - type: string - email: - description: The email of the customer. - type: string - metadata: - description: Metadata about the customer. - type: object + $ref: '#/components/schemas/StorePostCustomersCustomerReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2082,7 +1849,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2374,7 +2141,7 @@ paths: orders: type: array items: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' count: type: integer description: The total number of items available @@ -2408,14 +2175,7 @@ paths: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The email of the customer. - type: string - format: email + $ref: '#/components/schemas/StorePostCustomersCustomerPasswordTokenReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2475,23 +2235,7 @@ paths: content: application/json: schema: - type: object - required: - - email - - password - - token - properties: - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - token: - description: The reset password token - type: string + $ref: '#/components/schemas/StorePostCustomersResetPasswordReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -2534,7 +2278,7 @@ paths: type: object properties: customer: - $ref: '#/components/schemas/customer' + $ref: '#/components/schemas/Customer' '400': $ref: '#/components/responses/400_error' '401': @@ -2547,163 +2291,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/batch/authorize': - post: - operationId: PostPaymentCollectionsSessionsBatchAuthorize - summary: Authorize Payment Sessions of a Payment Collection - description: Authorizes Payment Sessions of a Payment Collection. - x-authenticated: false - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collections. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - session_ids: - description: List of Payment Session IDs to authorize. - type: array - items: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.paymentCollections.authorize(payment_id) - - .then(({ payment_collection }) => { - console.log(payment_collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/{session_id}/authorize': - post: - operationId: PostPaymentCollectionsSessionsSessionAuthorize - summary: Authorize a Payment Session of a Payment Collection - description: Authorizes a Payment Session of a Payment Collection. - x-authenticated: false - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collections. - schema: - type: string - - in: path - name: session_id - required: true - description: The ID of the Payment Session. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - medusa.paymentCollections.authorize(payment_id, session_id) - - .then(({ payment_collection }) => { - console.log(payment_collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - payment_session: - $ref: '#/components/schemas/payment_session' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}': + '/gift-cards/{code}': get: - operationId: GetPaymentCollectionsPaymentCollection - summary: Retrieve an PaymentCollection - description: Retrieves a PaymentCollection. - x-authenticated: false + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. parameters: - in: path - name: id + name: code required: true - description: The ID of the 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. + description: The unique Gift Card code. schema: type: string x-codeSamples: @@ -2715,22 +2312,18 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged in or use api token + medusa.giftCards.retrieve(code) - medusa.paymentCollections.retrieve(paymentCollectionId) - .then(({ payment_collection }) => { - console.log(payment_collection.id) - }) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); - lang: Shell label: cURL source: > curl --location --request GET - 'https://medusa-url.com/store/payment-collections/{id}' - security: - - api_token: [] - - cookie_auth: [] + 'https://medusa-url.com/store/gift-cards/{code}' tags: - - PaymentCollection + - Gift Card responses: '200': description: OK @@ -2739,12 +2332,10 @@ paths: schema: type: object properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' + gift_card: + $ref: '#/components/schemas/GiftCard' '400': $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -2753,45 +2344,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/batch': + '/order-edits/{id}/complete': post: - operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch - summary: Manage Multiple Payment Sessions from Payment Collections - description: Manages Multiple Payment Sessions from Payment Collections. - x-authenticated: false + operationId: PostOrderEditsOrderEditComplete + summary: Completes an OrderEdit + description: Completes an OrderEdit. parameters: - in: path name: id required: true - description: The ID of the Payment Collections. + description: The ID of the Order Edit. schema: type: string - requestBody: - content: - application/json: - schema: - properties: - sessions: - description: >- - An array of payment sessions related to the Payment - Collection. If the session_id is not provided, existing - sessions not present will be deleted and the provided ones - will be created. - type: array - items: - required: - - provider_id - - amount - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - amount: - type: integer - description: The amount . - session_id: - type: string - description: The ID of the Payment Session to be updated. x-codeSamples: - lang: JavaScript label: JS Client @@ -2801,204 +2365,17 @@ paths: 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); - }); + 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/payment-collections/{id}/sessions/batch' - security: - - api_token: [] - - cookie_auth: [] + 'https://medusa-url.com/store/order-edits/{id}/complete' tags: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions': - post: - operationId: PostPaymentCollectionsSessions - summary: Manage Payment Sessions from Payment Collections - description: Manages Payment Sessions from Payment Collections. - x-authenticated: false - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collection. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - // must be previously logged in or use api token - - // Total amount = 10000 - - // Adding a payment session - - medusa.paymentCollections.managePaymentSession(payment_id, { - provider_id: "stripe" }) - - .then(({ payment_collection }) => { - console.log(payment_collection.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions' - security: - - api_token: [] - - cookie_auth: [] - tags: - - Payment - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - payment_collection: - $ref: '#/components/schemas/payment_collection' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/{session_id}': - post: - operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession - summary: Refresh a Payment Session - description: >- - Refreshes a Payment Session to ensure that it is in sync with the - Payment Collection. - x-authenticated: false - parameters: - - in: path - name: id - required: true - description: The id of the PaymentCollection. - schema: - type: string - - in: path - name: session_id - required: true - description: The id of the Payment Session to be refreshed. - schema: - type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - - customer_id - properties: - provider_id: - description: The Payment Provider id. - type: string - customer_id: - description: The Customer id. - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.paymentCollections.refreshPaymentSession(payment_collection_id, - session_id, payload) - - .then(({ payment_session }) => { - console.log(payment_session.id); - }); - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' - tags: - - PaymentCollection + - OrderEdit responses: '200': description: OK @@ -3007,10 +2384,118 @@ paths: schema: type: object properties: - payment_session: - $ref: '#/components/schemas/payment_session' + order_edit: + $ref: '#/components/schemas/OrderEdit' '400': $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/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-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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/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-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: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' '409': @@ -3022,7 +2507,7 @@ paths: /orders/customer/confirm: post: operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept - summary: Verify a claim to orders + summary: Verify an Order Claim description: >- Verifies the claim order token provided to the customer upon request of order ownership @@ -3030,12 +2515,7 @@ paths: content: application/json: schema: - required: - - token - properties: - token: - description: The invite token provided by the admin. - type: string + $ref: '#/components/schemas/StorePostCustomersCustomerAcceptClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3073,7 +2553,7 @@ paths: - api_token: [] - cookie_auth: [] tags: - - Invite + - Order responses: '200': description: OK @@ -3133,7 +2613,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -3186,7 +2666,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -3262,7 +2742,7 @@ paths: type: object properties: order: - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' '400': $ref: '#/components/responses/400_error' '404': @@ -3276,7 +2756,7 @@ paths: /orders/batch/customer/token: post: operationId: PostOrdersCustomerOrderClaim - summary: Claim orders for signed in account + summary: Claim an Order description: >- Sends an email to emails registered to orders provided with link to transfer order ownership @@ -3284,14 +2764,7 @@ paths: content: application/json: schema: - required: - - order_ids - properties: - order_ids: - description: The ids of the orders to claim - type: array - items: - type: string + $ref: '#/components/schemas/StorePostCustomersCustomerOrderClaimReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -3345,77 +2818,25 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/complete': + '/payment-collections/{id}/sessions/batch/authorize': post: - operationId: PostOrderEditsOrderEditComplete - summary: Completes an OrderEdit - description: Completes an OrderEdit. + 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 Order Edit. - schema: - type: string - x-codeSamples: - - lang: JavaScript - label: JS Client - source: > - import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.orderEdits.complete(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) - - lang: Shell - label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/order-edits/{id}/complete' - tags: - - OrderEdit - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - order_edit: - $ref: '#/components/schemas/order_edit' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '500': - $ref: '#/components/responses/500_error' - '/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. + description: The ID of the Payment Collections. schema: type: string requestBody: content: application/json: schema: - type: object - properties: - declined_reason: - type: string - description: The reason for declining the OrderEdit. + $ref: >- + #/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq x-codeSamples: - lang: JavaScript label: JS Client @@ -3425,45 +2846,61 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdits.decline(order_edit_id) - .then(({ order_edit }) => { - console.log(order_edit.id); - }) + // must be previously logged 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/order-edits/{id}/decline' + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + security: + - api_token: [] + - cookie_auth: [] tags: - - OrderEdit + - PaymentCollection responses: '200': description: OK content: application/json: schema: - type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + payment_collection: + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': $ref: '#/components/responses/unauthorized' '404': $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}': - get: - operationId: GetOrderEditsOrderEdit - summary: Retrieve an OrderEdit - description: Retrieves a OrderEdit. + '/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 OrderEdit. + description: The ID of the Payment Collections. + schema: + type: string + - in: path + name: session_id + required: true + description: The ID of the Payment Session. schema: type: string x-codeSamples: @@ -3475,18 +2912,92 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdits.retrieve(order_edit_id) + // must be previously logged in or use api token - .then(({ order_edit }) => { - console.log(order_edit.id); + medusa.paymentCollections.authorize(payment_id, session_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/store/order-edits/{id}' + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + security: + - api_token: [] + - cookie_auth: [] tags: - - OrderEdit + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_session: + $ref: '#/components/schemas/PaymentSession' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}': + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/payment-collections/{id}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection responses: '200': description: OK @@ -3495,8 +3006,8 @@ paths: schema: type: object properties: - order_edit: - $ref: '#/components/schemas/order_edit' + payment_collection: + $ref: '#/components/schemas/PaymentCollection' '400': $ref: '#/components/responses/400_error' '401': @@ -3509,6 +3020,231 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import 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: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions': + post: + operationId: PostPaymentCollectionsSessions + summary: Manage 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-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import 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: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/{session_id}': + post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the + Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The id of the PaymentCollection. + schema: + type: string + - in: path + name: session_id + required: true + description: The id of the Payment Session to be refreshed. + schema: + type: string + 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: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + payment_session: + $ref: '#/components/schemas/PaymentSession' + '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' /product-types: get: operationId: GetProductTypes @@ -3642,7 +3378,7 @@ paths: type: object properties: product_types: - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' count: type: integer description: The total number of items available @@ -3731,16 +3467,16 @@ paths: properties: product: allOf: - - $ref: '#/components/schemas/product' + - $ref: '#/components/schemas/Product' - type: object properties: variants: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' + - $ref: '#/components/schemas/ProductVariant' - $ref: >- - #/components/schemas/product_variant_prices_fields + #/components/schemas/ProductVariantPricesFields '400': $ref: '#/components/responses/400_error' '404': @@ -3901,6 +3637,11 @@ paths: the result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -3934,16 +3675,16 @@ paths: type: array items: allOf: - - $ref: '#/components/schemas/product' + - $ref: '#/components/schemas/Product' - type: object properties: variants: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' + - $ref: '#/components/schemas/ProductVariant' - $ref: >- - #/components/schemas/product_variant_prices_fields + #/components/schemas/ProductVariantPricesFields count: type: integer description: The total number of items available @@ -4075,7 +3816,7 @@ paths: type: object properties: region: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '404': @@ -4179,7 +3920,7 @@ paths: regions: type: array items: - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' '400': $ref: '#/components/responses/400_error' '404': @@ -4232,7 +3973,7 @@ paths: type: object properties: return_reason: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '404': @@ -4280,7 +4021,7 @@ paths: return_reasons: type: array items: - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' '400': $ref: '#/components/responses/400_error' '404': @@ -4300,48 +4041,7 @@ paths: content: application/json: schema: - 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: - 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. + $ref: '#/components/schemas/StorePostReturnsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4392,7 +4092,7 @@ paths: type: object properties: return: - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' '400': $ref: '#/components/responses/400_error' '404': @@ -4458,7 +4158,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '404': @@ -4513,7 +4213,7 @@ paths: shipping_options: type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' '400': $ref: '#/components/responses/400_error' '404': @@ -4535,54 +4235,7 @@ paths: content: application/json: schema: - 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: - 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: - 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 + $ref: '#/components/schemas/StorePostSwapsReq' x-codeSamples: - lang: JavaScript label: JS Client @@ -4645,7 +4298,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '404': @@ -4698,7 +4351,7 @@ paths: type: object properties: swap: - $ref: '#/components/schemas/swap' + $ref: '#/components/schemas/Swap' '400': $ref: '#/components/responses/400_error' '404': @@ -4759,8 +4412,8 @@ paths: properties: variant: allOf: - - $ref: '#/components/schemas/product_variant' - - $ref: '#/components/schemas/product_variant_prices_fields' + - $ref: '#/components/schemas/ProductVariant' + - $ref: '#/components/schemas/ProductVariantPricesFields' '400': $ref: '#/components/responses/400_error' '404': @@ -4858,8 +4511,8 @@ paths: type: array items: allOf: - - $ref: '#/components/schemas/product_variant' - - $ref: '#/components/schemas/product_variant_prices_fields' + - $ref: '#/components/schemas/ProductVariant' + - $ref: '#/components/schemas/ProductVariantPricesFields' '400': $ref: '#/components/responses/400_error' '404': @@ -4924,7 +4577,7 @@ paths: type: object properties: cart: - $ref: '#/components/schemas/cart' + $ref: '#/components/schemas/Cart' '400': $ref: '#/components/responses/400_error' '404': @@ -4964,7 +4617,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: An unknown error occurred. @@ -4974,7 +4627,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: unknown_error message: >- @@ -4986,7 +4639,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: code: invalid_request_error message: Discount with code TEST already exists. @@ -4996,7 +4649,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' example: message: Entity with id 1 was not found type: not_found @@ -5006,21 +4659,21 @@ components: application/json: schema: oneOf: - - $ref: '#/components/schemas/error' - - $ref: '#/components/schemas/multiple_errors' + - $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' - multiple_errors: + MultipleErrors: $ref: '#/components/examples/multiple_errors' 500_error: description: Server Error content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' examples: database: $ref: '#/components/examples/database_error' @@ -5158,10 +4811,9 @@ components: Where `{sid}` is the value of `connect.sid` that you copied. schemas: - address_fields: + AddressFields: title: Address Fields description: Address fields used when creating/updating an address. - x-resourceId: address type: object properties: company: @@ -5213,10 +4865,9 @@ components: description: An optional key-value map with additional details example: car: white - address: + Address: title: Address description: An address. - x-resourceId: address type: object properties: id: @@ -5297,10 +4948,9 @@ components: description: An optional key-value map with additional details example: car: white - batch_job: + BatchJob: title: Batch Job description: A Batch Job. - x-resourceId: batch_job type: object required: - type @@ -5440,10 +5090,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - cart: + Cart: title: Cart description: Represents a user cart - x-resourceId: cart type: object properties: id: @@ -5460,19 +5109,19 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' region_id: type: string description: The region's ID @@ -5501,24 +5150,24 @@ components: type: object payment_session: description: The selected payment session in the cart. - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' type: type: string description: The cart's type. @@ -5618,10 +5267,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - claim_image: + ClaimImage: title: Claim Image description: Represents photo documentation of a claim. - x-resourceId: claim_image type: object required: - claim_item_id @@ -5660,12 +5308,11 @@ components: description: An optional key-value map with additional details example: car: white - claim_item: + ClaimItem: title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. - x-resourceId: claim_item type: object required: - claim_order_id @@ -5682,7 +5329,7 @@ components: type: array description: Available if the relation `images` is expanded. items: - $ref: '#/components/schemas/claim_image' + $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -5697,7 +5344,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. type: string @@ -5729,7 +5376,7 @@ components: relation 'tags' is expanded. type: array items: - $ref: '#/components/schemas/claim_tag' + $ref: '#/components/schemas/ClaimTag' created_at: type: string description: The date with timezone at which the resource was created. @@ -5747,13 +5394,12 @@ components: description: An optional key-value map with additional details example: car: white - claim_order: + 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. - x-resourceId: claim_order type: object required: - type @@ -5793,14 +5439,14 @@ components: description: The items that have been claimed type: array items: - $ref: '#/components/schemas/claim_item' + $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/line_item' + $ref: '#/components/schemas/LineItem' order_id: description: The ID of the order that the claim comes from. type: string @@ -5819,17 +5465,17 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer @@ -5870,12 +5516,11 @@ components: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - claim_tag: + ClaimTag: title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. - x-resourceId: claim_tag type: object required: - value @@ -5905,10 +5550,9 @@ components: description: An optional key-value map with additional details example: car: white - country: + Country: title: Country description: Country details - x-resourceId: country type: object required: - iso_2 @@ -5960,10 +5604,9 @@ components: region: description: A region object. Available if the relation `region` is expanded. type: object - currency: + Currency: title: Currency description: Currency - x-resourceId: currency type: object required: - code @@ -5993,13 +5636,12 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean - custom_shipping_option: + 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 - x-resourceId: custom_shipping_option type: object required: - price @@ -6055,10 +5697,9 @@ components: [EXPERIMENTAL] Indicates if the custom shipping option price include tax type: boolean - customer_group: + CustomerGroup: title: Customer Group description: Represents a customer group - x-resourceId: customer_group type: object required: - name @@ -6085,7 +5726,7 @@ components: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' created_at: type: string description: The date with timezone at which the resource was created. @@ -6103,10 +5744,9 @@ components: description: An optional key-value map with additional details example: car: white - customer: + Customer: title: Customer description: Represents a customer - x-resourceId: customer type: object required: - email @@ -6133,12 +5773,12 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' phone: type: string description: The customer's phone number @@ -6159,7 +5799,7 @@ components: relation `groups` is expanded. type: array items: - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' created_at: type: string description: The date with timezone at which the resource was created. @@ -6177,10 +5817,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_customer_group: + DiscountConditionCustomerGroup: title: Product Tag Discount Condition description: Associates a discount condition with a customer group - x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -6196,10 +5835,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: '#/components/schemas/customer_group' + $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6213,10 +5852,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_collection: + DiscountConditionProductCollection: title: Product Collection Discount Condition description: Associates a discount condition with a product collection - x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -6232,10 +5870,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: '#/components/schemas/product_collection' + $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6249,10 +5887,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_tag: + DiscountConditionProductTag: title: Product Tag Discount Condition description: Associates a discount condition with a product tag - x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -6268,10 +5905,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: '#/components/schemas/product_tag' + $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6285,10 +5922,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product_type: + DiscountConditionProductType: title: Product Type Discount Condition description: Associates a discount condition with a product type - x-resourceId: discount_condition_product type: object required: - product_type_id @@ -6304,10 +5940,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6321,10 +5957,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition_product: + DiscountConditionProduct: title: Product Discount Condition description: Associates a discount condition with a product - x-resourceId: discount_condition_product type: object required: - product_id @@ -6340,10 +5975,10 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: '#/components/schemas/discount_condition' + $ref: '#/components/schemas/DiscountCondition' created_at: type: string description: The date with timezone at which the resource was created. @@ -6357,10 +5992,9 @@ components: description: An optional key-value map with additional details example: car: white - discount_condition: + DiscountCondition: title: Discount Condition description: Holds rule conditions for when a discount is applicable - x-resourceId: discount_condition type: object required: - type @@ -6392,7 +6026,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' products: description: >- products associated with this condition if type = products. @@ -6453,12 +6087,11 @@ components: description: An optional key-value map with additional details example: car: white - discount_rule: + DiscountRule: title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. - x-resourceId: discount_rule type: object required: - type @@ -6521,12 +6154,11 @@ components: description: An optional key-value map with additional details example: car: white - discount: + Discount: title: Discount description: >- Represents a discount that can be applied to a cart for promotional purposes. - x-resourceId: discount type: object required: - code @@ -6554,7 +6186,7 @@ components: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: '#/components/schemas/discount_rule' + $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -6569,7 +6201,7 @@ components: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. type: string @@ -6616,10 +6248,9 @@ components: description: An optional key-value map with additional details example: car: white - draft-order: + DraftOrder: title: DraftOrder description: Represents a draft order - x-resourceId: draft-order type: object properties: id: @@ -6689,12 +6320,11 @@ components: description: An optional key-value map with additional details example: car: white - fulfillment_item: + FulfillmentItem: title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. - x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -6716,17 +6346,16 @@ components: type: object item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer example: 1 - fulfillment_provider: + FulfillmentProvider: title: Fulfillment Provider description: >- Represents a fulfillment provider plugin and holds its installation status. - x-resourceId: fulfillment_provider type: object properties: id: @@ -6740,7 +6369,7 @@ components: to `false`. type: boolean example: true - fulfillment: + Fulfillment: title: Fulfillment description: >- Fulfillments are created once store operators can prepare the purchased @@ -6750,7 +6379,6 @@ components: 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. - x-resourceId: fulfillment type: object required: - provider_id @@ -6790,7 +6418,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' items: description: >- The Fulfillment Items in the Fulfillment - these hold information @@ -6798,7 +6426,7 @@ components: the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_item' + $ref: '#/components/schemas/FulfillmentItem' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -6806,7 +6434,7 @@ components: Provider. Available if the relation `tracking_links` is expanded. type: array items: - $ref: '#/components/schemas/tracking_link' + $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true description: >- @@ -6861,12 +6489,11 @@ components: description: An optional key-value map with additional details example: car: white - gift_card_transaction: + GiftCardTransaction: title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order - x-resourceId: gift_card_transaction type: object required: - gift_card_id @@ -6908,12 +6535,11 @@ components: description: The tax rate of the transaction type: number example: 0 - gift_card: + GiftCard: title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. - x-resourceId: gift_card type: object required: - code @@ -6963,6 +6589,10 @@ components: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. @@ -6980,12 +6610,11 @@ components: description: An optional key-value map with additional details example: car: white - idempotency_key: + IdempotencyKey: title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. - x-resourceId: idempotency_key type: object required: - idempotency_key @@ -7037,10 +6666,9 @@ components: type: string description: Where to continue from. default: started - image: + Image: title: Image description: Images holds a reference to a URL at which the image file can be found. - x-resourceId: image type: object required: - url @@ -7070,10 +6698,9 @@ components: description: An optional key-value map with additional details example: car: white - invite: + Invite: title: Invite description: Represents an invite - x-resourceId: invite type: object required: - user_email @@ -7122,10 +6749,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_adjustment: + LineItemAdjustment: title: Line Item Adjustment - description: Represents an Line Item Adjustment - x-resourceId: line_item_adjustment + description: Represents a Line Item Adjustment type: object required: - item_id @@ -7142,7 +6768,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' description: type: string description: The line item's adjustment description @@ -7153,7 +6779,7 @@ components: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: '#/components/schemas/discount' + $ref: '#/components/schemas/Discount' amount: type: number description: The adjustment amount @@ -7163,10 +6789,9 @@ components: description: An optional key-value map with additional details example: car: white - line_item_tax_line: + LineItemTaxLine: title: Line Item Tax Line - description: Represents an Line Item Tax Line - x-resourceId: line_item_tax_line + description: Represents a Line Item Tax Line type: object required: - item_id @@ -7183,7 +6808,7 @@ components: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' code: description: A code to identify the tax type by type: string @@ -7209,7 +6834,7 @@ components: description: An optional key-value map with additional details example: car: white - line_item: + LineItem: title: Line Item description: >- Line Items represent purchasable units that can be added to a Cart for @@ -7217,7 +6842,6 @@ components: resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. - x-resourceId: line_item type: object required: - title @@ -7262,12 +6886,12 @@ components: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: '#/components/schemas/line_item_tax_line' + $ref: '#/components/schemas/LineItemTaxLine' adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: '#/components/schemas/line_item_adjustment' + $ref: '#/components/schemas/LineItemAdjustment' title: description: >- The title of the Line Item, this should be easily identifiable by @@ -7403,7 +7027,7 @@ components: description: An optional key-value map with additional details example: car: white - money_amount: + MoneyAmount: title: Money Amount description: >- Money Amounts represents an amount that a given Product Variant can be @@ -7412,7 +7036,6 @@ components: 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. - x-resourceId: money_amount type: object required: - currency_code @@ -7431,7 +7054,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to @@ -7456,7 +7079,7 @@ components: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: '#/components/schemas/price_list' + $ref: '#/components/schemas/PriceList' variant_id: description: The id of the Product Variant contained in the Line Item. type: string @@ -7490,13 +7113,12 @@ components: description: An optional key-value map with additional details example: car: white - note: + 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. - x-resourceId: note type: object required: - value @@ -7525,7 +7147,7 @@ components: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: '#/components/schemas/user' + $ref: '#/components/schemas/User' created_at: type: string description: The date with timezone at which the resource was created. @@ -7543,12 +7165,11 @@ components: description: An optional key-value map with additional details example: car: white - notification_provider: + NotificationProvider: title: Notification Provider description: >- Represents a notification provider plugin and holds its installation status. - x-resourceId: notification_provider type: object required: - id @@ -7564,14 +7185,13 @@ components: to `false`. type: boolean default: true - notification: + 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. - x-resourceId: notification type: object required: - resource_type @@ -7620,14 +7240,14 @@ components: Notification. type: array items: - $ref: '#/components/schemas/notification_resend' + $ref: '#/components/schemas/NotificationResend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -7636,10 +7256,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - notification_resend: + NotificationResend: title: Notification Resend description: A resend of a Notification. - x-resourceId: notification_resend type: object properties: id: @@ -7684,14 +7303,14 @@ components: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: '#/components/schemas/notification' + $ref: '#/components/schemas/Notification' provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/notification_provider' + $ref: '#/components/schemas/NotificationProvider' created_at: type: string description: The date with timezone at which the resource was created. @@ -7703,7 +7322,6 @@ components: OAuth: title: OAuth description: Represent an OAuth app - x-resourceId: OAuth type: object required: - id @@ -7734,10 +7352,9 @@ components: type: object description: Any data necessary to the app. example: {} - order_edit: + OrderEdit: title: Order Edit description: Order edit keeps track of order items changes. - x-resourceId: order_edit type: object required: - order_id @@ -7755,12 +7372,12 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/order' + $ref: '#/components/schemas/Order' changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: '#/components/schemas/order_item_change' + $ref: '#/components/schemas/OrderItemChange' internal_note: description: An optional note with additional details about the order edit. type: string @@ -7847,14 +7464,14 @@ components: type: array description: Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: '#/components/schemas/payment_collection' + $ref: '#/components/schemas/PaymentCollection' created_at: type: string description: The date with timezone at which the resource was created. @@ -7863,10 +7480,9 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - order_item_change: + OrderItemChange: title: Order Item Change description: Represents an order edit item change - x-resourceId: order_item_change type: object required: - type @@ -7889,21 +7505,21 @@ components: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' created_at: type: string description: The date with timezone at which the resource was created. @@ -7921,10 +7537,9 @@ components: description: An optional key-value map with additional details example: car: white - order: + Order: title: Order description: Represents an order - x-resourceId: order type: object required: - customer_id @@ -8000,14 +7615,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $ref: '#/components/schemas/Address' region_id: type: string description: The region's ID @@ -8024,7 +7639,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The order's tax rate type: number @@ -8051,21 +7666,21 @@ components: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' returns: type: array description: >- @@ -8113,21 +7728,21 @@ components: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: '#/components/schemas/order_edit' + $ref: '#/components/schemas/OrderEdit' gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: '#/components/schemas/gift_card_transaction' + $ref: '#/components/schemas/GiftCardTransaction' canceled_at: type: string description: The date the order was canceled on. @@ -8200,10 +7815,9 @@ components: type: integer description: The total of gift cards with taxes example: 0 - payment_collection: + PaymentCollection: title: Payment Collection description: Payment Collection - x-resourceId: payment_collection type: object required: - type @@ -8246,7 +7860,7 @@ components: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: '#/components/schemas/region' + $ref: '#/components/schemas/Region' currency_code: description: The 3 character ISO code for the currency. type: string @@ -8256,17 +7870,17 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: '#/components/schemas/payment_session' + $ref: '#/components/schemas/PaymentSession' payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' created_by: type: string description: The ID of the user that created the payment collection. @@ -8287,10 +7901,9 @@ components: description: An optional key-value map with additional details example: car: white - payment_provider: + PaymentProvider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. - x-resourceId: payment_provider type: object required: - id @@ -8306,7 +7919,7 @@ components: to `false`. type: boolean default: true - payment_session: + PaymentSession: title: Payment Session description: >- Payment Sessions are created when a Customer initilizes the checkout @@ -8315,7 +7928,6 @@ components: communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. - x-resourceId: payment_session type: object required: - cart_id @@ -8384,12 +7996,11 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - payment: + Payment: title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. - x-resourceId: payment type: object required: - amount @@ -8433,7 +8044,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' amount_refunded: description: >- The amount of the original Payment amount that has been refunded @@ -8482,12 +8093,11 @@ components: description: An optional key-value map with additional details example: car: white - price_list: + PriceList: title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. - x-resourceId: price_list type: object required: - name @@ -8544,8 +8154,8 @@ components: type: array items: oneOf: - - $ref: '#/components/schemas/money_amount' - - $ref: '#/components/schemas/customer_group' + - $ref: '#/components/schemas/MoneyAmount' + - $ref: '#/components/schemas/CustomerGroup' includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean @@ -8561,10 +8171,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - product_collection: + ProductCollection: title: Product Collection description: Product Collections represents a group of Products that are related. - x-resourceId: product_collection type: object required: - title @@ -8608,13 +8217,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option_value: + 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. - x-resourceId: product_option_value type: object required: - value @@ -8640,7 +8248,7 @@ components: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variant_id: description: >- The ID of the Product Variant that the Product Option Value is @@ -8649,7 +8257,7 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' created_at: type: string description: The date with timezone at which the resource was created. @@ -8667,13 +8275,12 @@ components: description: An optional key-value map with additional details example: car: white - product_option: + 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. - x-resourceId: product_option type: object required: - title @@ -8693,7 +8300,7 @@ components: Available if the relation `values` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' product_id: description: The ID of the Product that the Product Option is defined for. type: string @@ -8718,10 +8325,9 @@ components: description: An optional key-value map with additional details example: car: white - product_tag: + ProductTag: title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. - x-resourceId: product_tag type: object required: - value @@ -8751,12 +8357,11 @@ components: description: An optional key-value map with additional details example: car: white - product_tax_rate: + ProductTaxRate: title: Product Tax Rate description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way - x-resourceId: product_tax_rate type: object required: - product_id @@ -8768,14 +8373,14 @@ components: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: '#/components/schemas/product' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -8789,12 +8394,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type_tax_rate: + 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 - x-resourceId: product_type_tax_rate type: object required: - product_type_id @@ -8806,14 +8410,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: '#/components/schemas/product_type' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -8827,12 +8431,11 @@ components: description: An optional key-value map with additional details example: car: white - product_type: + ProductType: title: Product Type description: >- Product Type can be added to Products for filtering and reporting purposes. - x-resourceId: product_type type: object required: - value @@ -8862,14 +8465,13 @@ components: description: An optional key-value map with additional details example: car: white - product_variant: + 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. - x-resourceId: product_variant type: object required: - title @@ -8900,7 +8502,7 @@ components: Region. Available if the relation `prices` is expanded. type: array items: - $ref: '#/components/schemas/money_amount' + $ref: '#/components/schemas/MoneyAmount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -9002,7 +8604,7 @@ components: Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option_value' + $ref: '#/components/schemas/ProductOptionValue' created_at: type: string description: The date with timezone at which the resource was created. @@ -9020,10 +8622,9 @@ components: description: An optional key-value map with additional details example: car: white - product_variant_prices_fields: + ProductVariantPricesFields: title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. - x-resourceId: product_variant_prices_fields type: object properties: original_price: @@ -9061,13 +8662,12 @@ components: code: type: string description: The code of the tax rate - product: + 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. - x-resourceId: product type: object required: - title @@ -9118,7 +8718,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/image' + $ref: '#/components/schemas/Image' thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -9130,7 +8730,7 @@ components: Option Values. Available if the relation `options` is expanded. type: array items: - $ref: '#/components/schemas/product_option' + $ref: '#/components/schemas/ProductOption' variants: description: >- The Product Variants that belong to the Product. Each will have a @@ -9138,7 +8738,7 @@ components: relation `variants` is expanded. type: array items: - $ref: '#/components/schemas/product_variant' + $ref: '#/components/schemas/ProductVariant' profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -9148,7 +8748,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -9216,14 +8816,14 @@ components: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: '#/components/schemas/product_type' + $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/product_tag' + $ref: '#/components/schemas/ProductTag' discountable: description: >- Whether the Product can be discounted. Discounts will not apply to @@ -9259,10 +8859,9 @@ components: description: An optional key-value map with additional details example: car: white - publishable_api_key_sales_channel: + PublishableApiKeySalesChannel: title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels - x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: @@ -9273,12 +8872,11 @@ components: type: string description: The publishable API key's ID example: pak_01G1G5V21KADXNGH29BJMAJ4B4 - publishable_api_key: + PublishableApiKey: title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. - x-resourceId: publishable_api_key type: object properties: id: @@ -9315,13 +8913,12 @@ components: type: string description: The date with timezone at which the resource was updated. format: date-time - refund: + 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. - x-resourceId: refund type: object required: - order_id @@ -9381,14 +8978,13 @@ components: description: An optional key-value map with additional details example: car: white - region: + 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. - x-resourceId: region type: object required: - name @@ -9414,7 +9010,7 @@ components: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: '#/components/schemas/currency' + $ref: '#/components/schemas/Currency' tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -9425,7 +9021,7 @@ components: relation `tax_rates` is expanded. type: array items: - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' tax_code: description: >- The tax code used on purchases in the Region. This may be used by @@ -9446,28 +9042,28 @@ components: relation `countries` is expanded. type: array items: - $ref: '#/components/schemas/country' + $ref: '#/components/schemas/Country' tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: '#/components/schemas/tax_provider' + $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/payment_provider' + $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean @@ -9488,12 +9084,11 @@ components: description: An optional key-value map with additional details example: car: white - return_item: + 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. - x-resourceId: return_item type: object required: - return_id @@ -9505,14 +9100,14 @@ components: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: '#/components/schemas/return' + $ref: '#/components/schemas/Return' item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -9537,7 +9132,7 @@ components: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' note: description: An optional note with additional details about the Return. type: string @@ -9547,12 +9142,11 @@ components: description: An optional key-value map with additional details example: car: white - return_reason: + 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. - x-resourceId: return_reason type: object required: - value @@ -9580,10 +9174,10 @@ components: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/return_reason' + $ref: '#/components/schemas/ReturnReason' created_at: type: string description: The date with timezone at which the resource was created. @@ -9601,13 +9195,12 @@ components: description: An optional key-value map with additional details example: car: white - return: + 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. - x-resourceId: return type: object required: - refund_amount @@ -9631,7 +9224,7 @@ components: Available if the relation `items` is expanded. type: array items: - $ref: '#/components/schemas/return_item' + $ref: '#/components/schemas/ReturnItem' swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -9662,7 +9255,7 @@ components: Available if the relation `shipping_method` is expanded. type: array items: - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -9705,10 +9298,9 @@ components: description: An optional key-value map with additional details example: car: white - sales_channel: + SalesChannel: title: Sales Channel description: A Sales Channel - x-resourceId: sales_channel type: object required: - name @@ -9741,10 +9333,9 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_method_tax_line: + ShippingMethodTaxLine: title: Shipping Method Tax Line description: Shipping Method Tax Line - x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -9761,7 +9352,7 @@ components: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: '#/components/schemas/shipping_method' + $ref: '#/components/schemas/ShippingMethod' code: description: A code to identify the tax type by type: string @@ -9787,14 +9378,13 @@ components: description: An optional key-value map with additional details example: car: white - shipping_method: + 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. - x-resourceId: shipping_method type: object required: - shipping_option_id @@ -9812,7 +9402,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -9856,7 +9446,7 @@ components: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: '#/components/schemas/shipping_method_tax_line' + $ref: '#/components/schemas/ShippingMethodTaxLine' price: description: >- The amount to charge for the Shipping Method. The currency of the @@ -9874,12 +9464,11 @@ components: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean - shipping_option_requirement: + ShippingOptionRequirement: title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. - x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -9898,7 +9487,7 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' type: description: >- The type of the requirement, this defines how the value will be @@ -9919,7 +9508,7 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time - shipping_option: + ShippingOption: title: Shipping Option description: >- Shipping Options represent a way in which an Order or Return can be @@ -9928,7 +9517,6 @@ components: 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. - x-resourceId: shipping_option type: object required: - name @@ -9963,7 +9551,7 @@ components: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: '#/components/schemas/shipping_profile' + $ref: '#/components/schemas/ShippingProfile' provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -9972,7 +9560,7 @@ components: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: '#/components/schemas/fulfillment_provider' + $ref: '#/components/schemas/FulfillmentProvider' price_type: description: >- The type of pricing calculation that is used when creatin Shipping @@ -10003,7 +9591,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option_requirement' + $ref: '#/components/schemas/ShippingOptionRequirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -10030,12 +9618,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_profile: + 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. - x-resourceId: shipping_profile type: object required: - name @@ -10076,7 +9663,7 @@ components: expanded. type: array items: - $ref: '#/components/schemas/shipping_option' + $ref: '#/components/schemas/ShippingOption' created_at: type: string description: The date with timezone at which the resource was created. @@ -10094,12 +9681,11 @@ components: description: An optional key-value map with additional details example: car: white - shipping_tax_rate: + 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 - x-resourceId: shipping_tax_rate type: object required: - shipping_option_id @@ -10111,14 +9697,14 @@ components: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: '#/components/schemas/shipping_option' + $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. - $ref: '#/components/schemas/tax_rate' + $ref: '#/components/schemas/TaxRate' created_at: type: string description: The date with timezone at which the resource was created. @@ -10132,10 +9718,9 @@ components: description: An optional key-value map with additional details example: car: white - staged_job: + StagedJob: title: Staged Job description: A staged job resource - x-resourceId: staged_job type: object required: - event_name @@ -10152,10 +9737,9 @@ components: description: Data necessary for the job type: object example: {} - store: + Store: title: Store description: 'Holds settings for the Store, such as name, currencies, etc.' - x-resourceId: store type: object properties: id: @@ -10175,14 +9759,14 @@ components: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: '#/components/schemas/currency' + $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' + $ref: '#/components/schemas/Currency' swap_link_template: description: >- A template to generate Swap links from. Use {{cart_id}} to include @@ -10213,7 +9797,7 @@ components: description: An optional key-value map with additional details example: car: white - swap: + Swap: title: Swap description: >- Swaps can be created when a Customer wishes to exchange Products that @@ -10223,7 +9807,6 @@ components: 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. - x-resourceId: swap type: object required: - fulfillment_status @@ -10275,7 +9858,7 @@ components: relation `additional_items` is expanded. type: array items: - $ref: '#/components/schemas/line_item' + $ref: '#/components/schemas/LineItem' return_order: description: >- A return order object. The Return that is issued for the return part @@ -10287,13 +9870,13 @@ components: relation `fulfillments` is expanded. type: array items: - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. - $ref: '#/components/schemas/payment' + $ref: '#/components/schemas/Payment' difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May @@ -10309,14 +9892,14 @@ components: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: '#/components/schemas/address' + $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/shipping_method' + $ref: '#/components/schemas/ShippingMethod' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string @@ -10368,10 +9951,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_line: + TaxLine: title: Tax Line description: Line item that specifies an amount of tax to add to a line item. - x-resourceId: tax_line type: object required: - rate @@ -10406,10 +9988,9 @@ components: description: An optional key-value map with additional details example: car: white - tax_provider: + TaxProvider: title: Tax Provider description: The tax service used to calculate taxes - x-resourceId: tax_provider type: object properties: id: @@ -10423,12 +10004,11 @@ components: to `false`. type: boolean default: true - tax_rate: + TaxRate: title: Tax Rate description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region - x-resourceId: line_item type: object required: - name @@ -10506,13 +10086,12 @@ components: description: An optional key-value map with additional details example: car: white - tracking_link: + 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. - x-resourceId: tracking_link type: object required: - tracking_number @@ -10536,7 +10115,7 @@ components: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: '#/components/schemas/fulfillment' + $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string description: >- @@ -10563,10 +10142,9 @@ components: description: An optional key-value map with additional details example: car: white - user: + User: title: User description: Represents a User who can manage store settings. - x-resourceId: user type: object required: - email @@ -10608,24 +10186,22 @@ components: description: An optional key-value map with additional details example: car: white - multiple_errors: + MultipleErrors: title: Multiple Errors - x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/Error' message: type: string default: >- Provided request body contains errors. Please check the data and retry the request - error: + Error: title: Response Error - x-resourceId: error type: object properties: code: @@ -10637,3 +10213,363 @@ components: type: type: string description: A slug indicating the type of the error. + 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: + 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 + 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/Address' + description: A full billing address object. + - type: string + description: The billing address ID + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/Address' + description: A full shipping address object. + - type: string + description: The shipping address ID + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Gift Card is identified by. + type: string + discounts: + description: An array of Discount codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The ID of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. + type: object + example: + ip: '::1' + user_agent: Chrome + StorePostCustomersCustomerAddressesReq: + type: object + required: + - address + properties: + address: + description: The Address to add to the Customer. + allOf: + - $ref: '#/components/schemas/AddressFields' + - type: object + required: + - first_name + - last_name + - address_1 + - city + - country_code + - postal_code + 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 + StorePostCustomersCustomerPasswordTokenReq: + type: object + required: + - email + properties: + email: + description: The email of the customer. + type: string + format: email + 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 + StorePostCustomersCustomerAddressesAddressReq: + anyOf: + - $ref: '#/components/schemas/AddressFields' + 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/AddressFields' + 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 + StorePostOrderEditsOrderEditDecline: + type: object + properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. + StorePostCustomersCustomerAcceptClaimReq: + type: object + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + StorePostCustomersCustomerOrderClaimReq: + type: object + required: + - order_ids + properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string + 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: + 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. + StorePaymentCollectionSessionsReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + 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: + 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. + 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: + 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: + 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 diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined index f160bb1dda..8dfeeb183e 100644 --- a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined +++ b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined @@ -1,6 +1,6 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) -medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id, payload) +medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id) .then(({ payment_session }) => { console.log(payment_session.id); }); diff --git a/docs/api/store/components/responses/400_error.yaml b/docs/api/store/components/responses/400_error.yaml index 95f25b376b..b960f05fb4 100644 --- a/docs/api/store/components/responses/400_error.yaml +++ b/docs/api/store/components/responses/400_error.yaml @@ -3,12 +3,12 @@ content: application/json: schema: oneOf: - - $ref: ../schemas/error.yaml - - $ref: ../schemas/multiple_errors.yaml + - $ref: ../schemas/Error.yaml + - $ref: ../schemas/MultipleErrors.yaml examples: not_allowed: $ref: ../examples/not_allowed_error.yaml invalid_data: $ref: ../examples/invalid_data_error.yaml - multiple_errors: + MultipleErrors: $ref: ../examples/multiple_errors.yaml diff --git a/docs/api/store/components/responses/500_error.yaml b/docs/api/store/components/responses/500_error.yaml index ecb2e70917..5da1a171e5 100644 --- a/docs/api/store/components/responses/500_error.yaml +++ b/docs/api/store/components/responses/500_error.yaml @@ -2,7 +2,7 @@ description: Server Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml examples: database: $ref: ../examples/database_error.yaml diff --git a/docs/api/store/components/responses/default_error.yaml b/docs/api/store/components/responses/default_error.yaml index b7d6911d9d..5591502a6c 100644 --- a/docs/api/store/components/responses/default_error.yaml +++ b/docs/api/store/components/responses/default_error.yaml @@ -2,7 +2,7 @@ description: Default Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: unknown_error message: An unknown error occurred. diff --git a/docs/api/store/components/responses/invalid_request_error.yaml b/docs/api/store/components/responses/invalid_request_error.yaml index 4050c5fc89..c70a32b01f 100644 --- a/docs/api/store/components/responses/invalid_request_error.yaml +++ b/docs/api/store/components/responses/invalid_request_error.yaml @@ -2,7 +2,7 @@ description: Invalid Request Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: invalid_request_error message: Discount with code TEST already exists. diff --git a/docs/api/store/components/responses/invalid_state_error.yaml b/docs/api/store/components/responses/invalid_state_error.yaml index fbbf916749..479206bab5 100644 --- a/docs/api/store/components/responses/invalid_state_error.yaml +++ b/docs/api/store/components/responses/invalid_state_error.yaml @@ -2,7 +2,7 @@ description: Invalid State Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: code: unknown_error message: >- diff --git a/docs/api/store/components/responses/not_found_error.yaml b/docs/api/store/components/responses/not_found_error.yaml index 667ae355c0..c6fea98d05 100644 --- a/docs/api/store/components/responses/not_found_error.yaml +++ b/docs/api/store/components/responses/not_found_error.yaml @@ -2,7 +2,7 @@ description: Not Found Error content: application/json: schema: - $ref: ../schemas/error.yaml + $ref: ../schemas/Error.yaml example: message: Entity with id 1 was not found type: not_found diff --git a/docs/api/store/components/schemas/address.yaml b/docs/api/store/components/schemas/Address.yaml similarity index 98% rename from docs/api/store/components/schemas/address.yaml rename to docs/api/store/components/schemas/Address.yaml index d39d1760ae..a69d410311 100644 --- a/docs/api/store/components/schemas/address.yaml +++ b/docs/api/store/components/schemas/Address.yaml @@ -1,6 +1,5 @@ title: Address description: An address. -x-resourceId: address type: object properties: id: diff --git a/docs/api/store/components/schemas/address_fields.yaml b/docs/api/store/components/schemas/AddressFields.yaml similarity index 98% rename from docs/api/store/components/schemas/address_fields.yaml rename to docs/api/store/components/schemas/AddressFields.yaml index 303b9d5ca9..6e4c4d6358 100644 --- a/docs/api/store/components/schemas/address_fields.yaml +++ b/docs/api/store/components/schemas/AddressFields.yaml @@ -1,6 +1,5 @@ title: Address Fields description: Address fields used when creating/updating an address. -x-resourceId: address type: object properties: company: diff --git a/docs/api/admin/components/schemas/batch_job.yaml b/docs/api/store/components/schemas/BatchJob.yaml similarity index 99% rename from docs/api/admin/components/schemas/batch_job.yaml rename to docs/api/store/components/schemas/BatchJob.yaml index c06c261ba5..92a81b4576 100644 --- a/docs/api/admin/components/schemas/batch_job.yaml +++ b/docs/api/store/components/schemas/BatchJob.yaml @@ -1,6 +1,5 @@ title: Batch Job description: A Batch Job. -x-resourceId: batch_job type: object required: - type diff --git a/docs/api/admin/components/schemas/cart.yaml b/docs/api/store/components/schemas/Cart.yaml similarity index 95% rename from docs/api/admin/components/schemas/cart.yaml rename to docs/api/store/components/schemas/Cart.yaml index de1d520a2d..aef4b274ff 100644 --- a/docs/api/admin/components/schemas/cart.yaml +++ b/docs/api/store/components/schemas/Cart.yaml @@ -1,6 +1,5 @@ title: Cart description: Represents a user cart -x-resourceId: cart type: object properties: id: @@ -17,19 +16,19 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_address_id: type: string description: The shipping address's ID example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml items: description: Available if the relation `items` is expanded. type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml region_id: type: string description: The region's ID @@ -58,24 +57,24 @@ properties: type: object payment_session: description: The selected payment session in the cart. - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payment_sessions: type: array description: The payment sessions created on the cart. items: - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payment_id: type: string description: The payment's ID if available example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: ./payment.yaml + $ref: ./Payment.yaml shipping_methods: type: array description: The shipping methods added to the cart. items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml type: type: string description: The cart's type. diff --git a/docs/api/store/components/schemas/claim_image.yaml b/docs/api/store/components/schemas/ClaimImage.yaml similarity index 97% rename from docs/api/store/components/schemas/claim_image.yaml rename to docs/api/store/components/schemas/ClaimImage.yaml index 783d89c06d..721cfcf6a5 100644 --- a/docs/api/store/components/schemas/claim_image.yaml +++ b/docs/api/store/components/schemas/ClaimImage.yaml @@ -1,6 +1,5 @@ title: Claim Image description: Represents photo documentation of a claim. -x-resourceId: claim_image type: object required: - claim_item_id diff --git a/docs/api/admin/components/schemas/claim_item.yaml b/docs/api/store/components/schemas/ClaimItem.yaml similarity index 95% rename from docs/api/admin/components/schemas/claim_item.yaml rename to docs/api/store/components/schemas/ClaimItem.yaml index cb7e85c9dd..6fc251960c 100644 --- a/docs/api/admin/components/schemas/claim_item.yaml +++ b/docs/api/store/components/schemas/ClaimItem.yaml @@ -2,7 +2,6 @@ title: Claim Item description: >- Represents a claimed item along with information about the reasons for the claim. -x-resourceId: claim_item type: object required: - claim_order_id @@ -19,7 +18,7 @@ properties: type: array description: Available if the relation `images` is expanded. items: - $ref: ./claim_image.yaml + $ref: ./ClaimImage.yaml claim_order_id: description: The ID of the claim this item is associated with. type: string @@ -32,7 +31,7 @@ properties: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml variant_id: description: The ID of the product variant that is claimed. type: string @@ -64,7 +63,7 @@ properties: relation 'tags' is expanded. type: array items: - $ref: ./claim_tag.yaml + $ref: ./ClaimTag.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/claim_order.yaml b/docs/api/store/components/schemas/ClaimOrder.yaml similarity index 95% rename from docs/api/admin/components/schemas/claim_order.yaml rename to docs/api/store/components/schemas/ClaimOrder.yaml index ed55db009d..561dbec67d 100644 --- a/docs/api/admin/components/schemas/claim_order.yaml +++ b/docs/api/store/components/schemas/ClaimOrder.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: claim_order type: object required: - type @@ -43,14 +42,14 @@ properties: description: The items that have been claimed type: array items: - $ref: ./claim_item.yaml + $ref: ./ClaimItem.yaml additional_items: description: >- Refers to the new items to be shipped when the claim order has the type `replace` type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml order_id: description: The ID of the order that the claim comes from. type: string @@ -69,17 +68,17 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer diff --git a/docs/api/admin/components/schemas/claim_tag.yaml b/docs/api/store/components/schemas/ClaimTag.yaml similarity index 97% rename from docs/api/admin/components/schemas/claim_tag.yaml rename to docs/api/store/components/schemas/ClaimTag.yaml index 46a23e4da8..bf557fcc6d 100644 --- a/docs/api/admin/components/schemas/claim_tag.yaml +++ b/docs/api/store/components/schemas/ClaimTag.yaml @@ -2,7 +2,6 @@ title: Claim Tag description: >- Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. -x-resourceId: claim_tag type: object required: - value diff --git a/docs/api/admin/components/schemas/country.yaml b/docs/api/store/components/schemas/Country.yaml similarity index 98% rename from docs/api/admin/components/schemas/country.yaml rename to docs/api/store/components/schemas/Country.yaml index d8a7a18e36..c28bb31871 100644 --- a/docs/api/admin/components/schemas/country.yaml +++ b/docs/api/store/components/schemas/Country.yaml @@ -1,6 +1,5 @@ title: Country description: Country details -x-resourceId: country type: object required: - iso_2 diff --git a/docs/api/store/components/schemas/currency.yaml b/docs/api/store/components/schemas/Currency.yaml similarity index 97% rename from docs/api/store/components/schemas/currency.yaml rename to docs/api/store/components/schemas/Currency.yaml index be164ffa9e..c553448ec2 100644 --- a/docs/api/store/components/schemas/currency.yaml +++ b/docs/api/store/components/schemas/Currency.yaml @@ -1,6 +1,5 @@ title: Currency description: Currency -x-resourceId: currency type: object required: - code diff --git a/docs/api/store/components/schemas/custom_shipping_option.yaml b/docs/api/store/components/schemas/CustomShippingOption.yaml similarity index 97% rename from docs/api/store/components/schemas/custom_shipping_option.yaml rename to docs/api/store/components/schemas/CustomShippingOption.yaml index 40ff8c8229..619df289c4 100644 --- a/docs/api/store/components/schemas/custom_shipping_option.yaml +++ b/docs/api/store/components/schemas/CustomShippingOption.yaml @@ -3,7 +3,6 @@ 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 -x-resourceId: custom_shipping_option type: object required: - price diff --git a/docs/api/admin/components/schemas/customer.yaml b/docs/api/store/components/schemas/Customer.yaml similarity index 94% rename from docs/api/admin/components/schemas/customer.yaml rename to docs/api/store/components/schemas/Customer.yaml index aa0e83a77c..9c91270354 100644 --- a/docs/api/admin/components/schemas/customer.yaml +++ b/docs/api/store/components/schemas/Customer.yaml @@ -1,6 +1,5 @@ title: Customer description: Represents a customer -x-resourceId: customer type: object required: - email @@ -27,12 +26,12 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. type: array items: - $ref: ./address.yaml + $ref: ./Address.yaml phone: type: string description: The customer's phone number @@ -53,7 +52,7 @@ properties: `groups` is expanded. type: array items: - $ref: ./customer_group.yaml + $ref: ./CustomerGroup.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/customer_group.yaml b/docs/api/store/components/schemas/CustomerGroup.yaml similarity index 95% rename from docs/api/admin/components/schemas/customer_group.yaml rename to docs/api/store/components/schemas/CustomerGroup.yaml index 0d4769c7ad..69e2edfe7c 100644 --- a/docs/api/admin/components/schemas/customer_group.yaml +++ b/docs/api/store/components/schemas/CustomerGroup.yaml @@ -1,6 +1,5 @@ title: Customer Group description: Represents a customer group -x-resourceId: customer_group type: object required: - name @@ -27,7 +26,7 @@ properties: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. items: - $ref: ./price_list.yaml + $ref: ./PriceList.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount.yaml b/docs/api/store/components/schemas/Discount.yaml similarity index 97% rename from docs/api/admin/components/schemas/discount.yaml rename to docs/api/store/components/schemas/Discount.yaml index 1950a503cb..72c9365c95 100644 --- a/docs/api/admin/components/schemas/discount.yaml +++ b/docs/api/store/components/schemas/Discount.yaml @@ -1,6 +1,5 @@ title: Discount description: Represents a discount that can be applied to a cart for promotional purposes. -x-resourceId: discount type: object required: - code @@ -28,7 +27,7 @@ properties: example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. - $ref: ./discount_rule.yaml + $ref: ./DiscountRule.yaml is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -43,7 +42,7 @@ properties: example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. - $ref: ./discount.yaml + $ref: ./Discount.yaml starts_at: description: The time at which the discount can be used. type: string diff --git a/docs/api/admin/components/schemas/discount_condition.yaml b/docs/api/store/components/schemas/DiscountCondition.yaml similarity index 97% rename from docs/api/admin/components/schemas/discount_condition.yaml rename to docs/api/store/components/schemas/DiscountCondition.yaml index 794e839eb3..40f5247a38 100644 --- a/docs/api/admin/components/schemas/discount_condition.yaml +++ b/docs/api/store/components/schemas/DiscountCondition.yaml @@ -1,6 +1,5 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable -x-resourceId: discount_condition type: object required: - type @@ -32,7 +31,7 @@ properties: example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. - $ref: ./discount_rule.yaml + $ref: ./DiscountRule.yaml products: description: >- products associated with this condition if type = products. Available if diff --git a/docs/api/store/components/schemas/discount_condition_customer_group.yaml b/docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml similarity index 89% rename from docs/api/store/components/schemas/discount_condition_customer_group.yaml rename to docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml index 51867349ad..143c2c2a50 100644 --- a/docs/api/store/components/schemas/discount_condition_customer_group.yaml +++ b/docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml @@ -1,6 +1,5 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group -x-resourceId: discount_condition_customer_group type: object required: - customer_group_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. - $ref: ./customer_group.yaml + $ref: ./CustomerGroup.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_condition_product.yaml b/docs/api/store/components/schemas/DiscountConditionProduct.yaml similarity index 90% rename from docs/api/store/components/schemas/discount_condition_product.yaml rename to docs/api/store/components/schemas/DiscountConditionProduct.yaml index b88eac53c2..ca1540fcbb 100644 --- a/docs/api/store/components/schemas/discount_condition_product.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProduct.yaml @@ -1,6 +1,5 @@ title: Product Discount Condition description: Associates a discount condition with a product -x-resourceId: discount_condition_product type: object required: - product_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. - $ref: ./product.yaml + $ref: ./Product.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_condition_product_collection.yaml b/docs/api/store/components/schemas/DiscountConditionProductCollection.yaml similarity index 89% rename from docs/api/admin/components/schemas/discount_condition_product_collection.yaml rename to docs/api/store/components/schemas/DiscountConditionProductCollection.yaml index bc0065ef9f..49e19e9590 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_collection.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProductCollection.yaml @@ -1,6 +1,5 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection -x-resourceId: discount_condition_product_collection type: object required: - product_collection_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. - $ref: ./product_collection.yaml + $ref: ./ProductCollection.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_condition_product_tag.yaml b/docs/api/store/components/schemas/DiscountConditionProductTag.yaml similarity index 90% rename from docs/api/admin/components/schemas/discount_condition_product_tag.yaml rename to docs/api/store/components/schemas/DiscountConditionProductTag.yaml index d3ba121f43..3b7c0738f0 100644 --- a/docs/api/admin/components/schemas/discount_condition_product_tag.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProductTag.yaml @@ -1,6 +1,5 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag -x-resourceId: discount_condition_product_tag type: object required: - product_tag_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. - $ref: ./product_tag.yaml + $ref: ./ProductTag.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/discount_condition_product_type.yaml b/docs/api/store/components/schemas/DiscountConditionProductType.yaml similarity index 90% rename from docs/api/store/components/schemas/discount_condition_product_type.yaml rename to docs/api/store/components/schemas/DiscountConditionProductType.yaml index 03a6393c44..471000a1e7 100644 --- a/docs/api/store/components/schemas/discount_condition_product_type.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProductType.yaml @@ -1,6 +1,5 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type -x-resourceId: discount_condition_product type: object required: - product_type_id @@ -16,10 +15,10 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. - $ref: ./discount_condition.yaml + $ref: ./DiscountCondition.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/discount_rule.yaml b/docs/api/store/components/schemas/DiscountRule.yaml similarity index 98% rename from docs/api/admin/components/schemas/discount_rule.yaml rename to docs/api/store/components/schemas/DiscountRule.yaml index ab6ab1a80e..1a6ec45afb 100644 --- a/docs/api/admin/components/schemas/discount_rule.yaml +++ b/docs/api/store/components/schemas/DiscountRule.yaml @@ -2,7 +2,6 @@ title: Discount Rule description: >- Holds the rules that governs how a Discount is calculated when applied to a Cart. -x-resourceId: discount_rule type: object required: - type diff --git a/docs/api/admin/components/schemas/draft-order.yaml b/docs/api/store/components/schemas/DraftOrder.yaml similarity index 98% rename from docs/api/admin/components/schemas/draft-order.yaml rename to docs/api/store/components/schemas/DraftOrder.yaml index 1c96c22bc7..5e18ec0f8f 100644 --- a/docs/api/admin/components/schemas/draft-order.yaml +++ b/docs/api/store/components/schemas/DraftOrder.yaml @@ -1,6 +1,5 @@ title: DraftOrder description: Represents a draft order -x-resourceId: draft-order type: object properties: id: diff --git a/docs/api/store/components/schemas/error.yaml b/docs/api/store/components/schemas/Error.yaml similarity index 93% rename from docs/api/store/components/schemas/error.yaml rename to docs/api/store/components/schemas/Error.yaml index cad9495918..787671c4a4 100644 --- a/docs/api/store/components/schemas/error.yaml +++ b/docs/api/store/components/schemas/Error.yaml @@ -1,5 +1,4 @@ title: Response Error -x-resourceId: error type: object properties: code: diff --git a/docs/api/store/components/schemas/fulfillment.yaml b/docs/api/store/components/schemas/Fulfillment.yaml similarity index 96% rename from docs/api/store/components/schemas/fulfillment.yaml rename to docs/api/store/components/schemas/Fulfillment.yaml index d6ee5c6960..0c34d6607b 100644 --- a/docs/api/store/components/schemas/fulfillment.yaml +++ b/docs/api/store/components/schemas/Fulfillment.yaml @@ -7,7 +7,6 @@ description: >- plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. -x-resourceId: fulfillment type: object required: - provider_id @@ -45,7 +44,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml items: description: >- The Fulfillment Items in the Fulfillment - these hold information about @@ -53,7 +52,7 @@ properties: `items` is expanded. type: array items: - $ref: ./fulfillment_item.yaml + $ref: ./FulfillmentItem.yaml tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -61,7 +60,7 @@ properties: Available if the relation `tracking_links` is expanded. type: array items: - $ref: ./tracking_link.yaml + $ref: ./TrackingLink.yaml tracking_numbers: deprecated: true description: >- diff --git a/docs/api/admin/components/schemas/fulfillment_item.yaml b/docs/api/store/components/schemas/FulfillmentItem.yaml similarity index 93% rename from docs/api/admin/components/schemas/fulfillment_item.yaml rename to docs/api/store/components/schemas/FulfillmentItem.yaml index f233f45f68..8578f6a4d7 100644 --- a/docs/api/admin/components/schemas/fulfillment_item.yaml +++ b/docs/api/store/components/schemas/FulfillmentItem.yaml @@ -2,7 +2,6 @@ title: Fulfillment Item description: >- Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. -x-resourceId: fulfillment_item type: object required: - fulfillment_id @@ -22,7 +21,7 @@ properties: type: object item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer diff --git a/docs/api/admin/components/schemas/fulfillment_provider.yaml b/docs/api/store/components/schemas/FulfillmentProvider.yaml similarity index 93% rename from docs/api/admin/components/schemas/fulfillment_provider.yaml rename to docs/api/store/components/schemas/FulfillmentProvider.yaml index 584c933111..bbd8801420 100644 --- a/docs/api/admin/components/schemas/fulfillment_provider.yaml +++ b/docs/api/store/components/schemas/FulfillmentProvider.yaml @@ -1,6 +1,5 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. -x-resourceId: fulfillment_provider type: object properties: id: diff --git a/docs/api/store/components/schemas/gift_card.yaml b/docs/api/store/components/schemas/GiftCard.yaml similarity index 94% rename from docs/api/store/components/schemas/gift_card.yaml rename to docs/api/store/components/schemas/GiftCard.yaml index 054f93319f..d169d35e54 100644 --- a/docs/api/store/components/schemas/gift_card.yaml +++ b/docs/api/store/components/schemas/GiftCard.yaml @@ -2,7 +2,6 @@ title: Gift Card description: >- Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. -x-resourceId: gift_card type: object required: - code @@ -52,6 +51,10 @@ properties: description: The time at which the Gift Card can no longer be used. type: string format: date-time + tax_rate: + description: The gift cards's tax rate that will be applied on calculating totals + type: number + example: 0 created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/gift_card_transaction.yaml b/docs/api/store/components/schemas/GiftCardTransaction.yaml similarity index 97% rename from docs/api/store/components/schemas/gift_card_transaction.yaml rename to docs/api/store/components/schemas/GiftCardTransaction.yaml index fb16341851..df738aa63b 100644 --- a/docs/api/store/components/schemas/gift_card_transaction.yaml +++ b/docs/api/store/components/schemas/GiftCardTransaction.yaml @@ -2,7 +2,6 @@ title: Gift Card Transaction description: >- Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order -x-resourceId: gift_card_transaction type: object required: - gift_card_id diff --git a/docs/api/admin/components/schemas/idempotency_key.yaml b/docs/api/store/components/schemas/IdempotencyKey.yaml similarity index 98% rename from docs/api/admin/components/schemas/idempotency_key.yaml rename to docs/api/store/components/schemas/IdempotencyKey.yaml index 9bff9c0f90..b496aadde3 100644 --- a/docs/api/admin/components/schemas/idempotency_key.yaml +++ b/docs/api/store/components/schemas/IdempotencyKey.yaml @@ -2,7 +2,6 @@ title: Idempotency Key description: >- Idempotency Key is used to continue a process in case of any failure that might occur. -x-resourceId: idempotency_key type: object required: - idempotency_key diff --git a/docs/api/store/components/schemas/image.yaml b/docs/api/store/components/schemas/Image.yaml similarity index 97% rename from docs/api/store/components/schemas/image.yaml rename to docs/api/store/components/schemas/Image.yaml index 61bc475c32..5250816766 100644 --- a/docs/api/store/components/schemas/image.yaml +++ b/docs/api/store/components/schemas/Image.yaml @@ -1,6 +1,5 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. -x-resourceId: image type: object required: - url diff --git a/docs/api/admin/components/schemas/invite.yaml b/docs/api/store/components/schemas/Invite.yaml similarity index 98% rename from docs/api/admin/components/schemas/invite.yaml rename to docs/api/store/components/schemas/Invite.yaml index aac3ce0b7f..9e16e818ea 100644 --- a/docs/api/admin/components/schemas/invite.yaml +++ b/docs/api/store/components/schemas/Invite.yaml @@ -1,6 +1,5 @@ title: Invite description: Represents an invite -x-resourceId: invite type: object required: - user_email diff --git a/docs/api/admin/components/schemas/line_item.yaml b/docs/api/store/components/schemas/LineItem.yaml similarity index 98% rename from docs/api/admin/components/schemas/line_item.yaml rename to docs/api/store/components/schemas/LineItem.yaml index ae9ed1eaa0..0e0c64de6f 100644 --- a/docs/api/admin/components/schemas/line_item.yaml +++ b/docs/api/store/components/schemas/LineItem.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: line_item type: object required: - title @@ -47,12 +46,12 @@ properties: description: Available if the relation `tax_lines` is expanded. type: array items: - $ref: ./line_item_tax_line.yaml + $ref: ./LineItemTaxLine.yaml adjustments: description: Available if the relation `adjustments` is expanded. type: array items: - $ref: ./line_item_adjustment.yaml + $ref: ./LineItemAdjustment.yaml title: description: >- The title of the Line Item, this should be easily identifiable by the diff --git a/docs/api/store/components/schemas/line_item_adjustment.yaml b/docs/api/store/components/schemas/LineItemAdjustment.yaml similarity index 87% rename from docs/api/store/components/schemas/line_item_adjustment.yaml rename to docs/api/store/components/schemas/LineItemAdjustment.yaml index 677f69388a..28b41b9566 100644 --- a/docs/api/store/components/schemas/line_item_adjustment.yaml +++ b/docs/api/store/components/schemas/LineItemAdjustment.yaml @@ -1,6 +1,5 @@ title: Line Item Adjustment -description: Represents an Line Item Adjustment -x-resourceId: line_item_adjustment +description: Represents a Line Item Adjustment type: object required: - item_id @@ -17,7 +16,7 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml description: type: string description: The line item's adjustment description @@ -28,7 +27,7 @@ properties: example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. - $ref: ./discount.yaml + $ref: ./Discount.yaml amount: type: number description: The adjustment amount diff --git a/docs/api/store/components/schemas/line_item_tax_line.yaml b/docs/api/store/components/schemas/LineItemTaxLine.yaml similarity index 90% rename from docs/api/store/components/schemas/line_item_tax_line.yaml rename to docs/api/store/components/schemas/LineItemTaxLine.yaml index b149f62d42..2ee2e0a546 100644 --- a/docs/api/store/components/schemas/line_item_tax_line.yaml +++ b/docs/api/store/components/schemas/LineItemTaxLine.yaml @@ -1,6 +1,5 @@ title: Line Item Tax Line -description: Represents an Line Item Tax Line -x-resourceId: line_item_tax_line +description: Represents a Line Item Tax Line type: object required: - item_id @@ -17,7 +16,7 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml code: description: A code to identify the tax type by type: string diff --git a/docs/api/store/components/schemas/money_amount.yaml b/docs/api/store/components/schemas/MoneyAmount.yaml similarity index 97% rename from docs/api/store/components/schemas/money_amount.yaml rename to docs/api/store/components/schemas/MoneyAmount.yaml index 929194a759..223ddf5f44 100644 --- a/docs/api/store/components/schemas/money_amount.yaml +++ b/docs/api/store/components/schemas/MoneyAmount.yaml @@ -5,7 +5,6 @@ description: >- 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. -x-resourceId: money_amount type: object required: - currency_code @@ -24,7 +23,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml amount: description: >- The amount in the smallest currecny unit (e.g. cents 100 cents to charge @@ -49,7 +48,7 @@ properties: example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: ./price_list.yaml + $ref: ./PriceList.yaml variant_id: description: The id of the Product Variant contained in the Line Item. type: string diff --git a/docs/api/admin/components/schemas/multiple_errors.yaml b/docs/api/store/components/schemas/MultipleErrors.yaml similarity index 82% rename from docs/api/admin/components/schemas/multiple_errors.yaml rename to docs/api/store/components/schemas/MultipleErrors.yaml index 0327c94e70..7ca18cda3b 100644 --- a/docs/api/admin/components/schemas/multiple_errors.yaml +++ b/docs/api/store/components/schemas/MultipleErrors.yaml @@ -1,12 +1,11 @@ title: Multiple Errors -x-resourceId: multiple_errors type: object properties: errors: type: array description: Array of errors items: - $ref: ./error.yaml + $ref: ./Error.yaml message: type: string default: >- diff --git a/docs/api/admin/components/schemas/note.yaml b/docs/api/store/components/schemas/Note.yaml similarity index 97% rename from docs/api/admin/components/schemas/note.yaml rename to docs/api/store/components/schemas/Note.yaml index 16f1e9fe50..2decb4f715 100644 --- a/docs/api/admin/components/schemas/note.yaml +++ b/docs/api/store/components/schemas/Note.yaml @@ -2,7 +2,6 @@ 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. -x-resourceId: note type: object required: - value @@ -31,7 +30,7 @@ properties: example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. - $ref: ./user.yaml + $ref: ./User.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/notification.yaml b/docs/api/store/components/schemas/Notification.yaml similarity index 95% rename from docs/api/admin/components/schemas/notification.yaml rename to docs/api/store/components/schemas/Notification.yaml index 9db10fe27a..ddc77a9c73 100644 --- a/docs/api/admin/components/schemas/notification.yaml +++ b/docs/api/store/components/schemas/Notification.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: notification type: object required: - resource_type @@ -50,14 +49,14 @@ properties: description: The resends that have been completed after the original Notification. type: array items: - $ref: ./notification_resend.yaml + $ref: ./NotificationResend.yaml provider_id: description: The id of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: ./notification_provider.yaml + $ref: ./NotificationProvider.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/notification_provider.yaml b/docs/api/store/components/schemas/NotificationProvider.yaml similarity index 93% rename from docs/api/store/components/schemas/notification_provider.yaml rename to docs/api/store/components/schemas/NotificationProvider.yaml index dacf80d189..fbc83c6837 100644 --- a/docs/api/store/components/schemas/notification_provider.yaml +++ b/docs/api/store/components/schemas/NotificationProvider.yaml @@ -1,6 +1,5 @@ title: Notification Provider description: Represents a notification provider plugin and holds its installation status. -x-resourceId: notification_provider type: object required: - id diff --git a/docs/api/admin/components/schemas/notification_resend.yaml b/docs/api/store/components/schemas/NotificationResend.yaml similarity index 95% rename from docs/api/admin/components/schemas/notification_resend.yaml rename to docs/api/store/components/schemas/NotificationResend.yaml index 2b15999aa6..cd88d291ae 100644 --- a/docs/api/admin/components/schemas/notification_resend.yaml +++ b/docs/api/store/components/schemas/NotificationResend.yaml @@ -1,6 +1,5 @@ title: Notification Resend description: A resend of a Notification. -x-resourceId: notification_resend type: object properties: id: @@ -44,14 +43,14 @@ properties: example: noti_01G53V9Y6CKMCGBM1P0X7C28RX parent_notification: description: Available if the relation `parent_notification` is expanded. - $ref: ./notification.yaml + $ref: ./Notification.yaml provider_id: description: The ID of the Notification Provider that handles the Notification. type: string example: sengrid provider: description: Available if the relation `provider` is expanded. - $ref: ./notification_provider.yaml + $ref: ./NotificationProvider.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/OAuth.yaml b/docs/api/store/components/schemas/OAuth.yaml index 6b6cb8b660..9f22524f3e 100644 --- a/docs/api/store/components/schemas/OAuth.yaml +++ b/docs/api/store/components/schemas/OAuth.yaml @@ -1,6 +1,5 @@ title: OAuth description: Represent an OAuth app -x-resourceId: OAuth type: object required: - id diff --git a/docs/api/admin/components/schemas/order.yaml b/docs/api/store/components/schemas/Order.yaml similarity index 96% rename from docs/api/admin/components/schemas/order.yaml rename to docs/api/store/components/schemas/Order.yaml index 464edc17fb..fbc5185c9b 100644 --- a/docs/api/admin/components/schemas/order.yaml +++ b/docs/api/store/components/schemas/Order.yaml @@ -1,6 +1,5 @@ title: Order description: Represents an order -x-resourceId: order type: object required: - customer_id @@ -76,14 +75,14 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml shipping_address_id: type: string description: The ID of the shipping address associated with the order example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml region_id: type: string description: The region's ID @@ -100,7 +99,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml tax_rate: description: The order's tax rate type: number @@ -127,21 +126,21 @@ properties: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml payments: type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: ./payment.yaml + $ref: ./Payment.yaml fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml returns: type: array description: >- @@ -187,21 +186,21 @@ properties: The line items that belong to the order. Available if the relation `items` is expanded. items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml edits: type: array description: >- [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: ./order_edit.yaml + $ref: ./OrderEdit.yaml gift_card_transactions: type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: - $ref: ./gift_card_transaction.yaml + $ref: ./GiftCardTransaction.yaml canceled_at: type: string description: The date the order was canceled on. diff --git a/docs/api/store/components/schemas/order_edit.yaml b/docs/api/store/components/schemas/OrderEdit.yaml similarity index 95% rename from docs/api/store/components/schemas/order_edit.yaml rename to docs/api/store/components/schemas/OrderEdit.yaml index 5574c2b6f2..ea53ce0b14 100644 --- a/docs/api/store/components/schemas/order_edit.yaml +++ b/docs/api/store/components/schemas/OrderEdit.yaml @@ -1,6 +1,5 @@ title: Order Edit description: Order edit keeps track of order items changes. -x-resourceId: order_edit type: object required: - order_id @@ -18,12 +17,12 @@ properties: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: ./order.yaml + $ref: ./Order.yaml changes: type: array description: Available if the relation `changes` is expanded. items: - $ref: ./order_item_change.yaml + $ref: ./OrderItemChange.yaml internal_note: description: An optional note with additional details about the order edit. type: string @@ -106,14 +105,14 @@ properties: type: array description: Available if the relation `items` is expanded. items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml payment_collection_id: type: string description: The ID of the payment collection example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. - $ref: ./payment_collection.yaml + $ref: ./PaymentCollection.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/order_item_change.yaml b/docs/api/store/components/schemas/OrderItemChange.yaml similarity index 93% rename from docs/api/admin/components/schemas/order_item_change.yaml rename to docs/api/store/components/schemas/OrderItemChange.yaml index 9bc3b3a826..49d0ecab5b 100644 --- a/docs/api/admin/components/schemas/order_item_change.yaml +++ b/docs/api/store/components/schemas/OrderItemChange.yaml @@ -1,6 +1,5 @@ title: Order Item Change description: Represents an order edit item change -x-resourceId: order_item_change type: object required: - type @@ -23,21 +22,21 @@ properties: example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: ./order_edit.yaml + $ref: ./OrderEdit.yaml original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/payment.yaml b/docs/api/store/components/schemas/Payment.yaml similarity index 98% rename from docs/api/admin/components/schemas/payment.yaml rename to docs/api/store/components/schemas/Payment.yaml index 384e04b16c..d224dca6cf 100644 --- a/docs/api/admin/components/schemas/payment.yaml +++ b/docs/api/store/components/schemas/Payment.yaml @@ -2,7 +2,6 @@ title: Payment description: >- Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. -x-resourceId: payment type: object required: - amount @@ -46,7 +45,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml amount_refunded: description: >- The amount of the original Payment amount that has been refunded back to diff --git a/docs/api/store/components/schemas/payment_collection.yaml b/docs/api/store/components/schemas/PaymentCollection.yaml similarity index 93% rename from docs/api/store/components/schemas/payment_collection.yaml rename to docs/api/store/components/schemas/PaymentCollection.yaml index 3f5663b39a..096abf613c 100644 --- a/docs/api/store/components/schemas/payment_collection.yaml +++ b/docs/api/store/components/schemas/PaymentCollection.yaml @@ -1,6 +1,5 @@ title: Payment Collection description: Payment Collection -x-resourceId: payment_collection type: object required: - type @@ -43,7 +42,7 @@ properties: example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. - $ref: ./region.yaml + $ref: ./Region.yaml currency_code: description: The 3 character ISO code for the currency. type: string @@ -53,17 +52,17 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml payment_sessions: type: array description: Available if the relation `payment_sessions` is expanded. items: - $ref: ./payment_session.yaml + $ref: ./PaymentSession.yaml payments: type: array description: Available if the relation `payments` is expanded. items: - $ref: ./payment.yaml + $ref: ./Payment.yaml created_by: type: string description: The ID of the user that created the payment collection. diff --git a/docs/api/admin/components/schemas/payment_provider.yaml b/docs/api/store/components/schemas/PaymentProvider.yaml similarity index 94% rename from docs/api/admin/components/schemas/payment_provider.yaml rename to docs/api/store/components/schemas/PaymentProvider.yaml index 081a6b7462..57cf719a28 100644 --- a/docs/api/admin/components/schemas/payment_provider.yaml +++ b/docs/api/store/components/schemas/PaymentProvider.yaml @@ -1,6 +1,5 @@ title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. -x-resourceId: payment_provider type: object required: - id diff --git a/docs/api/store/components/schemas/payment_session.yaml b/docs/api/store/components/schemas/PaymentSession.yaml similarity index 98% rename from docs/api/store/components/schemas/payment_session.yaml rename to docs/api/store/components/schemas/PaymentSession.yaml index ca8c513a26..3d7e87862b 100644 --- a/docs/api/store/components/schemas/payment_session.yaml +++ b/docs/api/store/components/schemas/PaymentSession.yaml @@ -6,7 +6,6 @@ description: >- with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. -x-resourceId: payment_session type: object required: - cart_id diff --git a/docs/api/store/components/schemas/price_list.yaml b/docs/api/store/components/schemas/PriceList.yaml similarity index 95% rename from docs/api/store/components/schemas/price_list.yaml rename to docs/api/store/components/schemas/PriceList.yaml index b774028314..6c1fc7de25 100644 --- a/docs/api/store/components/schemas/price_list.yaml +++ b/docs/api/store/components/schemas/PriceList.yaml @@ -2,7 +2,6 @@ title: Price List description: >- Price Lists represents a set of prices that overrides the default price for one or more product variants. -x-resourceId: price_list type: object required: - name @@ -57,8 +56,8 @@ properties: type: array items: oneOf: - - $ref: ./money_amount.yaml - - $ref: ./customer_group.yaml + - $ref: ./MoneyAmount.yaml + - $ref: ./CustomerGroup.yaml includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean diff --git a/docs/api/store/components/schemas/product.yaml b/docs/api/store/components/schemas/Product.yaml similarity index 96% rename from docs/api/store/components/schemas/product.yaml rename to docs/api/store/components/schemas/Product.yaml index e0116cc51d..5112dc072f 100644 --- a/docs/api/store/components/schemas/product.yaml +++ b/docs/api/store/components/schemas/Product.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: product type: object required: - title @@ -48,7 +47,7 @@ properties: description: Images of the Product. Available if the relation `images` is expanded. type: array items: - $ref: ./image.yaml + $ref: ./Image.yaml thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -60,7 +59,7 @@ properties: Available if the relation `options` is expanded. type: array items: - $ref: ./product_option.yaml + $ref: ./ProductOption.yaml variants: description: >- The Product Variants that belong to the Product. Each will have a unique @@ -68,7 +67,7 @@ properties: is expanded. type: array items: - $ref: ./product_variant.yaml + $ref: ./ProductVariant.yaml profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -78,7 +77,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: ./shipping_profile.yaml + $ref: ./ShippingProfile.yaml weight: description: >- The weight of the Product Variant. May be used in shipping rate @@ -144,14 +143,14 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml tags: description: >- The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: - $ref: ./product_tag.yaml + $ref: ./ProductTag.yaml discountable: description: >- Whether the Product can be discounted. Discounts will not apply to Line diff --git a/docs/api/admin/components/schemas/product_collection.yaml b/docs/api/store/components/schemas/ProductCollection.yaml similarity index 97% rename from docs/api/admin/components/schemas/product_collection.yaml rename to docs/api/store/components/schemas/ProductCollection.yaml index a3fd98cefb..0f215f050c 100644 --- a/docs/api/admin/components/schemas/product_collection.yaml +++ b/docs/api/store/components/schemas/ProductCollection.yaml @@ -1,6 +1,5 @@ title: Product Collection description: Product Collections represents a group of Products that are related. -x-resourceId: product_collection type: object required: - title diff --git a/docs/api/store/components/schemas/product_option.yaml b/docs/api/store/components/schemas/ProductOption.yaml similarity index 95% rename from docs/api/store/components/schemas/product_option.yaml rename to docs/api/store/components/schemas/ProductOption.yaml index aaaf0d58c1..0179d34d93 100644 --- a/docs/api/store/components/schemas/product_option.yaml +++ b/docs/api/store/components/schemas/ProductOption.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: product_option type: object required: - title @@ -23,7 +22,7 @@ properties: Available if the relation `values` is expanded. type: array items: - $ref: ./product_option_value.yaml + $ref: ./ProductOptionValue.yaml product_id: description: The ID of the Product that the Product Option is defined for. type: string diff --git a/docs/api/admin/components/schemas/product_option_value.yaml b/docs/api/store/components/schemas/ProductOptionValue.yaml similarity index 94% rename from docs/api/admin/components/schemas/product_option_value.yaml rename to docs/api/store/components/schemas/ProductOptionValue.yaml index 407e69a536..467e538803 100644 --- a/docs/api/admin/components/schemas/product_option_value.yaml +++ b/docs/api/store/components/schemas/ProductOptionValue.yaml @@ -2,7 +2,6 @@ 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. -x-resourceId: product_option_value type: object required: - value @@ -26,7 +25,7 @@ properties: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: ./product_option.yaml + $ref: ./ProductOption.yaml variant_id: description: >- The ID of the Product Variant that the Product Option Value is defined @@ -35,7 +34,7 @@ properties: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: ./product_variant.yaml + $ref: ./ProductVariant.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/product_tag.yaml b/docs/api/store/components/schemas/ProductTag.yaml similarity index 97% rename from docs/api/admin/components/schemas/product_tag.yaml rename to docs/api/store/components/schemas/ProductTag.yaml index 8240386ddf..615174509c 100644 --- a/docs/api/admin/components/schemas/product_tag.yaml +++ b/docs/api/store/components/schemas/ProductTag.yaml @@ -1,6 +1,5 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. -x-resourceId: product_tag type: object required: - value diff --git a/docs/api/store/components/schemas/product_tax_rate.yaml b/docs/api/store/components/schemas/ProductTaxRate.yaml similarity index 92% rename from docs/api/store/components/schemas/product_tax_rate.yaml rename to docs/api/store/components/schemas/ProductTaxRate.yaml index db175e899d..a179b64cdd 100644 --- a/docs/api/store/components/schemas/product_tax_rate.yaml +++ b/docs/api/store/components/schemas/ProductTaxRate.yaml @@ -2,7 +2,6 @@ title: Product Tax Rate description: >- Associates a tax rate with a product to indicate that the product is taxed in a certain way -x-resourceId: product_tax_rate type: object required: - product_id @@ -14,14 +13,14 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. - $ref: ./product.yaml + $ref: ./Product.yaml 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. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/product_type.yaml b/docs/api/store/components/schemas/ProductType.yaml similarity index 97% rename from docs/api/store/components/schemas/product_type.yaml rename to docs/api/store/components/schemas/ProductType.yaml index b6e06d4190..88555b5bf4 100644 --- a/docs/api/store/components/schemas/product_type.yaml +++ b/docs/api/store/components/schemas/ProductType.yaml @@ -1,6 +1,5 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. -x-resourceId: product_type type: object required: - value diff --git a/docs/api/store/components/schemas/product_type_tax_rate.yaml b/docs/api/store/components/schemas/ProductTypeTaxRate.yaml similarity index 91% rename from docs/api/store/components/schemas/product_type_tax_rate.yaml rename to docs/api/store/components/schemas/ProductTypeTaxRate.yaml index 48445a6b80..a11a7ba760 100644 --- a/docs/api/store/components/schemas/product_type_tax_rate.yaml +++ b/docs/api/store/components/schemas/ProductTypeTaxRate.yaml @@ -2,7 +2,6 @@ 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 -x-resourceId: product_type_tax_rate type: object required: - product_type_id @@ -14,14 +13,14 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. - $ref: ./product_type.yaml + $ref: ./ProductType.yaml 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. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/product_variant.yaml b/docs/api/store/components/schemas/ProductVariant.yaml similarity index 97% rename from docs/api/admin/components/schemas/product_variant.yaml rename to docs/api/store/components/schemas/ProductVariant.yaml index a0cb2eacc9..3079f7bb14 100644 --- a/docs/api/admin/components/schemas/product_variant.yaml +++ b/docs/api/store/components/schemas/ProductVariant.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: product_variant type: object required: - title @@ -34,7 +33,7 @@ properties: Available if the relation `prices` is expanded. type: array items: - $ref: ./money_amount.yaml + $ref: ./MoneyAmount.yaml sku: description: >- The unique stock keeping unit used to identify the Product Variant. This @@ -130,7 +129,7 @@ properties: the relation `options` is expanded. type: array items: - $ref: ./product_option_value.yaml + $ref: ./ProductOptionValue.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/product_variant_prices_fields.yaml b/docs/api/store/components/schemas/ProductVariantPricesFields.yaml similarity index 96% rename from docs/api/store/components/schemas/product_variant_prices_fields.yaml rename to docs/api/store/components/schemas/ProductVariantPricesFields.yaml index aee4659828..3bece0c504 100644 --- a/docs/api/store/components/schemas/product_variant_prices_fields.yaml +++ b/docs/api/store/components/schemas/ProductVariantPricesFields.yaml @@ -1,6 +1,5 @@ title: Product Variant Prices Fields description: Product Variants Prices Fields that are only available in some requests. -x-resourceId: product_variant_prices_fields type: object properties: original_price: diff --git a/docs/api/store/components/schemas/publishable_api_key.yaml b/docs/api/store/components/schemas/PublishableApiKey.yaml similarity index 97% rename from docs/api/store/components/schemas/publishable_api_key.yaml rename to docs/api/store/components/schemas/PublishableApiKey.yaml index 061b34b8c8..38818bccaf 100644 --- a/docs/api/store/components/schemas/publishable_api_key.yaml +++ b/docs/api/store/components/schemas/PublishableApiKey.yaml @@ -2,7 +2,6 @@ title: Publishable API key description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. -x-resourceId: publishable_api_key type: object properties: id: diff --git a/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml b/docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml similarity index 89% rename from docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml rename to docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml index d0ab55c29a..e2461daba5 100644 --- a/docs/api/admin/components/schemas/publishable_api_key_sales_channel.yaml +++ b/docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml @@ -1,6 +1,5 @@ title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels -x-resourceId: publishable_api_key_sales_channel type: object properties: sales_channel_id: diff --git a/docs/api/store/components/schemas/refund.yaml b/docs/api/store/components/schemas/Refund.yaml similarity index 98% rename from docs/api/store/components/schemas/refund.yaml rename to docs/api/store/components/schemas/Refund.yaml index fae6a881f3..936eb3842c 100644 --- a/docs/api/store/components/schemas/refund.yaml +++ b/docs/api/store/components/schemas/Refund.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: refund type: object required: - order_id diff --git a/docs/api/store/components/schemas/region.yaml b/docs/api/store/components/schemas/Region.yaml similarity index 93% rename from docs/api/store/components/schemas/region.yaml rename to docs/api/store/components/schemas/Region.yaml index 15b245b470..89b86870dc 100644 --- a/docs/api/store/components/schemas/region.yaml +++ b/docs/api/store/components/schemas/Region.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: region type: object required: - name @@ -30,7 +29,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml tax_rate: description: The tax rate that should be charged on purchases in the Region. type: number @@ -41,7 +40,7 @@ properties: `tax_rates` is expanded. type: array items: - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml tax_code: description: >- The tax code used on purchases in the Region. This may be used by other @@ -62,28 +61,28 @@ properties: `countries` is expanded. type: array items: - $ref: ./country.yaml + $ref: ./Country.yaml tax_provider_id: type: string description: The ID of the tax provider used in this region example: null tax_provider: description: Available if the relation `tax_provider` is expanded. - $ref: ./tax_provider.yaml + $ref: ./TaxProvider.yaml 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: ./payment_provider.yaml + $ref: ./PaymentProvider.yaml fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean diff --git a/docs/api/store/components/schemas/return.yaml b/docs/api/store/components/schemas/Return.yaml similarity index 97% rename from docs/api/store/components/schemas/return.yaml rename to docs/api/store/components/schemas/Return.yaml index 7ba545dcdc..406389b61d 100644 --- a/docs/api/store/components/schemas/return.yaml +++ b/docs/api/store/components/schemas/Return.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: return type: object required: - refund_amount @@ -27,7 +26,7 @@ properties: the relation `items` is expanded. type: array items: - $ref: ./return_item.yaml + $ref: ./ReturnItem.yaml swap_id: description: The ID of the Swap that the Return is a part of. type: string @@ -56,7 +55,7 @@ properties: the relation `shipping_method` is expanded. type: array items: - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml shipping_data: description: >- Data about the return shipment as provided by the Fulfilment Provider that diff --git a/docs/api/admin/components/schemas/return_item.yaml b/docs/api/store/components/schemas/ReturnItem.yaml similarity index 93% rename from docs/api/admin/components/schemas/return_item.yaml rename to docs/api/store/components/schemas/ReturnItem.yaml index 4ecc64bc8d..d56d8604a5 100644 --- a/docs/api/admin/components/schemas/return_item.yaml +++ b/docs/api/store/components/schemas/ReturnItem.yaml @@ -2,7 +2,6 @@ title: Return Item description: >- Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. -x-resourceId: return_item type: object required: - return_id @@ -14,14 +13,14 @@ properties: example: ret_01F0YET7XPCMF8RZ0Y151NZV2V return_order: description: Available if the relation `return_order` is expanded. - $ref: ./return.yaml + $ref: ./Return.yaml item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./line_item.yaml + $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -46,7 +45,7 @@ properties: example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml note: description: An optional note with additional details about the Return. type: string diff --git a/docs/api/admin/components/schemas/return_reason.yaml b/docs/api/store/components/schemas/ReturnReason.yaml similarity index 94% rename from docs/api/admin/components/schemas/return_reason.yaml rename to docs/api/store/components/schemas/ReturnReason.yaml index 2e4d4d83ef..ff9a50bf3f 100644 --- a/docs/api/admin/components/schemas/return_reason.yaml +++ b/docs/api/store/components/schemas/ReturnReason.yaml @@ -2,7 +2,6 @@ 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. -x-resourceId: return_reason type: object required: - value @@ -30,10 +29,10 @@ properties: example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: ./return_reason.yaml + $ref: ./ReturnReason.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/sales_channel.yaml b/docs/api/store/components/schemas/SalesChannel.yaml similarity index 97% rename from docs/api/admin/components/schemas/sales_channel.yaml rename to docs/api/store/components/schemas/SalesChannel.yaml index 7c4e1f2920..a79b3fd206 100644 --- a/docs/api/admin/components/schemas/sales_channel.yaml +++ b/docs/api/store/components/schemas/SalesChannel.yaml @@ -1,6 +1,5 @@ title: Sales Channel description: A Sales Channel -x-resourceId: sales_channel type: object required: - name diff --git a/docs/api/admin/components/schemas/shipping_method.yaml b/docs/api/store/components/schemas/ShippingMethod.yaml similarity index 96% rename from docs/api/admin/components/schemas/shipping_method.yaml rename to docs/api/store/components/schemas/ShippingMethod.yaml index 4ac18c8e93..9ac6b87cc6 100644 --- a/docs/api/admin/components/schemas/shipping_method.yaml +++ b/docs/api/store/components/schemas/ShippingMethod.yaml @@ -4,7 +4,6 @@ description: >- 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. -x-resourceId: shipping_method type: object required: - shipping_option_id @@ -20,7 +19,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -60,7 +59,7 @@ properties: type: array description: Available if the relation `tax_lines` is expanded. items: - $ref: ./shipping_method_tax_line.yaml + $ref: ./ShippingMethodTaxLine.yaml price: description: >- The amount to charge for the Shipping Method. The currency of the price is diff --git a/docs/api/store/components/schemas/shipping_method_tax_line.yaml b/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml similarity index 94% rename from docs/api/store/components/schemas/shipping_method_tax_line.yaml rename to docs/api/store/components/schemas/ShippingMethodTaxLine.yaml index 3387bfbfe2..1089796789 100644 --- a/docs/api/store/components/schemas/shipping_method_tax_line.yaml +++ b/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml @@ -1,6 +1,5 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line -x-resourceId: shipping_method_tax_line type: object required: - shipping_method_id @@ -17,7 +16,7 @@ properties: example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_method: description: Available if the relation `shipping_method` is expanded. - $ref: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml code: description: A code to identify the tax type by type: string diff --git a/docs/api/store/components/schemas/shipping_option.yaml b/docs/api/store/components/schemas/ShippingOption.yaml similarity index 95% rename from docs/api/store/components/schemas/shipping_option.yaml rename to docs/api/store/components/schemas/ShippingOption.yaml index a0e1c6538a..0efbef070c 100644 --- a/docs/api/store/components/schemas/shipping_option.yaml +++ b/docs/api/store/components/schemas/ShippingOption.yaml @@ -6,7 +6,6 @@ description: >- 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. -x-resourceId: shipping_option type: object required: - name @@ -41,7 +40,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. - $ref: ./shipping_profile.yaml + $ref: ./ShippingProfile.yaml provider_id: description: >- The id of the Fulfillment Provider, that will be used to process @@ -50,7 +49,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. - $ref: ./fulfillment_provider.yaml + $ref: ./FulfillmentProvider.yaml price_type: description: >- The type of pricing calculation that is used when creatin Shipping Methods @@ -78,7 +77,7 @@ properties: expanded. type: array items: - $ref: ./shipping_option_requirement.yaml + $ref: ./ShippingOptionRequirement.yaml data: description: >- The data needed for the Fulfillment Provider to identify the Shipping diff --git a/docs/api/admin/components/schemas/shipping_option_requirement.yaml b/docs/api/store/components/schemas/ShippingOptionRequirement.yaml similarity index 94% rename from docs/api/admin/components/schemas/shipping_option_requirement.yaml rename to docs/api/store/components/schemas/ShippingOptionRequirement.yaml index 57d9719312..bebafda0ea 100644 --- a/docs/api/admin/components/schemas/shipping_option_requirement.yaml +++ b/docs/api/store/components/schemas/ShippingOptionRequirement.yaml @@ -2,7 +2,6 @@ title: Shipping Option Requirement description: >- A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. -x-resourceId: shipping_option_requirement type: object required: - shipping_option_id @@ -21,7 +20,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml type: description: >- The type of the requirement, this defines how the value will be compared diff --git a/docs/api/admin/components/schemas/shipping_profile.yaml b/docs/api/store/components/schemas/ShippingProfile.yaml similarity index 96% rename from docs/api/admin/components/schemas/shipping_profile.yaml rename to docs/api/store/components/schemas/ShippingProfile.yaml index ba479ece92..0afd646078 100644 --- a/docs/api/admin/components/schemas/shipping_profile.yaml +++ b/docs/api/store/components/schemas/ShippingProfile.yaml @@ -2,7 +2,6 @@ title: Shipping Profile description: >- Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. -x-resourceId: shipping_profile type: object required: - name @@ -43,7 +42,7 @@ properties: expanded. type: array items: - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/shipping_tax_rate.yaml b/docs/api/store/components/schemas/ShippingTaxRate.yaml similarity index 91% rename from docs/api/admin/components/schemas/shipping_tax_rate.yaml rename to docs/api/store/components/schemas/ShippingTaxRate.yaml index 30058a09af..7ab7938fb0 100644 --- a/docs/api/admin/components/schemas/shipping_tax_rate.yaml +++ b/docs/api/store/components/schemas/ShippingTaxRate.yaml @@ -2,7 +2,6 @@ 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 -x-resourceId: shipping_tax_rate type: object required: - shipping_option_id @@ -14,14 +13,14 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./shipping_option.yaml + $ref: ./ShippingOption.yaml 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. - $ref: ./tax_rate.yaml + $ref: ./TaxRate.yaml created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/staged_job.yaml b/docs/api/store/components/schemas/StagedJob.yaml similarity index 93% rename from docs/api/store/components/schemas/staged_job.yaml rename to docs/api/store/components/schemas/StagedJob.yaml index 055ceaee0e..a31192dbdc 100644 --- a/docs/api/store/components/schemas/staged_job.yaml +++ b/docs/api/store/components/schemas/StagedJob.yaml @@ -1,6 +1,5 @@ title: Staged Job description: A staged job resource -x-resourceId: staged_job type: object required: - event_name diff --git a/docs/api/admin/components/schemas/store.yaml b/docs/api/store/components/schemas/Store.yaml similarity index 96% rename from docs/api/admin/components/schemas/store.yaml rename to docs/api/store/components/schemas/Store.yaml index 98b90e81f4..d96015e522 100644 --- a/docs/api/admin/components/schemas/store.yaml +++ b/docs/api/store/components/schemas/Store.yaml @@ -1,6 +1,5 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. -x-resourceId: store type: object properties: id: @@ -20,14 +19,14 @@ properties: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. - $ref: ./currency.yaml + $ref: ./Currency.yaml currencies: description: >- The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. type: array items: - $ref: ./currency.yaml + $ref: ./Currency.yaml swap_link_template: description: >- A template to generate Swap links from. Use {{cart_id}} to include the diff --git a/docs/api/store/components/schemas/StorePaymentCollectionSessionsReq.yaml b/docs/api/store/components/schemas/StorePaymentCollectionSessionsReq.yaml new file mode 100644 index 0000000000..121bde5095 --- /dev/null +++ b/docs/api/store/components/schemas/StorePaymentCollectionSessionsReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - provider_id +properties: + provider_id: + type: string + description: The ID of the Payment Provider. diff --git a/docs/api/store/components/schemas/StorePostCartReq.yaml b/docs/api/store/components/schemas/StorePostCartReq.yaml new file mode 100644 index 0000000000..e403744a2b --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCartReq.yaml @@ -0,0 +1,39 @@ +type: object +properties: + region_id: + type: string + description: The ID of the Region to create the Cart in. + sales_channel_id: + type: string + description: '[EXPERIMENTAL] The ID of the Sales channel to create the Cart in.' + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + items: + description: >- + An optional array of `variant_id`, `quantity` pairs to generate Line Items + from. + type: array + items: + required: + - variant_id + - quantity + properties: + variant_id: + description: The id of the Product Variant to generate a Line Item from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: >- + An optional object to provide context to the Cart. The `context` field is + automatically populated with `ip` and `user_agent` + type: object + example: + ip: '::1' + user_agent: Chrome diff --git a/docs/api/store/components/schemas/StorePostCartsCartReq.yaml b/docs/api/store/components/schemas/StorePostCartsCartReq.yaml new file mode 100644 index 0000000000..1a3f876ecd --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCartsCartReq.yaml @@ -0,0 +1,62 @@ +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: ./Address.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 + description: A full shipping address object. + - type: string + description: The shipping address ID + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Gift Card is identified by. + type: string + discounts: + description: An array of Discount codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The ID of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. + type: object + example: + ip: '::1' + user_agent: Chrome diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml new file mode 100644 index 0000000000..6bfeab6613 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - token +properties: + token: + description: The invite token provided by the admin. + type: string diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml new file mode 100644 index 0000000000..dffdfc21c3 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml @@ -0,0 +1,2 @@ +anyOf: + - $ref: ./AddressFields.yaml diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml new file mode 100644 index 0000000000..8f4dcf9c92 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerAddressesReq.yaml @@ -0,0 +1,16 @@ +type: object +required: + - address +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 diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml new file mode 100644 index 0000000000..d9787d6b58 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - order_ids +properties: + order_ids: + description: The ids of the orders to claim + type: array + items: + type: string diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml new file mode 100644 index 0000000000..fad16b2e72 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml @@ -0,0 +1,8 @@ +type: object +required: + - email +properties: + email: + description: The email of the customer. + type: string + format: email diff --git a/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml b/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml new file mode 100644 index 0000000000..1579b30340 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersCustomerReq.yaml @@ -0,0 +1,27 @@ +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: ./AddressFields.yaml + 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 diff --git a/docs/api/store/components/schemas/StorePostCustomersReq.yaml b/docs/api/store/components/schemas/StorePostCustomersReq.yaml new file mode 100644 index 0000000000..3504e00533 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersReq.yaml @@ -0,0 +1,24 @@ +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 diff --git a/docs/api/store/components/schemas/StorePostCustomersResetPasswordReq.yaml b/docs/api/store/components/schemas/StorePostCustomersResetPasswordReq.yaml new file mode 100644 index 0000000000..e41c6ff8b0 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCustomersResetPasswordReq.yaml @@ -0,0 +1,17 @@ +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 diff --git a/docs/api/store/components/schemas/StorePostOrderEditsOrderEditDecline.yaml b/docs/api/store/components/schemas/StorePostOrderEditsOrderEditDecline.yaml new file mode 100644 index 0000000000..c6d23fec71 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostOrderEditsOrderEditDecline.yaml @@ -0,0 +1,5 @@ +type: object +properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. diff --git a/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml new file mode 100644 index 0000000000..fd8d3fa660 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml @@ -0,0 +1,9 @@ +type: object +required: + - session_ids +properties: + session_ids: + description: List of Payment Session IDs to authorize. + type: array + items: + type: string diff --git a/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml new file mode 100644 index 0000000000..b7db27a304 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml @@ -0,0 +1,24 @@ +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: + 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. diff --git a/docs/api/store/components/schemas/StorePostReturnsReq.yaml b/docs/api/store/components/schemas/StorePostReturnsReq.yaml new file mode 100644 index 0000000000..fe17ff6931 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostReturnsReq.yaml @@ -0,0 +1,40 @@ +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: + 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. diff --git a/docs/api/store/components/schemas/StorePostSwapsReq.yaml b/docs/api/store/components/schemas/StorePostSwapsReq.yaml new file mode 100644 index 0000000000..3a246b86e2 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostSwapsReq.yaml @@ -0,0 +1,46 @@ +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: + 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: + 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 diff --git a/docs/api/store/components/schemas/swap.yaml b/docs/api/store/components/schemas/Swap.yaml similarity index 96% rename from docs/api/store/components/schemas/swap.yaml rename to docs/api/store/components/schemas/Swap.yaml index 31694ff199..d5a43a79d8 100644 --- a/docs/api/store/components/schemas/swap.yaml +++ b/docs/api/store/components/schemas/Swap.yaml @@ -7,7 +7,6 @@ description: >- 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. -x-resourceId: swap type: object required: - fulfillment_status @@ -57,7 +56,7 @@ properties: `additional_items` is expanded. type: array items: - $ref: ./line_item.yaml + $ref: ./LineItem.yaml return_order: description: >- A return order object. The Return that is issued for the return part of @@ -69,13 +68,13 @@ properties: relation `fulfillments` is expanded. type: array items: - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml 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. - $ref: ./payment.yaml + $ref: ./Payment.yaml difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May be @@ -91,14 +90,14 @@ properties: example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. - $ref: ./address.yaml + $ref: ./Address.yaml 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: ./shipping_method.yaml + $ref: ./ShippingMethod.yaml cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string diff --git a/docs/api/admin/components/schemas/tax_line.yaml b/docs/api/store/components/schemas/TaxLine.yaml similarity index 97% rename from docs/api/admin/components/schemas/tax_line.yaml rename to docs/api/store/components/schemas/TaxLine.yaml index 3faaf02eb7..3300d86797 100644 --- a/docs/api/admin/components/schemas/tax_line.yaml +++ b/docs/api/store/components/schemas/TaxLine.yaml @@ -1,6 +1,5 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. -x-resourceId: tax_line type: object required: - rate diff --git a/docs/api/admin/components/schemas/tax_provider.yaml b/docs/api/store/components/schemas/TaxProvider.yaml similarity index 94% rename from docs/api/admin/components/schemas/tax_provider.yaml rename to docs/api/store/components/schemas/TaxProvider.yaml index 7f53c424a5..dc2b7ef07e 100644 --- a/docs/api/admin/components/schemas/tax_provider.yaml +++ b/docs/api/store/components/schemas/TaxProvider.yaml @@ -1,6 +1,5 @@ title: Tax Provider description: The tax service used to calculate taxes -x-resourceId: tax_provider type: object properties: id: diff --git a/docs/api/admin/components/schemas/tax_rate.yaml b/docs/api/store/components/schemas/TaxRate.yaml similarity index 98% rename from docs/api/admin/components/schemas/tax_rate.yaml rename to docs/api/store/components/schemas/TaxRate.yaml index cbe718652e..48ff10fd0c 100644 --- a/docs/api/admin/components/schemas/tax_rate.yaml +++ b/docs/api/store/components/schemas/TaxRate.yaml @@ -2,7 +2,6 @@ title: Tax Rate description: >- A Tax Rate can be used to associate a certain rate to charge on products within a given Region -x-resourceId: line_item type: object required: - name diff --git a/docs/api/admin/components/schemas/tracking_link.yaml b/docs/api/store/components/schemas/TrackingLink.yaml similarity index 96% rename from docs/api/admin/components/schemas/tracking_link.yaml rename to docs/api/store/components/schemas/TrackingLink.yaml index 25867d8a97..85a7f696e7 100644 --- a/docs/api/admin/components/schemas/tracking_link.yaml +++ b/docs/api/store/components/schemas/TrackingLink.yaml @@ -3,7 +3,6 @@ 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. -x-resourceId: tracking_link type: object required: - tracking_number @@ -27,7 +26,7 @@ properties: example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: ./fulfillment.yaml + $ref: ./Fulfillment.yaml idempotency_key: type: string description: >- diff --git a/docs/api/store/components/schemas/user.yaml b/docs/api/store/components/schemas/User.yaml similarity index 98% rename from docs/api/store/components/schemas/user.yaml rename to docs/api/store/components/schemas/User.yaml index 042cd46cb2..c35e299a8f 100644 --- a/docs/api/store/components/schemas/user.yaml +++ b/docs/api/store/components/schemas/User.yaml @@ -1,6 +1,5 @@ title: User description: Represents a User who can manage store settings. -x-resourceId: user type: object required: - email diff --git a/docs/api/store/openapi.yaml b/docs/api/store/openapi.yaml index 791c72fb6a..cee6d7286e 100644 --- a/docs/api/store/openapi.yaml +++ b/docs/api/store/openapi.yaml @@ -108,40 +108,28 @@ tags: sessions. - name: Cart description: Cart endpoints that allow handling carts in Medusa. - x-resourceId: cart - name: Collection description: Collection endpoints that allow handling collections in Medusa. - x-resourceId: product_collection - name: Customer description: Customer endpoints that allow handling customers in Medusa. - x-resourceId: customer - name: Gift Card description: Gift Card endpoints that allow handling gift cards in Medusa. - x-resourceId: gift_card - name: Order description: Order endpoints that allow handling orders in Medusa. - x-resourceId: order - name: Product description: Product endpoints that allow handling products in Medusa. - x-resourceId: product - name: Product Variant description: Product Variant endpoints that allow handling product variants in Medusa. - x-resourceId: product_variant - name: Region description: Region endpoints that allow handling regions in Medusa. - x-resourceId: region - name: Return Reason description: Return Reason endpoints that allow handling return reasons in Medusa. - x-resourceId: return_reason - name: Return description: Return endpoints that allow handling returns in Medusa. - x-resourceId: return - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - x-resourceId: shipping_option - name: Swap description: Swap endpoints that allow handling swaps in Medusa. - x-resourceId: swap servers: - url: https://api.medusa-commerce.com/store paths: @@ -175,8 +163,6 @@ paths: $ref: paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml /carts/{id}/payment-session: $ref: paths/carts_{id}_payment-session.yaml - /gift-cards/{code}: - $ref: paths/gift-cards_{code}.yaml /customers/me/addresses: $ref: paths/customers_me_addresses.yaml /customers: @@ -193,6 +179,24 @@ paths: $ref: paths/customers_password-token.yaml /customers/password-reset: $ref: paths/customers_password-reset.yaml + /gift-cards/{code}: + $ref: paths/gift-cards_{code}.yaml + /order-edits/{id}/complete: + $ref: paths/order-edits_{id}_complete.yaml + /order-edits/{id}/decline: + $ref: paths/order-edits_{id}_decline.yaml + /order-edits/{id}: + $ref: paths/order-edits_{id}.yaml + /orders/customer/confirm: + $ref: paths/orders_customer_confirm.yaml + /orders/cart/{cart_id}: + $ref: paths/orders_cart_{cart_id}.yaml + /orders/{id}: + $ref: paths/orders_{id}.yaml + /orders: + $ref: paths/orders.yaml + /orders/batch/customer/token: + $ref: paths/orders_batch_customer_token.yaml /payment-collections/{id}/sessions/batch/authorize: $ref: paths/payment-collections_{id}_sessions_batch_authorize.yaml /payment-collections/{id}/sessions/{session_id}/authorize: @@ -205,22 +209,6 @@ paths: $ref: paths/payment-collections_{id}_sessions.yaml /payment-collections/{id}/sessions/{session_id}: $ref: paths/payment-collections_{id}_sessions_{session_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 - /order-edits/{id}/complete: - $ref: paths/order-edits_{id}_complete.yaml - /order-edits/{id}/decline: - $ref: paths/order-edits_{id}_decline.yaml - /order-edits/{id}: - $ref: paths/order-edits_{id}.yaml /product-types: $ref: paths/product-types.yaml /products/{id}: diff --git a/docs/api/store/paths/auth.yaml b/docs/api/store/paths/auth.yaml index 7b6fdd2ea1..4fca42845f 100644 --- a/docs/api/store/paths/auth.yaml +++ b/docs/api/store/paths/auth.yaml @@ -25,7 +25,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -109,7 +109,7 @@ get: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/carts.yaml b/docs/api/store/paths/carts.yaml index b11e8871e8..da3f3d7945 100644 --- a/docs/api/store/paths/carts.yaml +++ b/docs/api/store/paths/carts.yaml @@ -10,49 +10,7 @@ post: content: application/json: schema: - type: object - properties: - region_id: - type: string - description: The ID of the Region to create the Cart in. - sales_channel_id: - type: string - description: >- - [EXPERIMENTAL] The ID of the Sales channel to create the Cart - in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - items: - description: >- - An optional array of `variant_id`, `quantity` pairs to generate - Line Items from. - type: array - items: - required: - - variant_id - - quantity - properties: - variant_id: - description: >- - The id of the Product Variant to generate a Line Item - from. - type: string - quantity: - description: The quantity of the Product Variant to add - type: integer - context: - description: >- - An optional object to provide context to the Cart. The `context` - field is automatically populated with `ip` and `user_agent` - type: object - example: - ip: '::1' - user_agent: Chrome + $ref: ../components/schemas/StorePostCartReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -73,7 +31,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}.yaml b/docs/api/store/paths/carts_{id}.yaml index 760c22fda0..b051075749 100644 --- a/docs/api/store/paths/carts_{id}.yaml +++ b/docs/api/store/paths/carts_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': @@ -55,68 +55,7 @@ post: content: application/json: schema: - type: object - properties: - region_id: - type: string - description: The id of the Region to create the Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements - description: See a list of codes. - email: - type: string - description: An email to be used on the Cart. - format: email - sales_channel_id: - type: string - description: The ID of the Sales channel to update the Cart with. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: ../components/schemas/address.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: ../components/schemas/address.yaml - description: A full shipping address object. - - type: string - description: The shipping address ID - gift_cards: - description: An array of Gift Card codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Gift Card is identified by. - type: string - discounts: - description: An array of Discount codes to add to the Cart. - type: array - items: - required: - - code - properties: - code: - description: The code that a Discount is identifed by. - type: string - customer_id: - description: The ID of the Customer to associate the Cart with. - type: string - context: - description: An optional object to provide context to the Cart. - type: object - example: - ip: '::1' - user_agent: Chrome + $ref: ../components/schemas/StorePostCartsCartReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -137,7 +76,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_complete.yaml b/docs/api/store/paths/carts_{id}_complete.yaml index 4baa7467ee..606ec78757 100644 --- a/docs/api/store/paths/carts_{id}_complete.yaml +++ b/docs/api/store/paths/carts_{id}_complete.yaml @@ -57,21 +57,21 @@ post: successfully. properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml - type: object description: >- Cart was successfully authorized but requires further actions. properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml - type: object description: >- When cart is used for a swap and it has been completed successfully. properties: cart: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml index 2dd270334a..c67f1e73e9 100644 --- a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml +++ b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml @@ -35,7 +35,7 @@ delete: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_line-items.yaml b/docs/api/store/paths/carts_{id}_line-items.yaml index 4bee2a8f96..f8fd4e999c 100644 --- a/docs/api/store/paths/carts_{id}_line-items.yaml +++ b/docs/api/store/paths/carts_{id}_line-items.yaml @@ -29,7 +29,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml index f33aaa5f89..f93ec459e5 100644 --- a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml +++ b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml @@ -36,7 +36,7 @@ delete: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': @@ -85,7 +85,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_payment-session.yaml b/docs/api/store/paths/carts_{id}_payment-session.yaml index f9d6a4167a..0e1f181270 100644 --- a/docs/api/store/paths/carts_{id}_payment-session.yaml +++ b/docs/api/store/paths/carts_{id}_payment-session.yaml @@ -31,7 +31,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_payment-sessions.yaml b/docs/api/store/paths/carts_{id}_payment-sessions.yaml index 6a6aa6dd63..c8ab8f1845 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions.yaml @@ -31,7 +31,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml index 393b320eed..b0d6b0d8b1 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml @@ -39,7 +39,7 @@ delete: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': @@ -89,7 +89,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml index cabc2984bc..dbd9dfc2d4 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml @@ -41,7 +41,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_shipping-methods.yaml b/docs/api/store/paths/carts_{id}_shipping-methods.yaml index 0ddffc8c5a..23ae878a7b 100644 --- a/docs/api/store/paths/carts_{id}_shipping-methods.yaml +++ b/docs/api/store/paths/carts_{id}_shipping-methods.yaml @@ -29,7 +29,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/carts_{id}_taxes.yaml b/docs/api/store/paths/carts_{id}_taxes.yaml index 46a0cb4500..26ac7abf68 100644 --- a/docs/api/store/paths/carts_{id}_taxes.yaml +++ b/docs/api/store/paths/carts_{id}_taxes.yaml @@ -27,7 +27,7 @@ post: type: object properties: cart: - $ref: ../components/schemas/cart.yaml + $ref: ../components/schemas/Cart.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/collections.yaml b/docs/api/store/paths/collections.yaml index 19187417c3..33b779fcbc 100644 --- a/docs/api/store/paths/collections.yaml +++ b/docs/api/store/paths/collections.yaml @@ -83,7 +83,7 @@ get: collections: type: array items: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store/paths/collections_{id}.yaml b/docs/api/store/paths/collections_{id}.yaml index ff523113e4..160582a68a 100644 --- a/docs/api/store/paths/collections_{id}.yaml +++ b/docs/api/store/paths/collections_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: collection: - $ref: ../components/schemas/product_collection.yaml + $ref: ../components/schemas/ProductCollection.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/customers.yaml b/docs/api/store/paths/customers.yaml index 370c6e6928..f7b1f5a5e6 100644 --- a/docs/api/store/paths/customers.yaml +++ b/docs/api/store/paths/customers.yaml @@ -6,30 +6,7 @@ post: content: application/json: schema: - type: object - required: - - first_name - - last_name - - email - - password - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - phone: - description: The Customer's phone number. - type: string + $ref: ../components/schemas/StorePostCustomersReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -50,7 +27,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/customers_me.yaml b/docs/api/store/paths/customers_me.yaml index 5dfbcc2e8d..3f0885e0f9 100644 --- a/docs/api/store/paths/customers_me.yaml +++ b/docs/api/store/paths/customers_me.yaml @@ -27,7 +27,7 @@ get: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -49,33 +49,7 @@ post: content: application/json: schema: - type: object - properties: - first_name: - description: The Customer's first name. - type: string - last_name: - description: The Customer's last name. - type: string - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: ../components/schemas/address_fields.yaml - 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 + $ref: ../components/schemas/StorePostCustomersCustomerReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -98,7 +72,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/customers_me_addresses.yaml b/docs/api/store/paths/customers_me_addresses.yaml index e31fb66186..2c1b636fff 100644 --- a/docs/api/store/paths/customers_me_addresses.yaml +++ b/docs/api/store/paths/customers_me_addresses.yaml @@ -7,22 +7,7 @@ post: content: application/json: schema: - type: object - required: - - address - properties: - address: - description: The Address to add to the Customer. - allOf: - - $ref: ../components/schemas/address_fields.yaml - - type: object - required: - - first_name - - last_name - - address_1 - - city - - country_code - - postal_code + $ref: ../components/schemas/StorePostCustomersCustomerAddressesReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +30,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml index 0434b866da..ae74204d04 100644 --- a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml +++ b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml @@ -34,7 +34,7 @@ delete: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -63,8 +63,8 @@ post: content: application/json: schema: - anyOf: - - $ref: ../components/schemas/address_fields.yaml + $ref: >- + ../components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -89,7 +89,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/customers_me_orders.yaml b/docs/api/store/paths/customers_me_orders.yaml index 377bccbfa1..b697a9eec7 100644 --- a/docs/api/store/paths/customers_me_orders.yaml +++ b/docs/api/store/paths/customers_me_orders.yaml @@ -192,7 +192,7 @@ get: orders: type: array items: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store/paths/customers_password-reset.yaml b/docs/api/store/paths/customers_password-reset.yaml index bee027f4c8..0576f92444 100644 --- a/docs/api/store/paths/customers_password-reset.yaml +++ b/docs/api/store/paths/customers_password-reset.yaml @@ -8,23 +8,7 @@ post: content: application/json: schema: - type: object - required: - - email - - password - - token - properties: - email: - description: The email of the customer. - type: string - format: email - password: - description: The Customer's password. - type: string - format: password - token: - description: The reset password token - type: string + $ref: ../components/schemas/StorePostCustomersResetPasswordReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -45,7 +29,7 @@ post: type: object properties: customer: - $ref: ../components/schemas/customer.yaml + $ref: ../components/schemas/Customer.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/customers_password-token.yaml index 2949cdd90f..46bb9dce0d 100644 --- a/docs/api/store/paths/customers_password-token.yaml +++ b/docs/api/store/paths/customers_password-token.yaml @@ -9,14 +9,8 @@ post: content: application/json: schema: - type: object - required: - - email - properties: - email: - description: The email of the customer. - type: string - format: email + $ref: >- + ../components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/store/paths/gift-cards_{code}.yaml b/docs/api/store/paths/gift-cards_{code}.yaml index ce5748cb97..1efecec1d2 100644 --- a/docs/api/store/paths/gift-cards_{code}.yaml +++ b/docs/api/store/paths/gift-cards_{code}.yaml @@ -29,7 +29,7 @@ get: type: object properties: gift_card: - $ref: ../components/schemas/gift_card.yaml + $ref: ../components/schemas/GiftCard.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/order-edits_{id}.yaml b/docs/api/store/paths/order-edits_{id}.yaml index 90bf87fb43..65e0def3cb 100644 --- a/docs/api/store/paths/order-edits_{id}.yaml +++ b/docs/api/store/paths/order-edits_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/order-edits_{id}_complete.yaml b/docs/api/store/paths/order-edits_{id}_complete.yaml index 1ff4cf22b8..0e7a856660 100644 --- a/docs/api/store/paths/order-edits_{id}_complete.yaml +++ b/docs/api/store/paths/order-edits_{id}_complete.yaml @@ -29,7 +29,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/order-edits_{id}_decline.yaml b/docs/api/store/paths/order-edits_{id}_decline.yaml index ce8907e40b..7337245d44 100644 --- a/docs/api/store/paths/order-edits_{id}_decline.yaml +++ b/docs/api/store/paths/order-edits_{id}_decline.yaml @@ -13,11 +13,7 @@ post: content: application/json: schema: - type: object - properties: - declined_reason: - type: string - description: The reason for declining the OrderEdit. + $ref: ../components/schemas/StorePostOrderEditsOrderEditDecline.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -38,7 +34,7 @@ post: type: object properties: order_edit: - $ref: ../components/schemas/order_edit.yaml + $ref: ../components/schemas/OrderEdit.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/orders.yaml b/docs/api/store/paths/orders.yaml index 325ddb75b0..687a2fe232 100644 --- a/docs/api/store/paths/orders.yaml +++ b/docs/api/store/paths/orders.yaml @@ -49,7 +49,7 @@ get: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/orders_batch_customer_token.yaml b/docs/api/store/paths/orders_batch_customer_token.yaml index 945eb8412f..39899babbf 100644 --- a/docs/api/store/paths/orders_batch_customer_token.yaml +++ b/docs/api/store/paths/orders_batch_customer_token.yaml @@ -1,6 +1,6 @@ post: operationId: PostOrdersCustomerOrderClaim - summary: Claim orders for signed in account + summary: Claim an Order description: >- Sends an email to emails registered to orders provided with link to transfer order ownership @@ -8,14 +8,7 @@ post: content: application/json: schema: - required: - - order_ids - properties: - order_ids: - description: The ids of the orders to claim - type: array - items: - type: string + $ref: ../components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/store/paths/orders_cart_{cart_id}.yaml b/docs/api/store/paths/orders_cart_{cart_id}.yaml index 2250a041ce..6e69f5568e 100644 --- a/docs/api/store/paths/orders_cart_{cart_id}.yaml +++ b/docs/api/store/paths/orders_cart_{cart_id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/orders_customer_confirm.yaml b/docs/api/store/paths/orders_customer_confirm.yaml index d841d7f5a0..c9b6092f2f 100644 --- a/docs/api/store/paths/orders_customer_confirm.yaml +++ b/docs/api/store/paths/orders_customer_confirm.yaml @@ -1,6 +1,6 @@ post: operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept - summary: Verify a claim to orders + summary: Verify an Order Claim description: >- Verifies the claim order token provided to the customer upon request of order ownership @@ -8,12 +8,7 @@ post: content: application/json: schema: - required: - - token - properties: - token: - description: The invite token provided by the admin. - type: string + $ref: ../components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -27,7 +22,7 @@ post: - api_token: [] - cookie_auth: [] tags: - - Invite + - Order responses: '200': description: OK diff --git a/docs/api/store/paths/orders_{id}.yaml b/docs/api/store/paths/orders_{id}.yaml index 347273607a..df6152833e 100644 --- a/docs/api/store/paths/orders_{id}.yaml +++ b/docs/api/store/paths/orders_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: order: - $ref: ../components/schemas/order.yaml + $ref: ../components/schemas/Order.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/payment-collections_{id}.yaml b/docs/api/store/paths/payment-collections_{id}.yaml index 6876ea93ee..5c5f16ef19 100644 --- a/docs/api/store/paths/payment-collections_{id}.yaml +++ b/docs/api/store/paths/payment-collections_{id}.yaml @@ -1,7 +1,7 @@ get: operationId: GetPaymentCollectionsPaymentCollection - summary: Retrieve an PaymentCollection - description: Retrieves a PaymentCollection. + summary: Get a PaymentCollection + description: Get a Payment Collection x-authenticated: false parameters: - in: path @@ -43,7 +43,7 @@ get: type: object properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions.yaml b/docs/api/store/paths/payment-collections_{id}_sessions.yaml index a18f5574f7..234fa1de62 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions.yaml @@ -1,6 +1,6 @@ post: operationId: PostPaymentCollectionsSessions - summary: Manage Payment Sessions from Payment Collections + summary: Manage a Payment Session description: Manages Payment Sessions from Payment Collections. x-authenticated: false parameters: @@ -14,12 +14,7 @@ post: content: application/json: schema: - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. + $ref: ../components/schemas/StorePaymentCollectionSessionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -34,7 +29,7 @@ post: - api_token: [] - cookie_auth: [] tags: - - Payment + - PaymentCollection responses: '200': description: OK @@ -43,7 +38,7 @@ post: schema: properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml index 93c0ec4593..fe566bbdb3 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml @@ -1,6 +1,6 @@ post: operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch - summary: Manage Multiple Payment Sessions from Payment Collections + summary: Manage Payment Sessions description: Manages Multiple Payment Sessions from Payment Collections. x-authenticated: false parameters: @@ -14,27 +14,8 @@ post: content: application/json: schema: - properties: - sessions: - description: >- - An array of payment sessions related to the Payment Collection. - If the session_id is not provided, existing sessions not present - will be deleted and the provided ones will be created. - type: array - items: - required: - - provider_id - - amount - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - amount: - type: integer - description: The amount . - session_id: - type: string - description: The ID of the Payment Session to be updated. + $ref: >- + ../components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -50,7 +31,7 @@ post: - api_token: [] - cookie_auth: [] tags: - - Payment + - PaymentCollection responses: '200': description: OK @@ -59,7 +40,7 @@ post: schema: properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml index 3442c8640a..30c3913901 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml @@ -1,6 +1,6 @@ post: operationId: PostPaymentCollectionsSessionsBatchAuthorize - summary: Authorize Payment Sessions of a Payment Collection + summary: Authorize PaymentSessions description: Authorizes Payment Sessions of a Payment Collection. x-authenticated: false parameters: @@ -14,12 +14,8 @@ post: content: application/json: schema: - properties: - session_ids: - description: List of Payment Session IDs to authorize. - type: array - items: - type: string + $ref: >- + ../components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -35,7 +31,7 @@ post: - api_token: [] - cookie_auth: [] tags: - - Payment + - PaymentCollection responses: '200': description: OK @@ -44,7 +40,7 @@ post: schema: properties: payment_collection: - $ref: ../components/schemas/payment_collection.yaml + $ref: ../components/schemas/PaymentCollection.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml index 460ad245e7..a7d20ff59b 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml @@ -18,21 +18,6 @@ post: description: The id of the Payment Session to be refreshed. schema: type: string - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - - customer_id - properties: - provider_id: - description: The Payment Provider id. - type: string - customer_id: - description: The Customer id. - type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -55,7 +40,7 @@ post: type: object properties: payment_session: - $ref: ../components/schemas/payment_session.yaml + $ref: ../components/schemas/PaymentSession.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml index 34e6dc23e1..ce39905e02 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml @@ -1,6 +1,6 @@ post: operationId: PostPaymentCollectionsSessionsSessionAuthorize - summary: Authorize a Payment Session of a Payment Collection + summary: Authorize Payment Session description: Authorizes a Payment Session of a Payment Collection. x-authenticated: false parameters: @@ -31,7 +31,7 @@ post: - api_token: [] - cookie_auth: [] tags: - - Payment + - PaymentCollection responses: '200': description: OK @@ -40,7 +40,7 @@ post: schema: properties: payment_session: - $ref: ../components/schemas/payment_session.yaml + $ref: ../components/schemas/PaymentSession.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/product-types.yaml b/docs/api/store/paths/product-types.yaml index 00a5779158..32c4deb44f 100644 --- a/docs/api/store/paths/product-types.yaml +++ b/docs/api/store/paths/product-types.yaml @@ -116,7 +116,7 @@ get: type: object properties: product_types: - $ref: ../components/schemas/product_type.yaml + $ref: ../components/schemas/ProductType.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store/paths/products.yaml b/docs/api/store/paths/products.yaml index 9d542519be..55507c8597 100644 --- a/docs/api/store/paths/products.yaml +++ b/docs/api/store/paths/products.yaml @@ -147,6 +147,11 @@ get: result. schema: type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -170,16 +175,16 @@ get: type: array items: allOf: - - $ref: ../components/schemas/product.yaml + - $ref: ../components/schemas/Product.yaml - type: object properties: variants: type: array items: allOf: - - $ref: ../components/schemas/product_variant.yaml + - $ref: ../components/schemas/ProductVariant.yaml - $ref: >- - ../components/schemas/product_variant_prices_fields.yaml + ../components/schemas/ProductVariantPricesFields.yaml count: type: integer description: The total number of items available diff --git a/docs/api/store/paths/products_{id}.yaml b/docs/api/store/paths/products_{id}.yaml index f5f090d682..6acbf07a6b 100644 --- a/docs/api/store/paths/products_{id}.yaml +++ b/docs/api/store/paths/products_{id}.yaml @@ -54,16 +54,16 @@ get: properties: product: allOf: - - $ref: ../components/schemas/product.yaml + - $ref: ../components/schemas/Product.yaml - type: object properties: variants: type: array items: allOf: - - $ref: ../components/schemas/product_variant.yaml + - $ref: ../components/schemas/ProductVariant.yaml - $ref: >- - ../components/schemas/product_variant_prices_fields.yaml + ../components/schemas/ProductVariantPricesFields.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/regions.yaml b/docs/api/store/paths/regions.yaml index aac1328eb4..4d90acf272 100644 --- a/docs/api/store/paths/regions.yaml +++ b/docs/api/store/paths/regions.yaml @@ -81,7 +81,7 @@ get: regions: type: array items: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/regions_{id}.yaml b/docs/api/store/paths/regions_{id}.yaml index 1c3c016a5c..4e1a316f1c 100644 --- a/docs/api/store/paths/regions_{id}.yaml +++ b/docs/api/store/paths/regions_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: region: - $ref: ../components/schemas/region.yaml + $ref: ../components/schemas/Region.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/return-reasons.yaml b/docs/api/store/paths/return-reasons.yaml index 65109419c5..2df1323ec5 100644 --- a/docs/api/store/paths/return-reasons.yaml +++ b/docs/api/store/paths/return-reasons.yaml @@ -24,7 +24,7 @@ get: return_reasons: type: array items: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/return-reasons_{id}.yaml b/docs/api/store/paths/return-reasons_{id}.yaml index 47ce85648e..59140ce303 100644 --- a/docs/api/store/paths/return-reasons_{id}.yaml +++ b/docs/api/store/paths/return-reasons_{id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: return_reason: - $ref: ../components/schemas/return_reason.yaml + $ref: ../components/schemas/ReturnReason.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/returns.yaml b/docs/api/store/paths/returns.yaml index 448553452f..c852066b3c 100644 --- a/docs/api/store/paths/returns.yaml +++ b/docs/api/store/paths/returns.yaml @@ -6,48 +6,7 @@ post: content: application/json: schema: - 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: - 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. + $ref: ../components/schemas/StorePostReturnsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -68,7 +27,7 @@ post: type: object properties: return: - $ref: ../components/schemas/return.yaml + $ref: ../components/schemas/Return.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/shipping-options.yaml b/docs/api/store/paths/shipping-options.yaml index 0f6cb8c9a6..379694f682 100644 --- a/docs/api/store/paths/shipping-options.yaml +++ b/docs/api/store/paths/shipping-options.yaml @@ -42,7 +42,7 @@ get: shipping_options: type: array items: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/shipping-options_{cart_id}.yaml b/docs/api/store/paths/shipping-options_{cart_id}.yaml index 409adecec6..1cf6620012 100644 --- a/docs/api/store/paths/shipping-options_{cart_id}.yaml +++ b/docs/api/store/paths/shipping-options_{cart_id}.yaml @@ -31,7 +31,7 @@ get: shipping_options: type: array items: - $ref: ../components/schemas/shipping_option.yaml + $ref: ../components/schemas/ShippingOption.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/swaps.yaml b/docs/api/store/paths/swaps.yaml index a0f6784147..084a9d6669 100644 --- a/docs/api/store/paths/swaps.yaml +++ b/docs/api/store/paths/swaps.yaml @@ -8,54 +8,7 @@ post: content: application/json: schema: - 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: - 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: - 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 + $ref: ../components/schemas/StorePostSwapsReq.yaml x-codeSamples: - lang: JavaScript label: JS Client @@ -76,7 +29,7 @@ post: type: object properties: swap: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/swaps_{cart_id}.yaml b/docs/api/store/paths/swaps_{cart_id}.yaml index 59611a4b0c..2be992ccfd 100644 --- a/docs/api/store/paths/swaps_{cart_id}.yaml +++ b/docs/api/store/paths/swaps_{cart_id}.yaml @@ -29,7 +29,7 @@ get: type: object properties: swap: - $ref: ../components/schemas/swap.yaml + $ref: ../components/schemas/Swap.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/variants.yaml b/docs/api/store/paths/variants.yaml index 968c25d3bd..298d92ce80 100644 --- a/docs/api/store/paths/variants.yaml +++ b/docs/api/store/paths/variants.yaml @@ -81,8 +81,8 @@ get: type: array items: allOf: - - $ref: ../components/schemas/product_variant.yaml - - $ref: ../components/schemas/product_variant_prices_fields.yaml + - $ref: ../components/schemas/ProductVariant.yaml + - $ref: ../components/schemas/ProductVariantPricesFields.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/api/store/paths/variants_{variant_id}.yaml b/docs/api/store/paths/variants_{variant_id}.yaml index b632807cee..4bbb842ac2 100644 --- a/docs/api/store/paths/variants_{variant_id}.yaml +++ b/docs/api/store/paths/variants_{variant_id}.yaml @@ -46,8 +46,8 @@ get: properties: variant: allOf: - - $ref: ../components/schemas/product_variant.yaml - - $ref: ../components/schemas/product_variant_prices_fields.yaml + - $ref: ../components/schemas/ProductVariant.yaml + - $ref: ../components/schemas/ProductVariantPricesFields.yaml '400': $ref: ../components/responses/400_error.yaml '404': diff --git a/docs/content/add-plugins/algolia.md b/docs/content/add-plugins/algolia.md index c2d9a3515e..7efc23734c 100644 --- a/docs/content/add-plugins/algolia.md +++ b/docs/content/add-plugins/algolia.md @@ -2,6 +2,8 @@ In this document, you’ll learn how to install the [Algolia plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-plugin-algolia) and use it on both your Medusa Server and your storefront. +--- + ## Overview [Algolia](https://www.algolia.com/) is a search engine service that allows developers to integrate advanced search functionalities into their websites including typo tolerance, recommended results, and quick responses. @@ -10,11 +12,13 @@ Algolia can be used for a wide range of use cases, including ecommerce websites. Through Medusa's flexible plugin system, it is possible to add a search engine to your Medusa server and storefront using Algolia with just a few steps. +--- + ## Prerequisites ### Medusa Components -It is required to have a Medusa server installed before starting with this documentation. If not, please follow along with the [quickstart guide](../quickstart/quick-start.md) to get started in minutes. +It is required to have a Medusa server installed before starting with this documentation. If not, please follow along with the [quickstart guide](../quickstart/quick-start.mdx) to get started in minutes. Furthermore, it’s highly recommended to ensure your Medusa server is configured to work with Redis. As Medusa uses Redis for the event queue internally, configuring Redis ensures that the search indices in Algolia are updated whenever products on the Medusa server are updated. You can follow [this documentation to install Redis](../tutorial/0-set-up-your-development-environment.mdx#redis) and then [configure it on your Medusa server](../usage/configurations.md#redis). @@ -28,6 +32,8 @@ If you don’t install and configure Redis on your Medusa server, the Algolia in You need to [create an Algolia account](https://www.algolia.com/users/sign_up) before you follow this documentation. Algolia offers a free plan to get started quickly. +--- + ## Create an Algolia App The first step is to create an Algolia app for your Medusa server. To create one, open the [Applications page](https://www.algolia.com/account/applications) or, on your dashboard, go to Settings then choose Applications. @@ -50,6 +56,8 @@ In the last step, you’ll see a summary of your order. If all looks good, check ![Summary of your application's order with the terms and agreement checkboxes checked](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000019/Medusa%20Docs/Algolia/PTI2Swq_a1qbi5.png) +--- + ## Retrieve API Keys To retrieve the API keys that you’ll use in the next sections, go to Settings, then choose API Keys in the Team and Access section. @@ -66,6 +74,8 @@ If you have more than one application in your Algolia account, make sure you’r ![Application ID, Search-Only API Key, and Admin API Key can be found in the API Keys page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000037/Medusa%20Docs/Algolia/i50Irki_jmtyk6.png) +--- + ## Install the Algolia Plugin In the directory of your Medusa server, run the following command to install the Algolia plugin: @@ -87,7 +97,7 @@ Finally, in `medusa-config.js` add the following item into the `plugins` arr ```jsx title=medusa-config.js const plugins = [ - //... + // ... { resolve: `medusa-plugin-algolia`, options: { @@ -113,11 +123,13 @@ const plugins = [ }, }, }, -]; +] ``` The `searchableAttributes` are the attributes in a product that are searchable, and `attributesToRetrieve` are the attributes to retrieve for each product result. You’re free to make changes to these attributes as you see fit, but these are the recommended attributes. +--- + ## Test the Algolia Plugin Run your Medusa server with the following command: @@ -150,9 +162,11 @@ This feature is only available if you have Redis installed and configured with y ::: +--- + ## Add Search to your Storefront -In this section, you’ll learn how to add the UI on your storefront to allow searching with Algolia. This section has instructions for Medusa’s [Next.js](../starters/nextjs-medusa-starter.md) storefront as well as React-based frameworks such as the [Gatsby](../starters/gatsby-medusa-starter.md) storefront. +In this section, you’ll learn how to add the UI on your storefront to allow searching with Algolia. This section has instructions for Medusa’s [Next.js](../starters/nextjs-medusa-starter.mdx) storefront as well as React-based frameworks such as the [Gatsby](../starters/gatsby-medusa-starter.mdx) storefront. ### Storefront Prerequisites @@ -160,7 +174,7 @@ It is assumed you already have a storefront set up and working with the Medusa s :::tip -If you don’t have a storefront set up, you can use the [Gatsby](../starters/gatsby-medusa-starter.md) or [Next.js](../starters/nextjs-medusa-starter.md) storefronts Medusa provides. +If you don’t have a storefront set up, you can use the [Gatsby](../starters/gatsby-medusa-starter.mdx) or [Next.js](../starters/nextjs-medusa-starter.mdx) storefronts Medusa provides. ::: @@ -193,7 +207,7 @@ Finally, change the code in `src/lib/search-client.ts` to the following: ```jsx title=src/lib/search-client.ts import algoliasearch from "algoliasearch/lite" -const appId = process.env.NEXT_PUBLIC_SEARCH_APP_ID || "" // You should add this to your environment variables +const appId = process.env.NEXT_PUBLIC_SEARCH_APP_ID || "" const apiKey = process.env.NEXT_PUBLIC_SEARCH_API_KEY || "test_key" @@ -213,7 +227,7 @@ To make sure the Next.js storefront properly displays the products in the search ![Search pop up in the Next.js storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000082/Medusa%20Docs/Algolia/1f9qqK6_c0z8zi.png) -## Add to Gatsby and React-Based Storefronts +### Add to Gatsby and React-Based Storefronts This section covers adding the search UI to React-based storefronts. It uses the Gatsby storefront as an example, but you can use the same steps on any React-based framework. @@ -253,11 +267,11 @@ import { Hits, InstantSearch, SearchBox, - connectStateResults + connectStateResults, } from "react-instantsearch-dom" import React from "react" -import algoliasearch from 'algoliasearch/lite'; +import algoliasearch from "algoliasearch/lite" const searchClient = algoliasearch( process.env.GATSBY_ALGOLIA_APP_ID, @@ -265,19 +279,28 @@ const searchClient = algoliasearch( ) const Search = () => { - const Results = connectStateResults(({ searchState, searchResults, children }) => - searchState && searchState.query && searchResults && searchResults.nbHits !== 0 ? ( -
- {children} -
- ) : ( -
- ) - ); + const Results = connectStateResults( + ({ searchState, searchResults, children }) => { + return ( + searchState && searchState.query && + searchResults && searchResults.nbHits !== 0 ? + ( +
+ {children} +
+ ) : ( +
+ ) + ) + } + ) return (
- + @@ -297,7 +320,7 @@ const Hit = ({ hit }) => { ) } -export default Search; +export default Search ``` This file uses the dependencies you installed to show the search results. It also initializes Algolia using the environment variables you added. @@ -317,17 +340,21 @@ import Search from "./search" And add the `Search` component in the returned JSX before `RegionPopover`: ```jsx title=src/components/header/index.jsx -//... - - -//... +// ... +
+ + +
+// ... ``` If you run your Gatsby storefront while the Medusa server is running, you should find a search bar in the header of the page. Try entering a query to search through the products in your store. ![Search bar in the Gatsby storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000097/Medusa%20Docs/Algolia/INtlcIo_jlh16x.png) -## What’s Next +--- -- Learn how to [deploy your Medusa server](../deployments/server/index.mdx). -- Learn how to [deploy your Gatsby storefront](../deployments/storefront/deploying-gatsby-on-netlify.md). +## See Also + +- [Deploy your Medusa server](../deployments/server/index.mdx) +- [Deploy your Gatsby storefront](../deployments/storefront/deploying-gatsby-on-netlify.md) diff --git a/docs/content/add-plugins/contentful/customize-contentful.md b/docs/content/add-plugins/contentful/customize-contentful.md index 75989cb0de..cfcbad213b 100644 --- a/docs/content/add-plugins/contentful/customize-contentful.md +++ b/docs/content/add-plugins/contentful/customize-contentful.md @@ -12,10 +12,14 @@ On your storefront, you can add any necessary components that can render the Con As an example to explain this process, in this documentation, you’ll create a migration that creates a Rich Text content model in Contentful and edits the Page and Product content models to allow using Rich Text content as a tile in pages and products. Then, you’ll modify the Gatsby storefront to render the Rich Text content model. +--- + ## Prerequisites It’s assumed you already have set up a Medusa server integrated with Contentful and have a Gatsby storefront integrated with Contentful. If not, [please follow this documentation first](index.md). +--- + ## Create a Contentful Migration The Contentful migrations are located in the `contentful-migrations` directory in the Medusa Contentful server starter. So, if you want to create your own Contentful migrations, you can create them under that directory. @@ -25,32 +29,32 @@ Here’s an example of a migration created in a new file `contentful-migrations/ ```jsx title=contentful-migrations/rich-text.js #! /usr/bin/env node -require("dotenv").config(); +require("dotenv").config() -const { runMigration } = require("contentful-migration"); +const { runMigration } = require("contentful-migration") const options = { spaceId: process.env.CONTENTFUL_SPACE_ID, accessToken: process.env.CONTENTFUL_ACCESS_TOKEN, environment: process.env.CONTENTFUL_ENVIRONMENT, yes: true, -}; +} const migration = async () => { await runMigration({ ...options, migrationFunction: function (migration, context) { - //create Rich Text content model + // create Rich Text content model const richText = migration .createContentType("richText") .name("Rich Text") - .displayField("title"); + .displayField("title") - richText.createField("title").name("Title (Internal)").type("Symbol"); - richText.createField("body").name("Body").type("RichText"); + richText.createField("title").name("Title (Internal)").type("Symbol") + richText.createField("body").name("Body").type("RichText") - //edit Page content model + // edit Page content model const page = migration.editContentType("page") page.editField("contentModules").items({ @@ -63,7 +67,7 @@ const migration = async () => { ], }) - //edit Product content model + // edit Product content model const product = migration.editContentType("product") product @@ -79,11 +83,11 @@ const migration = async () => { }, ], }) - } - }); + }, + }) } -migration(); +migration() ``` This example creates a new content model Rich Text that has two fields: title and body. It also edits the Page content model to allow using Rich Text content models on the page. @@ -93,7 +97,19 @@ In addition, it edits the Product content model by adding a new field `contentMo You can also add other types of content models the `contentModules` should accept. For example, to accept `tileSection` add it to the `linkContentType` option: ```jsx -linkContentType: ["tileSection", "richText"], +product + .createField("contentModules") + .name("Content Modules") + .type("Array") + .items({ + type: "Link", + linkType: "Entry", + validations: [ + { + linkContentType: ["richText", "tileSection"], + }, + ], + }) ``` ### Run a Contentful Migration @@ -144,6 +160,8 @@ Similarly, you can add Rich Text content to any product page. ![A rich text content is added to a product](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001305/Medusa%20Docs/Contentful/wgI8mEB_wbukpd.png) +--- + ## Render New Content Models in the Storefront After creating a new content model in your Contentful Space, you must add the necessary component to render it in your Gatsby storefront. @@ -159,10 +177,10 @@ import { renderRichText } from "gatsby-source-contentful/rich-text" const RichText = ({ data }) => { return (
{data.body ? renderRichText(data.body) : ""}
@@ -188,7 +206,7 @@ Then, in the returned JSX add a new case to the switch statement: ```jsx title=src/pages/{ContentfulPage.slug}.js switch (cm.internal.type) { - //... + // ... case "ContentfulRichText": return default: @@ -308,7 +326,9 @@ Restart the Gatsby storefront then open a product that you added Rich Text conte ![Rich Text content you added to the product should be visible at the end of the page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001342/Medusa%20Docs/Contentful/LGiVMxx_rqsr2l.png) -## What’s Next +--- -- Learn how to deploy your Medusa server to [Heroku](../../deployments/server/deploying-on-heroku.mdx), [Qovery](../../deployments/server/deploying-on-qovery.md), or [DigitalOcean](../../deployments/server/deploying-on-digital-ocean.md). -- Learn [how to deploy your Gatsby storefront to Netlify](../../deployments/storefront/deploying-gatsby-on-netlify.md). +## See Also + +- Deploy your Medusa server to [Heroku](../../deployments/server/deploying-on-heroku.mdx), [Qovery](../../deployments/server/deploying-on-qovery.md), or [DigitalOcean](../../deployments/server/deploying-on-digital-ocean.md). +- [How to deploy your Gatsby storefront to Netlify](../../deployments/storefront/deploying-gatsby-on-netlify.md). diff --git a/docs/content/add-plugins/contentful/index.md b/docs/content/add-plugins/contentful/index.md index df584e59a6..1a709a91d5 100644 --- a/docs/content/add-plugins/contentful/index.md +++ b/docs/content/add-plugins/contentful/index.md @@ -8,6 +8,8 @@ In this document, you’ll learn how to integrate a Medusa server with Contentfu By integrating Contentful to Medusa, you can benefit from powerful features in your ecommerce store including detailed product CMS details, easy-to-use interface to use for static content and pages, localization, and much more. +--- + ## Prerequisites ### Needed Accounts @@ -22,6 +24,8 @@ By integrating Contentful to Medusa, you can benefit from powerful features in y - Gatsby’s CLI tool. You can follow [this documentation to install it](https://www.gatsbyjs.com/docs/reference/gatsby-cli/#how-to-use-gatsby-cli). - Medusa’s CLI tool. You can follow [this documentation to install it](../../cli/reference.md#how-to-install-cli-tool). +--- + ## Install Medusa Server Using Contentful Starter Instead of using the default Medusa Server starter, you must use the [Contentful starter](https://github.com/medusajs/medusa-starter-contentful) to install a server that is ready to be used with Contentful. This server contains all the necessary files to make the integration work. @@ -119,14 +123,14 @@ Then, in `medusa-config.js` in the exported object, comment out or remove the SQ ```jsx title=medusa-config.js module.exports = { projectConfig: { - //... + // ... database_url: DATABASE_URL, database_type: "postgres", - //REMOVE OR COMMENT OUT THE BELOW: + // REMOVE OR COMMENT OUT THE BELOW: // database_database: "./medusa-db.sql", // database_type: "sqlite", }, -}; +} ``` ### Migrate Content Types to Contentful @@ -181,10 +185,14 @@ If you seeded the database with demo data, you should see that events related to The Contentful integration ensures a two-way sync between the Medusa server and Contentful. So, when new products are added to Medusa, these products will be added to your Contentful Space as well. +--- + ## (Optional) Add Products with the Medusa Admin Using the Medusa admin, you can add products to your Medusa server. This will trigger product events that subsequently add these products to Contentful. +--- + ## Manage Contentful Data ### Publish Products @@ -217,6 +225,8 @@ Once you’re done adding products, click on Publish changes in the right sideba ![Click on the publish changes button on the right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001508/Medusa%20Docs/Contentful/URNpkXq_cb5ppp.png) +--- + ## Setup Gatsby Storefront In this section, you’ll set up the Gatsby storefront of your Medusa server. @@ -264,6 +274,8 @@ This starts the storefront at `localhost:8000`. Open it in your browser and you ![The storefront with the featured products section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001537/Medusa%20Docs/Contentful/f6xwYbS_w1v993.png) +--- + ## Make Changes to Content You can update the CMS content of your storefront in your Contentful Space. This includes the CMS pages or product details. @@ -274,8 +286,13 @@ If you make changes to the data while your Gatsby storefront is running, the cha ::: +--- + ## What’s Next -- Learn [how to customize your Contentful server and storefront](./customize-contentful.md). -- Learn how to deploy your Medusa server to [Heroku](../../deployments/server/deploying-on-heroku.mdx), [Qovery](../../deployments/server/deploying-on-qovery.md), or [DigitalOcean](../../deployments/server/deploying-on-digital-ocean.md). -- Learn [how to deploy your Gatsby storefront to Netlify](../../deployments/storefront/deploying-gatsby-on-netlify.md). +Learn [How to customize your Contentful server and storefront](./customize-contentful.md). + +## See Also + +- How to deploy your Medusa server to [Heroku](../../deployments/server/deploying-on-heroku.mdx), [Qovery](../../deployments/server/deploying-on-qovery.md), or [DigitalOcean](../../deployments/server/deploying-on-digital-ocean.md). +- [How to deploy your Gatsby storefront to Netlify](../../deployments/storefront/deploying-gatsby-on-netlify.md). diff --git a/docs/content/add-plugins/klarna.md b/docs/content/add-plugins/klarna.md index 03d5b5d1b5..fae6242abb 100644 --- a/docs/content/add-plugins/klarna.md +++ b/docs/content/add-plugins/klarna.md @@ -8,18 +8,22 @@ In this document, you’ll learn how to integrate Klarna as a payment provider i You can integrate Klarna into Medusa using the [official plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-payment-klarna). +--- + ## Prerequisites ### Medusa Components -It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../quickstart/quick-start.md). +It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../quickstart/quick-start.mdx). -In addition, you’ll need to use the [Medusa Admin](../admin/quickstart.md) to enable the payment provider in later steps. You can alternatively use the [REST APIs](/api/admin/#tag/Region/operation/PostRegionsRegionPaymentProviders). +In addition, you’ll need to use the [Medusa Admin](../admin/quickstart.mdx) to enable the payment provider in later steps. You can alternatively use the [REST APIs](/api/admin/#tag/Region/operation/PostRegionsRegionPaymentProviders). ### Needed Accounts - A [Klarna business account](https://portal.klarna.com/) +--- + ## Install Plugin On your Medusa server, run the following command to install the plugin: @@ -51,30 +55,34 @@ Finally, in `medusa-config.js`, add the Klarna plugin to the `plugins` array wit ```jsx title=medusa-config.js const plugins = [ - //other plugins... + // other plugins... { resolve: `medusa-payment-klarnal`, options: { - backend_url: process.env.KLARNA_BACKEND_URL + backend_url: process.env.KLARNA_BACKEND_URL, url: process.env.KLARNA_URL, user: process.env.KLARNA_USER, password: process.env.KLARNA_PASSWORD, merchant_urls: { terms: process.env.KLARNA_TERMS_URL, checkout: process.env.KLARNA_CHECKOUT_URL, - confirmation: process.env.KLARNA_CONFIRMATION_URL - } - } - } -]; + confirmation: process.env.KLARNA_CONFIRMATION_URL, + }, + }, + }, +] ``` +--- + ## Enable Klarna in Regions To use Klarna in your store, you must enable it in at least one region. You can follow [this user guide to learn how to enable a payment provider in a region](../user-guide/regions/providers#manage-payment-providers). You can alternatively use the [REST APIs](/api/admin/#tag/Region/operation/PostRegionsRegionPaymentProviders). -## What’s Next +--- + +## See Also - Check out [more plugins](https://github.com/medusajs/medusa/tree/master/packages) you can add to your store. diff --git a/docs/content/add-plugins/mailchimp.md b/docs/content/add-plugins/mailchimp.md index 009b4c21ee..b1858aab23 100644 --- a/docs/content/add-plugins/mailchimp.md +++ b/docs/content/add-plugins/mailchimp.md @@ -14,12 +14,16 @@ This plugin is only used to allow your customers to subscribe but does not actua ::: +--- + ## Prerequisites Before going further with this guide make sure you have a Medusa server set up. You can follow the [Quickstart guide](https://docs.medusajs.com/quickstart/quick-start). You also need a Mailchimp account, so please [create one](https://mailchimp.com/signup) before you start. +--- + ## Obtain Mailchimp Keys To integrate the plugin into Medusa you need two keys: The API Key and the Newsletter list or Audience ID. The API Key acts as a credential for your account, whereas the Newsletter list ID determines which audience should the subscribed customers be added to. @@ -28,6 +32,8 @@ You can follow [this guide](https://mailchimp.com/help/about-api-keys/#Find_or_g You can follow [this guide](https://mailchimp.com/help/find-audience-id/) from Mailchimp’s documentation to obtain your Newsletter list or Audience ID. +--- + ## Install the Plugin In the directory of your Medusa server, run the following command to install the Mailchimp plugin: @@ -53,17 +59,19 @@ Open `medusa-config.js` and add the new plugin into the `plugins` array: ```js title=medusa-config.js const plugins = [ - ..., + // ..., { resolve: `medusa-plugin-mailchimp`, options: { api_key: process.env.MAILCHIMP_API_KEY, - newsletter_list_id: process.env.MAILCHIMP_NEWSLETTER_LIST_ID - } - } -]; + newsletter_list_id: process.env.MAILCHIMP_NEWSLETTER_LIST_ID, + }, + }, +] ``` +--- + ## Test it Out This plugin adds a new `POST` endpoint at `/mailchimp/subscribe`. This endpoint requires in the body of the request an `email` field. You can also optionally include a `data` object that holds any additional data you want to send to Mailchimp. You can check out [Mailchimp’s subscription documentation](https://mailchimp.com/developer/marketing/api/list-members/add-member-to-list/) for more details on the data you can send. @@ -101,6 +109,8 @@ Here’s an example of sending additional data with the subscription: All fields inside `data` will be sent to Mailchimp’s API along with the email. +--- + ## Use Mailchimp Service If you want to subscribe to users without using this endpoint or at a specific place in your code, you can use Mailchimp’s service `mailchimpService` in your endpoints, services, or subscribers. This service has a method `subscribeNewsletter` which lets you use the subscribe functionality. @@ -122,6 +132,8 @@ You can learn more about how you can use services in your endpoints, services, a ::: +--- + ## Add Subscription Form This section has a simple example of adding a subscription form in your storefront. The code is for React-based frameworks but you can use the same logic for your storefronts regardless of the framework you are using. @@ -135,35 +147,37 @@ npm install axios Then, in the component you want to add the subscription form add the following code: ```jsx -import axios from 'axios' -import { useState } from "react"; +import axios from "axios" +import { useState } from "react" export default function NewsletterForm() { const [email, setEmail] = useState("") function subscribe(e) { - e.preventDefault(); + e.preventDefault() if (!email) { - return; + return } - axios.post('http://localhost:9000/mailchimp/subscribe', { - email + axios.post("http://localhost:9000/mailchimp/subscribe", { + email, }) .then((e) => { alert("Subscribed sucessfully!") setEmail("") }) .catch((e) => { - console.error(e); - alert("An error occurred"); + console.error(e) + alert("An error occurred") }) } return (

Sign Up for our newsletter

- setEmail(e.target.value)} />
@@ -177,7 +191,9 @@ This will result in a subscription form similar to the following: If you try entering an email and clicking Subscribe, the email will be subscribed to your Mailchimp newsletter successfully. -## What’s Next +--- + +## See Also - Check out [SendGrid plugin](../add-plugins/sendgrid.mdx) for more Email functionalities. -- [Learn more about plugins.](../advanced/backend/plugins/overview.md) +- [Plugins Overview](../advanced/backend/plugins/overview.md) diff --git a/docs/content/add-plugins/meilisearch.md b/docs/content/add-plugins/meilisearch.md index 8748fbd1e7..c788813a94 100644 --- a/docs/content/add-plugins/meilisearch.md +++ b/docs/content/add-plugins/meilisearch.md @@ -10,11 +10,13 @@ MeiliSearch also provides a pleasant developer experience, as it is extremely in Through Medusa's flexible plugin system, it is possible to add a search engine to your Medusa server and storefront using MeiliSearch with just a few steps. +--- + ## Prerequisites ### Medusa Components -It is required to have a Medusa server installed before starting with this documentation. If not, please follow along with the [quickstart guide](../quickstart/quick-start.md) to get started in minutes. +It is required to have a Medusa server installed before starting with this documentation. If not, please follow along with the [quickstart guide](../quickstart/quick-start.mdx) to get started in minutes. Furthermore, it’s highly recommended to ensure your Medusa server is configured to work with Redis. As Medusa uses Redis for the event queue internally, configuring Redis ensures that the search indices in MeiliSearch are updated whenever products on the Medusa server are updated. You can follow [this documentation to install Redis](../tutorial/0-set-up-your-development-environment.mdx#redis) and then [configure it on your Medusa server](../usage/configurations.md#redis). @@ -30,6 +32,8 @@ You must install MeiliSearch to use it with Medusa. You can follow [this documen Furthermore, you should create a master key for your MeiliSearch instance. If you don’t have one created, follow [this guide](https://docs.meilisearch.com/learn/security/master_api_keys.html#protecting-a-meilisearch-instance) to create a master key. +--- + ## Install the MeiliSearch Plugin In the directory of your Medusa server, run the following command to install the MeiliSearch plugin: @@ -53,11 +57,12 @@ Finally, in `medusa-config.js` add the following item into the `plugins` array: ```jsx title=medusa-config.js const plugins = [ - //... + // ... { resolve: `medusa-plugin-meilisearch`, options: { - // config object passed when creating an instance of the MeiliSearch client + // config object passed when creating an instance + // of the MeiliSearch client config: { host: process.env.MEILISEARCH_HOST, apiKey: process.env.MEILISEARCH_API_KEY, @@ -67,16 +72,24 @@ const plugins = [ products: { // MeiliSearch's setting options to be set on a particular index searchableAttributes: ["title", "description", "variant_sku"], - displayedAttributes: ["title", "description", "variant_sku", "thumbnail", "handle"], + displayedAttributes: [ + "title", + "description", + "variant_sku", + "thumbnail", + "handle", + ], }, }, }, }, -]; +] ``` You can change the `searchableAttributes` and `displayedAttributes` as you see fit. However, the attributes included are the recommended attributes. +--- + ## Test MeiliSearch Plugin Make sure your MeiliSearch instance is running. If you’re unsure how to run it, you can check the [installation documentation](https://docs.meilisearch.com/learn/getting_started/quick_start.html#setup-and-installation) for the command to run the MeiliSearch instance. @@ -105,9 +118,11 @@ This feature is only available if you have Redis installed and configured with y ::: +--- + ## Add Search to your Storefront -In this section, you’ll learn how to add the UI on your storefront to allow searching with MeiliSearch. This section has instructions for Medusa’s [Next.js](../starters/nextjs-medusa-starter.md) storefront as well as React-based frameworks such as the [Gatsby storefront](../starters/gatsby-medusa-starter.md). +In this section, you’ll learn how to add the UI on your storefront to allow searching with MeiliSearch. This section has instructions for Medusa’s [Next.js](../starters/nextjs-medusa-starter.mdx) storefront as well as React-based frameworks such as the [Gatsby storefront](../starters/gatsby-medusa-starter.mdx). ### Storefront Prerequisites @@ -115,7 +130,7 @@ It is assumed you already have a storefront set up and working with the Medusa s :::tip -If you don’t have a storefront set up, you can use the [Gatsby](../starters/gatsby-medusa-starter.md) or [Next.js](../starters/nextjs-medusa-starter.md) storefronts Medusa provides. +If you don’t have a storefront set up, you can use the [Gatsby](../starters/gatsby-medusa-starter.mdx) or [Next.js](../starters/nextjs-medusa-starter.mdx) storefronts Medusa provides. ::: @@ -212,7 +227,7 @@ import { Hits, InstantSearch, SearchBox, - connectStateResults + connectStateResults, } from "react-instantsearch-dom" import React from "react" @@ -224,19 +239,28 @@ const searchClient = instantMeiliSearch( ) const Search = () => { - const Results = connectStateResults(({ searchState, searchResults, children }) => - searchState && searchState.query && searchResults && searchResults.nbHits !== 0 ? ( -
- {children} -
- ) : ( -
- ) - ); + const Results = connectStateResults( + ({ searchState, searchResults, children }) => { + return ( + searchState && searchState.query && + searchResults && searchResults.nbHits !== 0 ? + ( +
+ {children} +
+ ) : ( +
+ ) + ) + } + ) return (
- + @@ -256,7 +280,7 @@ const Hit = ({ hit }) => { ) } -export default Search; +export default Search ``` This file uses the dependencies you installed to show the search results. It also initializes MeiliSearch using the environment variables you added. @@ -276,17 +300,21 @@ import Search from "./search" And add the `Search` component in the returned JSX before `RegionPopover`: ```jsx title=src/components/header/index.jsx -//... - - -//... +// ... +
+ + +
+// ... ``` If you run your Gatsby storefront while the Medusa server and the MeiliSearch instance are running, you should find a search bar in the header of the page. Try entering a query to search through the products in your store. ![Search box in the header of the storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000317/Medusa%20Docs/MeiliSearch/ZkRgF2h_ytnpv9.png) -## What’s Next +--- -- Learn how to [deploy your Medusa server](../deployments/server/index.mdx). -- Learn how to [deploy your Gatsby storefront](./../deployments/storefront/deploying-gatsby-on-netlify.md). +## See Also + +- [Deploy your Medusa server](../deployments/server/index.mdx). +- [Deploy your Gatsby storefront](./../deployments/storefront/deploying-gatsby-on-netlify.md). diff --git a/docs/content/add-plugins/minio.md b/docs/content/add-plugins/minio.md index e5d14db855..0a0ff531f6 100644 --- a/docs/content/add-plugins/minio.md +++ b/docs/content/add-plugins/minio.md @@ -8,9 +8,13 @@ To manage images in Medusa, you need a file service plugin responsible for hosti Medusa provides three different options to handle your file storage. This document will focus on setting up [MinIO](https://min.io) on your local machine and connecting Medusa to it. +--- + ## Prerequisites -A Medusa server is required to be set up before following along with this document. You can follow the [quickstart guide](../quickstart/quick-start.md) to get started in minutes. +A Medusa server is required to be set up before following along with this document. You can follow the [quickstart guide](../quickstart/quick-start.mdx) to get started in minutes. + +--- ## Set up MinIO @@ -76,6 +80,8 @@ You will not be able to access the Secret Key after closing the pop-up. So, make ::: +--- + ## Plugin Installation In the directory of your Medusa server, run the following command to install the MinIO plugin: @@ -98,7 +104,9 @@ Where `` is the URL of your MinIO server, `` is the name of th Finally, configure your `medusa-config.js` to include the plugin with the required options: ```js title=medusa-config.js -{ +const plugins = [ + // ... + { resolve: `medusa-file-minio`, options: { endpoint: process.env.MINIO_ENDPOINT, @@ -106,7 +114,8 @@ Finally, configure your `medusa-config.js` to include the plugin with the requ access_key_id: process.env.MINIO_ACCESS_KEY, secret_access_key: process.env.MINIO_SECRET_KEY, }, -}, + }, +] ``` :::caution @@ -115,12 +124,16 @@ If you have multiple storage plugins configured, the last plugin declared in the ::: +--- + ## Test it Out -Run your Medusa server alongside the [Medusa Admin](../admin/quickstart.md) to try out your new file service. Upon editing or creating products, you can now upload thumbnails and images, that are stored in a MinIO server. +Run your Medusa server alongside the [Medusa Admin](../admin/quickstart.mdx) to try out your new file service. Upon editing or creating products, you can now upload thumbnails and images, that are stored in a MinIO server. ![Image Uploaded on Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000429/Medusa%20Docs/MinIO/alabX2i_dzg2mh.png) +--- + ## Private Buckets ### Handle Exports @@ -146,13 +159,16 @@ MINIO_PRIVATE_BUCKET=exports Then, add a new option to the plugin’s options in `medusa-config.js`: ```jsx title=medusa-config.js -{ +const plugins = [ + // ... + { resolve: `medusa-file-minio`, options: { - //... - private_bucket: process.env.MINIO_PRIVATE_BUCKET + // ... + private_bucket: process.env.MINIO_PRIVATE_BUCKET, }, -}, + }, +] ``` ### Use Different Secret and Access Keys @@ -171,19 +187,24 @@ Where `` and `` are the access Then, add two new options to the plugin’s options in `medusa-config.js`: ```jsx title=medusa-config.js -{ +const plugins = [ + // ... + { resolve: `medusa-file-minio`, options: { - //... + // ... private_access_key_id: process.env.MINIO_PRIVATE_ACCESS_KEY, - private_secret_access_key: process.env.MINIO_PRIVATE_SECRET_KEY + private_secret_access_key: process.env.MINIO_PRIVATE_SECRET_KEY, }, -}, + }, +] ``` +--- + ## Next.js Storefront Configuration -If you’re using a [Next.js](../starters/nextjs-medusa-starter.md) storefront, you need to add an additional configuration that adds the MinIO domain name into the configured images domain names. This is because all URLs of product images will be from the MinIO server. +If you’re using a [Next.js](../starters/nextjs-medusa-starter.mdx) storefront, you need to add an additional configuration that adds the MinIO domain name into the configured images domain names. This is because all URLs of product images will be from the MinIO server. If this configuration is not added, you’ll receive the error ["next/image Un-configured Host”](https://nextjs.org/docs/messages/next-image-unconfigured-host). @@ -192,13 +213,13 @@ In `next.config.js` add the following option in the exported object: ```jsx title=next.config.js const { withStoreConfig } = require("./store-config") -//... +// ... module.exports = withStoreConfig({ - //... + // ... images: { domains: [ - //... + // ... "127.0.0.1", ], }, @@ -207,6 +228,8 @@ module.exports = withStoreConfig({ Where `127.0.0.1` is the domain of your local MinIO server. -## What’s Next +--- + +## See Also - Check out [more plugins](https://github.com/medusajs/medusa/tree/master/packages) you can add to your store. diff --git a/docs/content/add-plugins/paypal.md b/docs/content/add-plugins/paypal.md index fe2d8a7705..3586825d6f 100644 --- a/docs/content/add-plugins/paypal.md +++ b/docs/content/add-plugins/paypal.md @@ -10,6 +10,8 @@ As a developer, you can use PayPal’s SDKs and APIs to integrate PayPal as a pa Using the `medusa-payment-paypal` plugin, this guide shows you how to set up your Medusa server with PayPal as a payment provider. +--- + ## Prerequisites Before you proceed with this guide, make sure you create a [PayPal account](https://www.paypal.com). You also need a PayPal Developer account and retrieve the Client ID and Client Secret. You can learn more about how to do that in [PayPal’s documentation](https://developer.paypal.com/api/rest/). @@ -20,7 +22,9 @@ Webhooks are used in scenarios where the customer might leave the page during th Additionally, you need a Medusa server installed and set up. If not, you can follow the [quickstart guide](https://docs.medusajs.com/quickstart/quick-start) to get started. -You also need [Medusa Admin](../admin/quickstart.md) installed to enable PayPal as a payment provider. You can alternatively use the [REST APIs](https://docs.medusajs.com/api/admin). +You also need [Medusa Admin](../admin/quickstart.mdx) installed to enable PayPal as a payment provider. You can alternatively use the [REST APIs](https://docs.medusajs.com/api/admin). + +--- ## Medusa Server @@ -53,21 +57,23 @@ Then, in `medusa-config.js`, add the PayPal plugin to the `plugins` array with t ```jsx title=medusa-config.js const plugins = [ - //other plugins... + // other plugins... { resolve: `medusa-payment-paypal`, options: { sandbox: process.env.PAYPAL_SANDBOX, client_id: process.env.PAYPAL_CLIENT_ID, client_secret: process.env.PAYPAL_CLIENT_SECRET, - auth_webhook_id: process.env.PAYPAL_AUTH_WEBHOOK_ID - } - } -]; + auth_webhook_id: process.env.PAYPAL_AUTH_WEBHOOK_ID, + }, + }, +] ``` That’s all you need to install PayPal on your Medusa server! +--- + ## Admin Setup This section will guide you through adding PayPal as a payment provider in a region using your Medusa admin dashboard. @@ -76,12 +82,14 @@ This step is required for you to be able to use PayPal as a payment provider in ### Admin Prerequisites -If you don’t have a Medusa admin installed, make sure to follow along with [the guide on how to install it](../admin/quickstart.md) before continuing with this section. +If you don’t have a Medusa admin installed, make sure to follow along with [the guide on how to install it](../admin/quickstart.mdx) before continuing with this section. ### Add PayPal to Regions You can refer to [this documentation in the user guide](../user-guide/regions/providers.mdx#manage-payment-providers) to learn how to add a payment provider like PayPal to a region. +--- + ## Storefront Setup This section will take you through the steps to add PayPal as a payment method on the storefront. It includes the steps necessary when using one of Medusa’s official storefronts as well as your own custom React-based storefront. @@ -115,7 +123,7 @@ In Medusa, by default, payments are authorized during checkout, but the payment ### Add to Next.js Storefront -Medusa has a Next.js storefront that you can easily use with your Medusa server. If you don’t have the storefront installed, you can follow [this quickstart guide](../starters/nextjs-medusa-starter.md). +Medusa has a Next.js storefront that you can easily use with your Medusa server. If you don’t have the storefront installed, you can follow [this quickstart guide](../starters/nextjs-medusa-starter.mdx). In your `.env.local` file (or the file you’re using for your environment variables), add the following variable: @@ -133,7 +141,7 @@ You can test out the payment with PayPal using your sandbox account. ### Add to Gatsby Storefront -Medusa also has a Gatsby storefront that you can use as your ecommerce storefront. If you don’t have the storefront installed, you can follow [this quickstart guide](../starters/gatsby-medusa-starter.md). +Medusa also has a Gatsby storefront that you can use as your ecommerce storefront. If you don’t have the storefront installed, you can follow [this quickstart guide](../starters/gatsby-medusa-starter.mdx). In your `.env.development` file (or the file you’re using for your environment variables) add the following variable with its value set to the Client ID: @@ -150,12 +158,15 @@ npm install @paypal/react-paypal-js Next, create a new file `src/components/payment/paypal-payment/index.jsx` with the following content: ```jsx title=src/components/payment/paypal-payment/index.jsx -import { PayPalButtons, PayPalScriptProvider } from "@paypal/react-paypal-js"; -import React, { useMemo, useState } from "react"; +import { + PayPalButtons, + PayPalScriptProvider, +} from "@paypal/react-paypal-js" +import React, { useMemo, useState } from "react" import { navigate } from "gatsby" import { useCart } from "../../../hooks/use-cart" -import { useMedusa } from "../../../hooks/use-medusa"; +import { useMedusa } from "../../../hooks/use-medusa" const paypalClientId = process.env.GATSBY_PAYPAL_CLIENT_ID || "" @@ -171,7 +182,7 @@ const PaypalPayment = () => { const paypalSession = useMemo(() => { if (cart.payment_sessions) { - return cart.payment_sessions.find(s => s.provider_id === "paypal") + return cart.payment_sessions.find((s) => s.provider_id === "paypal") } return null @@ -192,10 +203,10 @@ const PaypalPayment = () => { await client.carts.updatePaymentSession(cart.id, "paypal", { data: { data: { - ...authorizationOrder - } - } - }); + ...authorizationOrder, + }, + }, + }) const order = await completeCart(cart.id) @@ -210,10 +221,12 @@ const PaypalPayment = () => { const handlePayment = (data, actions) => { actions.order.authorize().then((authorization) => { - if (authorization.status !== 'COMPLETED') { - setErrorMessage(`An error occurred, status: ${authorization.status}`); - setProcessing(false); - return; + if (authorization.status !== "COMPLETED") { + setErrorMessage( + `An error occurred, status: ${authorization.status}` + ) + setProcessing(false) + return } completeOrder(authorization) @@ -224,7 +237,7 @@ const PaypalPayment = () => { {errorMessage && ( {errorMessage} @@ -238,7 +251,7 @@ const PaypalPayment = () => { ) } -export default PaypalPayment; +export default PaypalPayment ``` Here’s briefly what this code snippet does: @@ -256,9 +269,11 @@ In `src/components/payment/index.js` you’ll find in the return statement a swi ```jsx title=src/components/payment/index.js switch (ps.provider_id) { case "stripe": - //... + // ... + break case "manual": - //... + // ... + break case "paypal": return default: @@ -295,28 +310,33 @@ Then, add the Client ID as an environment variable based on the framework you’ Next, create the file that will hold the PayPal component with the following content: ```jsx -import { PayPalButtons, PayPalScriptProvider } from "@paypal/react-paypal-js"; +import { + PayPalButtons, + PayPalScriptProvider, +} from "@paypal/react-paypal-js" import { useEffect, useState } from "react" import Medusa from "@medusajs/medusa-js" function Paypal() { - const client = new Medusa(); + const client = new Medusa() const [errorMessage, setErrorMessage] = useState(undefined) const [processing, setProcessing] = useState(false) - const cart //TODO retrieve the cart here + const cart = "..." // TODO retrieve the cart here const handlePayment = (data, actions) => { actions.order.authorize().then(async (authorization) => { - if (authorization.status !== 'COMPLETED') { - setErrorMessage(`An error occurred, status: ${authorization.status}`); - setProcessing(false); - return; + if (authorization.status !== "COMPLETED") { + setErrorMessage( + `An error occurred, status: ${authorization.status}` + ) + setProcessing(false) + return } const response = await client.carts.setPaymentSession(cart.id, { - "provider_id": "paypal" - }); + "provider_id": "paypal", + }) if (!response.cart) { setProcessing(false) @@ -326,30 +346,30 @@ function Paypal() { await client.carts.updatePaymentSession(cart.id, "paypal", { data: { data: { - ...authorization - } - } - }); + ...authorization, + }, + }, + }) - const {data} = await client.carts.complete(cart.id) + const { data } = await client.carts.complete(cart.id) if (!data || data.object !== "order") { setProcessing(false) return } - //order successful + // order successful alert("success") }) } return ( -
+
{cart !== undefined && ( , + "client-id": "", "currency": "EUR", - "intent": "authorize" + "intent": "authorize", }}> {errorMessage && ( {errorMessage} @@ -362,10 +382,10 @@ function Paypal() { )}
- ); + ) } -export default Paypal; +export default Paypal ``` Here’s briefly what this code snippet does: @@ -384,6 +404,8 @@ If you run the Medusa server and the storefront server, you should see the PayPa ![PayPal Button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000492/Medusa%20Docs/PayPal/PsibgPY_xtqdli.png) +--- + ## Capture Payments After the customer places an order, you can see the order on the admin panel. In the payment information under the “Payment” section, you should see a “Capture” button. @@ -394,6 +416,8 @@ Clicking this button lets you capture the payment for an order. You can also ref Refunding or Capturing payments is reflected in your PayPal dashboard as well. -## What's Next +--- + +## See Also - Check out [more plugins](https://github.com/medusajs/medusa/tree/master/packages) you can add to your store. diff --git a/docs/content/add-plugins/s3.md b/docs/content/add-plugins/s3.md index 92bc00aba2..943d92f606 100644 --- a/docs/content/add-plugins/s3.md +++ b/docs/content/add-plugins/s3.md @@ -8,16 +8,20 @@ To manage images in Medusa, you need a file service plugin responsible for hosti Medusa provides three different options to handle your file storage. This document focuses on using [S3](https://aws.amazon.com/s3/) to store your Medusa server’s images. +--- + ## Prerequisites ### Medusa Server -A Medusa server is required to be set up before following along with this document. You can follow the [quickstart guide](../quickstart/quick-start.md) to get started in minutes. +A Medusa server is required to be set up before following along with this document. You can follow the [quickstart guide](../quickstart/quick-start.mdx) to get started in minutes. ### Required Accounts You need to [create an AWS account](https://console.aws.amazon.com/console/home?nc2=h_ct&src=header-signin) to follow along with this documentation. +--- + ## Create S3 Bucket On your AWS Console, search for S3 in the search box at the top. Then, choose the first result you see which should be S3 under the Services category. @@ -42,6 +46,8 @@ Then, in the “Block Public Access settings for this bucket” section, uncheck You can leave the rest of the fields in the form as is and scroll down to the end of the page. Then, click on the Create Bucket button. +--- + ## Manage Bucket Policies On the page of the bucket you just created, click on the Permissions tab. Then, scroll down until you find the Bucket policy section. Click on Edit in that section. @@ -80,6 +86,8 @@ Your user must have the `AmazonS3FullAccess` policy attached to it. You can refe You must obtain access keys for your user as you’ll use them to integrate the S3 plugin in Medusa with your bucket. To obtain the Access Key ID and the Secret Access Key, check out [this guide](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). +--- + ## Install the S3 Plugin In the directory of your Medusa server, run the following command to install the S3 Plugin: @@ -110,7 +118,7 @@ Finally, in `medusa-config.js`, add to the `plugins` array the following new ite ```jsx title=medusa-config.js const plugins = [ - //... + // ... { resolve: `medusa-file-s3`, options: { @@ -121,7 +129,7 @@ const plugins = [ secret_access_key: process.env.S3_SECRET_ACCESS_KEY, }, }, -]; +] ``` ### Add AWS Configurations @@ -132,7 +140,7 @@ For example, you can pass the `region`, `access_key_id` and `secret_access_key` ```jsx title=medusa-config.js const plugins = [ - //... + // ... { resolve: `medusa-file-s3`, options: { @@ -142,10 +150,10 @@ const plugins = [ region: process.env.S3_REGION, access_key_id: process.env.S3_ACCESS_KEY_ID, secret_access_key: process.env.S3_SECRET_ACCESS_KEY, - } + }, }, }, -]; +] ``` Make sure to define `S3_REGION`, `S3_ACCESS_KEY_ID`, and `S3_SECRET_ACCESS_KEY` in your environment variables first. @@ -157,6 +165,8 @@ If you have multiple storage plugins configured, the last plugin declared in the ::: +--- + ## Test the S3 Plugin Run your Medusa server with the following command: @@ -165,7 +175,7 @@ Run your Medusa server with the following command: npm run start ``` -Then, you can either test the plugin using the [REST APIs](https://docs.medusajs.com/api/store) or using the [Medusa Admin](../admin/quickstart.md). +Then, you can either test the plugin using the [REST APIs](https://docs.medusajs.com/api/store) or using the [Medusa Admin](../admin/quickstart.mdx). On the Medusa Admin, create a new product and, in the Images section, upload an image then click Save. If the integration was successful, the product image will be uploaded successfully. @@ -175,9 +185,11 @@ You can also check that the image was uploaded on the S3 bucket’s page. ![Image is now available in the S3 Bucket](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000630/Medusa%20Docs/S3/NJZ5bP8_ovv9rc.png) +--- + ## Next.js Storefront Configuration -If you’re using a [Next.js](../starters/nextjs-medusa-starter.md) storefront, you need to add an additional configuration that adds the S3 bucket domain name into the configured images’ domain names. This is because all URLs of product images will be from the S3 bucket. +If you’re using a [Next.js](../starters/nextjs-medusa-starter.mdx) storefront, you need to add an additional configuration that adds the S3 bucket domain name into the configured images’ domain names. This is because all URLs of product images will be from the S3 bucket. If this configuration is not added, you’ll receive the error ["next/image Un-configured Host”](https://nextjs.org/docs/messages/next-image-unconfigured-host). @@ -186,14 +198,14 @@ In `next.config.js` add the following option in the exported object: ```jsx title=next.config.js const { withStoreConfig } = require("./store-config") -//... +// ... module.exports = withStoreConfig({ - //... + // ... images: { domains: [ - //... - ".s3.amazonaws.com" + // ... + ".s3.amazonaws.com", ], }, }) @@ -201,8 +213,10 @@ module.exports = withStoreConfig({ Where `` is the name of the S3 bucket you’re using. -## What’s Next +--- + +## See Also - Check out [more plugins](https://github.com/medusajs/medusa/tree/master/packages) you can add to your store. -- Learn how to [deploy the Medusa server](../deployments/server/index.mdx). -- Learn about the [Next.js](../starters/nextjs-medusa-starter.md) and [Gatsby](../starters/gatsby-medusa-starter.md) storefronts. +- [Deploy the Medusa server](../deployments/server/index.mdx) +- Install the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefronts. diff --git a/docs/content/add-plugins/segment.md b/docs/content/add-plugins/segment.md index 54f80f4e39..ff4ed78ae6 100644 --- a/docs/content/add-plugins/segment.md +++ b/docs/content/add-plugins/segment.md @@ -36,11 +36,13 @@ Check out the [Event Reference](../advanced/backend/subscribers/events-list.md) ::: +--- + ## Prerequisites ### Medusa Server -It is assumed you already have a Medusa server installed. If not, please follow the [Quickstart guide](../quickstart/quick-start.md) to get started in minutes. +It is assumed you already have a Medusa server installed. If not, please follow the [Quickstart guide](../quickstart/quick-start.mdx) to get started in minutes. In addition, make sure to have Redis installed and configured with your Medusa server. If not, follow [this documentation](../tutorial/0-set-up-your-development-environment.mdx#redis) to install Redis and then [configure it](../usage/configurations.md#redis). @@ -48,6 +50,8 @@ In addition, make sure to have Redis installed and configured with your Medusa s You need to [create a Segment account](https://app.segment.com/signup/) to follow along with the tutorial. Segment offers a free plan to get started quickly. +--- + ## Create a Segment Source On your Segment dashboard, choose Catalog from the sidebar under Connections. @@ -84,6 +88,8 @@ You can then choose from a list of destinations such as Google Universal Analyti The process of integrating each destination is different, so you must follow the steps detailed in Segment for each destination you choose. +--- + ## Install the Segment Plugin In the directory of your Medusa server, run the following command to install the Segment plugin: @@ -104,16 +110,18 @@ Finally, in `medusa-config.js`, add the following new item to the `plugins` arra ```jsx title=medusa-config.js const plugins = [ - //... + // ... { resolve: `medusa-plugin-segment`, options: { write_key: process.env.SEGMENT_WRITE_KEY, - } - } -]; + }, + }, +] ``` +--- + ## Test the Plugin Run your server with the following command: @@ -122,7 +130,7 @@ Run your server with the following command: npm run start ``` -Then, try triggering one of the [mentioned events earlier in this document](#events-that-the-segment-plugin-tracks). For example, you can place an order either using the [REST APIs](https://docs.medusajs.com/api/store) or using the [Next.js](../starters/nextjs-medusa-starter.md) or [Gatsby](../starters/gatsby-medusa-starter.md) storefronts. +Then, try triggering one of the [mentioned events earlier in this document](#events-that-the-segment-plugin-tracks). For example, you can place an order either using the [REST APIs](https://docs.medusajs.com/api/store) or using the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefronts. After you place an order, on the Segment source that you created, click on the Debugger tab. You should see at least one event triggered for each order you place. If you click on the event, you can see the order details are passed to the event. @@ -136,6 +144,8 @@ If the data is not appearing on the destination, the issue is related to your co ::: +--- + ## Add Custom Tracking In some cases, you might want to track more events or custom events. You can do that using the `SegmentService` provided by the Segment Plugin. @@ -145,24 +155,24 @@ For example, you can add the following subscriber to listen to the `customer.cre ```jsx title=src/subscribers/customer.ts class CustomerSubscriber { constructor({ segmentService, eventBusService }) { - this.segmentService = segmentService; + this.segmentService = segmentService - eventBusService.subscribe("customer.created", this.handleCustomer); + eventBusService.subscribe("customer.created", this.handleCustomer) } handleCustomer = async (data) => { - const customerData = data; - delete customerData['password_hash']; + const customerData = data + delete customerData["password_hash"] this.segmentService.track({ - event: 'Customer Created', + event: "Customer Created", userId: data.id, - properties: customerData + properties: customerData, }) - }; + } } -export default CustomerSubscriber; +export default CustomerSubscriber ``` You resolve the `SegmentService` using dependency injection. Then, when the `customer.created` event is triggered, you use the `track` method available in the `SegmentService` to send tracking data to Segment. @@ -185,8 +195,11 @@ After adding the above subscriber, run your server again if it isn’t running a ![The customer created event is recoreded on the Segment source](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000759/Medusa%20Docs/Segment/4LD41xE_qungdw.png) -## What’s Next +--- -- Learn how [services](../advanced/backend/services/create-service.md) and [subscribers](../advanced/backend/subscribers/create-subscriber.md) work. -- Check out a [full list of events](../advanced/backend/subscribers/events-list.md) in Medusa. -- Learn how to [deploy the Medusa server](../deployments/server/index.mdx). +## See Also + +- [Services Overview](../advanced/backend/services/create-service.md) +- [Subscribers Overview](../advanced/backend/subscribers/create-subscriber.md) +- [Events Reference](../advanced/backend/subscribers/events-list.md) +- [Deploy the Medusa server](../deployments/server/index.mdx) diff --git a/docs/content/add-plugins/sendgrid.mdx b/docs/content/add-plugins/sendgrid.mdx index 7a18733685..2b985b0f7e 100644 --- a/docs/content/add-plugins/sendgrid.mdx +++ b/docs/content/add-plugins/sendgrid.mdx @@ -20,12 +20,16 @@ By integrating SendGrid with Medusa, you’ll be sending email notifications to 4. User-related events including reset passwords. 5. Restock Notifications for when product stocks are low. +--- + ## Prerequisites -Before going further with this guide make sure you have a Medusa server set up. You can follow the [Quickstart guide](../quickstart/quick-start.md). +Before going further with this guide make sure you have a Medusa server set up. You can follow the [Quickstart guide](../quickstart/quick-start.mdx). You also must have [Redis configured on your Medusa server](/tutorial/set-up-your-development-environment#redis). Sending emails is done through Subscribers, which uses Redis as the event queue. If you don’t set up Redis, the plugin will not send emails. +--- + ## Create a SendGrid Account If you don’t have a SendGrid account, make sure to [create one](https://signup.sendgrid.com) first. You also need to set up a [single sender](https://docs.sendgrid.com/ui/sending-email/sender-verification) first in SendGrid before you can start sending emails. @@ -60,6 +64,8 @@ Medusa supports localization so you can also create multiple templates for multi ::: +--- + ## Template Reference This section covers the template types supported by the plugin and what variables you can expect in your dynamic template. You can use the variables to add details like order total or customer name. @@ -3891,6 +3897,8 @@ You don’t have to create a template for every type in the reference. You can s ``` +--- + ## Install the SendGrid Plugin In the directory of your Medusa server run the following command to install the SendGrid plugin: @@ -3920,7 +3928,7 @@ Finally, in your `medusa-config.js` file, add the SendGrid plugin into the array ```jsx title=medusa-config.js const plugins = [ - ..., + // ..., { resolve: `medusa-plugin-sendgrid`, options: { @@ -3929,18 +3937,21 @@ const plugins = [ order_placed_template: process.env.SENDGRID_ORDER_PLACED_ID, localization: { "de-DE": { // locale key - order_placed_template: process.env.SENDGRID_ORDER_PLACED_ID_LOCALIZED, - } - } - } - } -]; + order_placed_template: + process.env.SENDGRID_ORDER_PLACED_ID_LOCALIZED, + }, + }, + }, + }, +] ``` The `api_key` and `from` options are required. Then, use the key of each template you create (from the [reference](#template-reference)) as the option name with the template ID as the value. You can also optionally pass the option `localization` if you want to support different languages. `localization` accepts an object that has the country and language codes as keys. The value for each code should be an object of template keys and their IDs as values. Make sure to include the localized template IDs in `.env` as well. +--- + ## Test it Out Run your server now: @@ -3953,7 +3964,7 @@ To test it out, perform an action that would trigger one of the emails being sen :::tip -If you don’t have a storefront installed, check out the [Gatsby](../starters/gatsby-medusa-starter.md) or [Next.js](../starters/nextjs-medusa-starter.md) starters to create a storefront in minutes. +If you don’t have a storefront installed, check out the [Gatsby](../starters/gatsby-medusa-starter.mdx) or [Next.js](../starters/nextjs-medusa-starter.mdx) starters to create a storefront in minutes. ::: @@ -3961,7 +3972,9 @@ You can also track analytics related to emails sent from the SendGrid dashboard. ![SendGrid Analytics](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000788/Medusa%20Docs/SendGrid/X01LigH_mxmtbn.png) -## What’s Next +--- -- Learn more about how [Notifications work in Medusa](../advanced/backend/notification/overview.md). -- Install the [Medusa admin](https://github.com/medusajs/admin#-setting-up-admin) for functionalities like Gift Cards creation, swaps, claims, order return requests, and more. \ No newline at end of file +## See Also + +- [Notifications Overview](../advanced/backend/notification/overview.md) +- Install the [Medusa admin](../admin/quickstart.mdx) for functionalities like Gift Cards creation, swaps, claims, order return requests, and more. \ No newline at end of file diff --git a/docs/content/add-plugins/slack.md b/docs/content/add-plugins/slack.md index 2a000de26b..316d57926c 100644 --- a/docs/content/add-plugins/slack.md +++ b/docs/content/add-plugins/slack.md @@ -17,6 +17,8 @@ The plugin registers a subscriber to the `order.placed` event. When an order is Then, the order notificaiton is sent to Slack using Webhooks. So, you'll need to create a Slack App, add it into your workspace, and activate Incoming Webhooks. +--- + ## Prerequisites ### Slack Account @@ -25,7 +27,7 @@ To follow along with this guide, you need to have a Slack account with a connect ### Medusa Server -This tutorial assumes you already have a Medusa server installed. If you don’t, please follow along with the [quickstart guide](../quickstart/quick-start.md). +This tutorial assumes you already have a Medusa server installed. If you don’t, please follow along with the [quickstart guide](../quickstart/quick-start.mdx). ### Redis @@ -35,6 +37,8 @@ As the Slack plugin will listen to the `order.placed` event to know when to send You can read the [Set up your development enviornment guideline](../tutorial/0-set-up-your-development-environment.mdx#redis) to learn more about how you can install and setup Redis. +--- + ## Create Slack App The first step is to create a Slack app. This app will be connected to your workspace and will have Incoming Webhooks activated to receive notifications from the Medusa server using a Webhook URL. @@ -63,6 +67,8 @@ After that, choose the channel to send the notifications to. You can also choose This will create a new Webhook with a URL which you can see in the table at the end of the Incoming Webhooks page. Copy the URL as you’ll use it in the next section. +--- + ## Install Slack Plugin The next step is to install Medusa’s [Slack plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-plugin-slack-notification) into your Medusa server. @@ -77,16 +83,16 @@ After that, open `medusa-config.js` and add the new plugin with its configuratio ```jsx title=medusa-config.js const plugins = [ - ..., + // ..., { resolve: `medusa-plugin-slack-notification`, options: { show_discount_code: false, slack_url: ``, - admin_orders_url: `http://localhost:7001/a/orders` - } - } -]; + admin_orders_url: `http://localhost:7001/a/orders`, + }, + }, +] ``` - Make sure to change `` with the Webhook URL you copied after creating the Slack app. @@ -95,7 +101,9 @@ const plugins = [ That’s all you need to do to integrate Slack into Medusa! -## What's Next +--- -- Install [Medusa's Admin](https://github.com/medusajs/admin) for the full order-management experience. -- Add a Storefront to your Medusa server using [the Next.js starter](https://docs.medusajs.com/starters/nextjs-medusa-starter) or [the Gatsby starter](https://docs.medusajs.com/starters/gatsby-medusa-starter). +## See Also + +- Install [Medusa's Admin](../admin/quickstart.mdx) for the full order-management experience. +- Install the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) starter storefronts. diff --git a/docs/content/add-plugins/spaces.md b/docs/content/add-plugins/spaces.md index a58e1de867..7f31d81587 100644 --- a/docs/content/add-plugins/spaces.md +++ b/docs/content/add-plugins/spaces.md @@ -14,16 +14,20 @@ To manage images in Medusa, you need a file service plugin responsible for hosti Medusa provides three different options to handle your file storage. This document focuses on using [Spaces](https://www.digitalocean.com/products/spaces) to store your Medusa server’s images. +--- + ## Prerequisites ### Medusa Server -A Medusa server is required to be set up before following along with this document. You can follow the [quickstart guide](../quickstart/quick-start.md) to get started in minutes. +A Medusa server is required to be set up before following along with this document. You can follow the [quickstart guide](../quickstart/quick-start.mdx) to get started in minutes. ### Required Accounts You need to [create a DigitalOcean account](https://cloud.digitalocean.com/registrations/new) to follow along with this documentation. A credit card is required during registration. +--- + ## Create DigitalOcean Space In your DigitalOcean account, click on the Create button at the top right, then choose Spaces from the dropdown. @@ -40,6 +44,8 @@ In the Finalize and Create section, enter a name for the field “Choose a uniqu Once you’re done, click on the Create a Space button. This creates the Space and redirects you to the Space’s page. +--- + ## Create Space Access Keys Choose API from the bottom of the sidebar. @@ -62,6 +68,8 @@ The secret access key will not be shown again after you leave the page. Make sur ::: +--- + ## Install the Spaces Plugin In the directory of your Medusa server, run the following command to install the Spaces plugin: @@ -97,7 +105,7 @@ Finally, in `medusa-config.js` add a new item to the `plugins` array: ```jsx title=medusa-config.js const plugins = [ - //... + // ... { resolve: `medusa-file-spaces`, options: { @@ -108,7 +116,7 @@ const plugins = [ secret_access_key: process.env.SPACE_SECRET_ACCESS_KEY, }, }, -]; +] ``` :::caution @@ -117,6 +125,8 @@ If you have multiple storage plugins configured, the last plugin declared in the ::: +--- + ## Test the Space Plugin Run your Medusa server with the following command: @@ -125,7 +135,7 @@ Run your Medusa server with the following command: npm run start ``` -Then, you can either test the plugin using the [REST APIs](https://docs.medusajs.com/api/store) or using the [Medusa Admin](../admin/quickstart.md). +Then, you can either test the plugin using the [REST APIs](https://docs.medusajs.com/api/store) or using the [Medusa Admin](../admin/quickstart.mdx). On the Medusa Admin, create a new product and, in the Images section, upload an image then click Save. If the integration was successful, the product image will be uploaded successfully. @@ -135,9 +145,11 @@ You can also check that the image was uploaded on the Space’s page. ![Image can be seen on the Space's page on DigitalOcean](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001050/Medusa%20Docs/Spaces/BexmRkg_gimk1d.png) +--- + ## Next.js Storefront Configuration -If you’re using a [Next.js](../starters/nextjs-medusa-starter.md) storefront, you need to add an additional configuration that adds the Space’s domain name into the configured images’ domain names. This is because all URLs of product images will be from the Space. +If you’re using a [Next.js](../starters/nextjs-medusa-starter.mdx) storefront, you need to add an additional configuration that adds the Space’s domain name into the configured images’ domain names. This is because all URLs of product images will be from the Space. If this configuration is not added, you’ll receive the error ["next/image Un-configured Host”](https://nextjs.org/docs/messages/next-image-unconfigured-host). @@ -146,14 +158,14 @@ In `next.config.js` add the following option in the exported object: ```jsx title=next.config.js const { withStoreConfig } = require("./store-config") -//... +// ... module.exports = withStoreConfig({ - //... + // ... images: { domains: [ - //... - "" + // ... + "", ], }, }) @@ -161,8 +173,10 @@ module.exports = withStoreConfig({ Where `` is the domain name for your Space which can be retrieved from the Space URL. For example, `medusa-server.fra1.digitaloceanspaces.com`. -## What’s Next +--- + +## See Also - Check out [more plugins](https://github.com/medusajs/medusa/tree/master/packages) you can add to your store. -- Learn how to [deploy the Medusa server on DigitalOcean](../deployments/server/deploying-on-digital-ocean.md). -- Learn about the [Next.js](../starters/nextjs-medusa-starter.md) and [Gatsby](../starters/gatsby-medusa-starter.md) storefronts. +- [Seploy the Medusa server on DigitalOcean](../deployments/server/deploying-on-digital-ocean.md). +- Install the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefront. diff --git a/docs/content/add-plugins/strapi.md b/docs/content/add-plugins/strapi.md index 082f96ea9a..b957616476 100644 --- a/docs/content/add-plugins/strapi.md +++ b/docs/content/add-plugins/strapi.md @@ -14,6 +14,8 @@ This plugin is a [community plugin](https://github.com/Deathwish98/medusa-plugin By integrating Strapi to Medusa, you can benefit from powerful features in your ecommerce store including detailed product CMS details, [two-way sync](#test-two-way-sync), an easy-to-use interface to use for static content and pages, and much more. +--- + ## Prerequisites ### Medusa CLI @@ -24,6 +26,8 @@ By integrating Strapi to Medusa, you can benefit from powerful features in your Redis is required for the Strapi plugin to work as expected on your Medusa server. If you don’t have it installed, you can learn [how to install it in this documentation](../tutorial/0-set-up-your-development-environment.mdx#redis). +--- + ## Create Strapi Project The first step is to create a Strapi project using the Medusa template: @@ -52,6 +56,8 @@ Click on the Create new entry button at the top right. This opens a new form to Enter the user’s username, email, and password. Once you’re done, click on the Save button at the top right. +--- + ## Modify Permissions By default, created users have the “Authenticated” role. Before you start using the Strapi plugin on your Medusa server, you must modify this role’s permissions to allow making changes to Medusa’s models in Strapi. @@ -62,6 +68,8 @@ On your Strapi dashboard, go to Settings → Roles → Authenticated. Then, unde Once you’re done, click the Save button at the top right. +--- + ## Create Medusa Server :::note @@ -86,10 +94,10 @@ Once the command is done executing, change to the newly created `medusa-server` module.exports = { projectConfig: { redis_url: REDIS_URL, - //... - } - //... -}; + // ... + }, + // ... +} ``` This uses the default Redis configurations. If you want to learn more about configuring Redis, [check out this documentation](../usage/configurations.md#redis). @@ -100,6 +108,8 @@ It is also recommended to use PostgreSQL for an optimal experience, however, it ::: +--- + ## Install the Strapi Plugin In the directory of your Medusa server, run the following command to install the Strapi plugin: @@ -130,20 +140,22 @@ Finally, open `medusa-config.js` and add the following new item to the `plugins` ```jsx title=medusa-config.js const plugins = [ - //... + // ... { resolve: `medusa-plugin-strapi`, options: { strapi_medusa_user: process.env.STRAPI_USER, strapi_medusa_password: process.env.STRAPI_PASSWORD, - strapi_url: process.env.STRAPI_URL, //optional - strapi_port: process.env.STRAPI_PORT, //optional - strapi_protocol: process.env.STRAPI_PROTOCOL //optional - } - } -]; + strapi_url: process.env.STRAPI_URL, // optional + strapi_port: process.env.STRAPI_PORT, // optional + strapi_protocol: process.env.STRAPI_PROTOCOL, // optional + }, + }, +] ``` +--- + ## Run Medusa Server Make sure the Strapi server is still running. If not, you can run the following command to run the Strapi server in the directory of the Strapi project: @@ -160,6 +172,8 @@ npm run start Once you start your Medusa server, if you ran the `--seed` command when you created your Medusa server, you’ll see that `product.created` events have been triggered along with similar events. This will update Strapi with the products you seeded. +--- + ## Test Two-Way Sync This plugin ensures a two-way sync between the Medusa server and the Strapi server. So, if you update data on Strapi, it will be reflected on your Medusa server, and vice-versa. @@ -172,7 +186,9 @@ Try updating any products on Strapi by going to Content Manager → Products and If you try to update products on Medusa either using the [REST APIs](https://docs.medusajs.com/api/admin/#tag/Product/operation/PostProductsProduct) or using [the Medusa Admin](../user-guide/products/manage.mdx), you’ll see that the product is also updated on Strapi. -## What’s Next +--- -- Learn [how to deploy the Medusa server](../deployments/server/index.mdx). -- Learn [how to create your own plugin](../advanced/backend/plugins/create.md). +## See Also + +- [Deploy the Medusa server](../deployments/server/index.mdx) +- [Create your own plugin](../advanced/backend/plugins/create.md) diff --git a/docs/content/add-plugins/stripe.md b/docs/content/add-plugins/stripe.md index 450ddd05ba..d657377050 100644 --- a/docs/content/add-plugins/stripe.md +++ b/docs/content/add-plugins/stripe.md @@ -18,10 +18,14 @@ You can also follow this video guide to learn how the setup works: Using the `medusa-payment-stripe` plugin, this guide shows you how to set up your Medusa project with Stripe as a payment provider. +--- + ## Prerequisites Before you proceed with this guide, make sure you create a [Stripe account](https://stripe.com). You’ll later retrieve the API Keys and secrets from your account to connect Medusa to your Stripe account. +--- + ## Medusa Server This section guides you over the steps necessary to add Stripe as a payment provider to your Medusa server. @@ -44,7 +48,7 @@ In `medusa-config.js` add the following at the end of the `plugins` array: ```jsx title=medusa-config.js const plugins = [ - ..., + // ... { resolve: `medusa-payment-stripe`, options: { @@ -52,7 +56,7 @@ const plugins = [ webhook_secret: process.env.STRIPE_WEBHOOK_SECRET, }, }, -]; +] ``` :::note @@ -71,7 +75,7 @@ You’ll first retrieve the API key. You can find it by choosing API Keys from t Next, you need to add the key to your environment variables. In your Medusa server, create `.env` if it doesn’t already exist and add the Stripe key: -```jsx +```bash STRIPE_API_KEY=sk_... ``` @@ -91,10 +95,12 @@ Then, you can add a description. You must select at least one event to listen to After the Webhook is created, you’ll see "Signing secret" in the Webhook details. Click on "Reveal" to reveal the secret key. Copy that key and in your Medusa server add the Webhook secret environment variable: -```jsx +```bash STRIPE_WEBHOOK_SECRET=whsec_... ``` +--- + ## Admin Setup This section will guide you through adding Stripe as a payment provider in a region using your Medusa admin dashboard. @@ -109,6 +115,8 @@ If you don’t have a Medusa admin installed, make sure to follow along with [th You can refer to [this documentation in the user guide](../user-guide/regions/providers.mdx#manage-payment-providers) to learn how to add a payment provider like Stripe to a region. +--- + ## Storefront Setup This guide will take you through how to set up Stripe payments in your Medusa storefront. It includes the steps necessary when using one of Medusa’s official storefronts as well as your own custom React-based storefront. @@ -187,30 +195,30 @@ In this section, you’ll initialize Stripe without Medusa’s checkout workflow Create a container component that will hold the payment card component: ```jsx -import { useState } from 'react'; +import { useState } from "react" -import {Elements} from '@stripe/react-stripe-js'; -import Form from './Form'; -import {loadStripe} from '@stripe/stripe-js'; +import { Elements } from "@stripe/react-stripe-js" +import Form from "./Form" +import { loadStripe } from "@stripe/stripe-js" -const stripePromise = loadStripe('pk_...'); +const stripePromise = loadStripe("pk_...") export default function Container() { const [clientSecret, setClientSecret] = useState() - //TODO set clientSecret + // TODO set clientSecret return (
{clientSecret && (
)}
- ); + ) }; ``` @@ -229,15 +237,19 @@ Once the clientSecret is set, the `Elements` Stripe component will wrap a `Form` Create a new file for the `Form` component with the following content: ```jsx -import {CardElement, useElements, useStripe} from '@stripe/react-stripe-js'; +import { + CardElement, + useElements, + useStripe, +} from "@stripe/react-stripe-js" -export default function Form({clientSecret, cartId}) { - const stripe = useStripe(); - const elements = useElements(); +export default function Form({ clientSecret, cartId }) { + const stripe = useStripe() + const elements = useElements() async function handlePayment(e) { e.preventDefault() - //TODO handle payment + // TODO handle payment } return ( @@ -245,7 +257,7 @@ export default function Form({clientSecret, cartId}) { - ); + ) }; ``` @@ -259,8 +271,8 @@ You’ll now implement the workflow explained earlier. You’ll use Medusa’s J import Medusa from "@medusajs/medusa-js" export default function Container() { - const client = new Medusa(); - ... + const client = new Medusa() + // ... } ``` @@ -274,19 +286,21 @@ Then, in the place of the `//TODO` inside the `Container` element, initialize th ```jsx client.carts.createPaymentSessions(cart.id) - .then(({cart}) => { - //check if stripe is selected - const isStripeAvailable = cart.payment_sessions?.some((session) => session.provider_id === 'stripe'); + .then(({ cart }) => { + // check if stripe is selected + const isStripeAvailable = cart.payment_sessions?.some((session) => ( + session.provider_id === "stripe" + )) if (!isStripeAvailable) { - return; + return } - //select stripe payment session + // select stripe payment session client.carts.setPaymentSession(cart.id, { - provider_id: 'stripe' - }).then(({cart}) => { - setClientSecret(cart.payment_session.data.client_secret); - }); + provider_id: "stripe", + }).then(({ cart }) => { + setClientSecret(cart.payment_session.data.client_secret) + }) }) ``` @@ -306,8 +320,8 @@ As you’ll use Medusa’s client again make sure to import it and initialize it import Medusa from "@medusajs/medusa-js" export default function Form() { - const client = new Medusa(); - ... + const client = new Medusa() + // ... } ``` @@ -327,12 +341,12 @@ return stripe.confirmCardPayment(clientSecret, { line1, line2, postal_code, - } - } - } + }, + }, + }, }).then(({ error, paymentIntent }) => { - //TODO handle errors - client.carts.complete(cartId).then(resp => console.log(resp)) + // TODO handle errors + client.carts.complete(cartId).then((resp) => console.log(resp)) }) ``` @@ -346,6 +360,8 @@ If you run your server and storefront now, you’ll see the Stripe UI element an ![Stripe Form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001190/Medusa%20Docs/Stripe/NOi8THw_xv3zsx.png) +--- + ## Capture Payments After the customer places an order, you’ll be able to see the order on the admin panel. In the payment information under the “Payment” section, you should see a “Capture” button. @@ -356,6 +372,8 @@ Clicking this button allows you to capture the payment for an order. You can als Refunding or Capturing payments is reflected in your Stripe’s dashboard as well. This gives you access to all of Stripe’s analytical capabilities. -## What’s Next +--- + +## See Also - Check out [more plugins](https://github.com/medusajs/medusa/tree/master/packages) you can add to your store. diff --git a/docs/content/add-plugins/twilio-sms.md b/docs/content/add-plugins/twilio-sms.md index eb2a7f1a7e..368c4c48df 100644 --- a/docs/content/add-plugins/twilio-sms.md +++ b/docs/content/add-plugins/twilio-sms.md @@ -14,16 +14,22 @@ This plugin only gives you access to the Twilio SMS API but does not implement s ::: +--- + ## Prerequisites -Before going further with this guide make sure you have a Medusa server set up. You can follow the [Quickstart guide](../quickstart/quick-start.md) if you don’t. +Before going further with this guide make sure you have a Medusa server set up. You can follow the [Quickstart guide](../quickstart/quick-start.mdx) if you don’t. You also must have a [Twilio account created](https://www.twilio.com/sms) so if you don’t already please go ahead and create one. +--- + ## Retrieve Credentials For the [Twilio SMS plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-plugin-twilio-sms), you need three credentials from your Twilio account: Account SID, Auth Token, and a Twilio phone number to send from. You can find these three from your [Twilio Console’s homepage](https://console.twilio.com). +--- + ## Install Plugin In the directory of your Medusa server, run the following command to install [Twilio SMS plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-plugin-twilio-sms): @@ -46,18 +52,20 @@ Finally, add the plugin and its options in the `medusa-config.js` file to the `p ```jsx title=medusa-config.js const plugins = [ - ..., + // ... { resolve: `medusa-plugin-twilio-sms`, options: { account_sid: process.env.TWILIO_SMS_ACCOUNT_SID, auth_token: process.env.TWILIO_SMS_AUTH_TOKEN, - from_number: process.env.TWILIO_SMS_FROM_NUMBER - } - } -]; + from_number: process.env.TWILIO_SMS_FROM_NUMBER, + }, + }, +] ``` +--- + ## Example Usage of the Plugin This plugin adds the service `twilioSmsService` to your Medusa server. To send SMS using it, all you have to do is resolve it in your file as explained in the [Services](../advanced/backend/services/create-service.md#using-your-custom-service) documentation. @@ -75,27 +83,27 @@ Create the file `src/services/sms.js` in your Medusa server with the following c ```jsx title=src/services/sms.js class SmsSubscriber { constructor({ twilioSmsService, orderService, eventBusService }) { - this.twilioSmsService_ = twilioSmsService; - this.orderService = orderService; + this.twilioSmsService_ = twilioSmsService + this.orderService = orderService - eventBusService.subscribe("order.placed", this.sendSMS); + eventBusService.subscribe("order.placed", this.sendSMS) } sendSMS = async (data) => { const order = await this.orderService.retrieve(data.id, { - relations: ['shipping_address'] - }); + relations: ["shipping_address"], + }) if (order.shipping_address.phone) { this.twilioSmsService_.sendSms({ to: order.shipping_address.phone, - body: 'We have received your order #' + data.id, + body: "We have received your order #" + data.id, }) } - }; + } } -export default SmsSubscriber; +export default SmsSubscriber ``` In the `constructor`, you resolve the `twilioSmsService` and `orderService` using dependency injection to use it later in the `sendSMS` method. @@ -110,7 +118,7 @@ If you create an order now on your storefront, you should receive a message from :::tip -If you don’t have a storefront set up yet, you can install one of the [Next.js](../starters/nextjs-medusa-starter.md) or [Gatsby](../starters/gatsby-medusa-starter.md) storefronts. +If you don’t have a storefront set up yet, you can install one of the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefronts. ::: @@ -122,7 +130,9 @@ If you’re on a Twilio trial make sure that the phone number you entered on che ![Twilio Dashboard](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001219/Medusa%20Docs/Stripe/MXtQMiL_kb7kxe.png) -## What’s Next +--- -- Learn more about how [Notifications work in Medusa](../advanced/backend/notification/overview.md). -- Install the [Medusa admin](../admin/quickstart.md) for functionalities like Gift Cards creation, swaps, claims, order return requests, and more. +## See Also + +- [Notifications Overview](../advanced/backend/notification/overview.md). +- Install the [Medusa admin](../admin/quickstart.mdx) for functionalities like Gift Cards creation, swaps, claims, order return requests, and more. diff --git a/docs/content/admin/development.md b/docs/content/admin/development.md index cd9763d11c..21e10cebdc 100644 --- a/docs/content/admin/development.md +++ b/docs/content/admin/development.md @@ -94,7 +94,7 @@ If your forked repository doesn’t have any conflicts with the changes from the --- -## What’s Next +## See Also -- Check out the [Admin API reference](/api/admin). -- Learn about [local development of the Medusa server](../usage/local-development.md). +- [Admin API reference](/api/admin). +- [Local development of the Medusa server](../usage/local-development.md). diff --git a/docs/content/admin/quickstart.md b/docs/content/admin/quickstart.mdx similarity index 84% rename from docs/content/admin/quickstart.md rename to docs/content/admin/quickstart.mdx index 45c502cf42..9c164ad337 100644 --- a/docs/content/admin/quickstart.md +++ b/docs/content/admin/quickstart.mdx @@ -1,3 +1,5 @@ +import Feedback from '@site/src/components/Feedback'; + # Medusa Admin Quickstart This document will guide you through setting up the Medusa admin in minutes, as well as some of its features. @@ -24,6 +26,8 @@ node -v You can install Node from the [official website](https://nodejs.org/en/). +--- + ## Instant Deployment to Netlify Instead of manually following this guide to install then later deploy the Medusa Admin, you can deploy the Medusa Admin to Netlify with this button: @@ -32,6 +36,8 @@ Instead of manually following this guide to install then later deploy the Medusa Deploy to Netlify +--- + ## Install the Admin :::tip @@ -53,6 +59,21 @@ Then, install the dependencies: npm install ``` + + +:::tip + +If you run into errors during the installation, check out [this troubleshooting guide](../troubleshooting/common-installation-errors.mdx). + +::: + +--- + ## Test it Out Before running your Medusa admin, make sure that your Medusa server is running. @@ -91,6 +112,8 @@ You can use the email `admin@medusa-test.com` and password `supersecret` to log ::: +--- + ## Create a New Admin User To create a new admin user from the command line, run the following command in the directory holding your Medusa server: @@ -101,6 +124,8 @@ medusa user -e some@email.com -p some-password This will create a new user that you can use to log into your admin panel. +--- + ## Changing the Default Port The default port is set in `package.json` in the `dev` script: @@ -127,14 +152,18 @@ For more details about the Admin CORS configuration, check out the [Configure yo ::: +--- + ## Admin User Guide Medusa admin provides a lot of ecommerce features including managing Return Merchandise Authorization (RMA) flows, store settings, products, orders, and much more. You can learn more about Medusa admin and its features in the [User Guide](../user-guide/index.mdx). -## What’s Next +--- -- Learn how to [Customize Medusa Admin](./development.md) -- Install the [Next.js](../starters/nextjs-medusa-starter.md) or [Gatsby](../starters/gatsby-medusa-starter.md) storefront starters. -- [Learn how you can use `create-medusa-app` to install all of Medusa’s 3 components.](../usage/create-medusa-app.mdx) +## See Also + +- [Customize Medusa Admin](./development.md) +- Install the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefront starters. +- [Use `create-medusa-app` to install all of Medusa’s 3 components.](../usage/create-medusa-app.mdx) diff --git a/docs/content/advanced/admin/import-prices.mdx b/docs/content/advanced/admin/import-prices.mdx index 25f6abd675..3fe74fe75c 100644 --- a/docs/content/advanced/admin/import-prices.mdx +++ b/docs/content/advanced/admin/import-prices.mdx @@ -15,11 +15,13 @@ Importing prices into a price list removes all existing prices in the price list ::: +--- + ## Prerequisites ### Medusa Components -It is assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.md) to get started. +It is assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.mdx) to get started. ### Redis @@ -54,6 +56,8 @@ Before importing the prices, you must have a price list to import them to. You can use the [Create Price List](https://docs.medusajs.com/api/admin/#tag/Price-List/operation/PostPriceListsPriceList) endpoint, or follow the [how-to guide to learn how to create and manage price lists using the Admin API](../backend/price-lists/use-api.mdx). +--- + ## 1. Upload CSV File The first step is to upload the CSV file to import prices from. @@ -64,31 +68,31 @@ You can do that by sending the following request to the [Upload Files](https://d ```jsx -medusa.admin.uploads.create(file) //file is an instance of File +medusa.admin.uploads.create(file) // file is an instance of File .then(({ uploads }) => { - const key = uploads[0].key; -}); + const key = uploads[0].key +}) ``` ```jsx -const formData = new FormData(); -formData.append('files', file); //file is an instance of File +const formData = new FormData() +formData.append("files", file) // file is an instance of File fetch(`/admin/uploads`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'multipart/form-data', + "Content-Type": "multipart/form-data", }, - body: formData + body: formData, }) .then((response) => response.json()) .then(({ uploads }) => { - const key = uploads[0].key; -}); + const key = uploads[0].key +}) ``` @@ -106,6 +110,8 @@ curl -L -X POST '/admin/uploads' \ This request returns an array of uploads. Each item in the array is an object that includes the properties `url` and `key`. You’ll need the `key` to import the prices next. +--- + ## 2. Create a Batch Job for Prices Import To start a new price import, you must create a batch job. @@ -117,16 +123,16 @@ You can do that by sending the following request to the [Create a Batch Job](htt ```jsx medusa.admin.batchJobs.create({ - type: 'price-list-import', + type: "price-list-import", context: { - fileKey: key, //obtained from previous step - price_list_id + fileKey: key, // obtained from previous step + price_list_id, }, - dry_run: true + dry_run: true, }) .then(( batch_job ) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -134,24 +140,24 @@ medusa.admin.batchJobs.create({ ```jsx fetch(`/admin/batch-jobs`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - type: 'price-list-import', + type: "price-list-import", context: { - fileKey: key, //obtained from previous step - price_list_id + fileKey: key, // obtained from previous step + price_list_id, }, - dry_run: true - }) + dry_run: true, + }), }) .then((response) => response.json()) .then(({ batch_job }) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -192,6 +198,8 @@ If you don’t set `dry_run` or you set it to `false`, you don’t need to follo ::: +--- + ## (Optional) Retrieve Batch Job After creating the batch job, it will be pre-processed. At this point, the CSV file will be validated, and the number of prices to add are counted. @@ -204,8 +212,8 @@ You can retrieve all the details of the batch job, including its status and the ```jsx medusa.admin.batchJobs.retrieve(batchJobId) .then(( batch_job ) => { - console.log(batch_job.status, batch_job.result); -}); + console.log(batch_job.status, batch_job.result) +}) ``` @@ -213,12 +221,12 @@ medusa.admin.batchJobs.retrieve(batchJobId) ```jsx fetch(`/admin/batch-jobs/${batchJobId}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ batch_job }) => { - console.log(batch_job.status, batch_job.result); -}); + console.log(batch_job.status, batch_job.result) +}) ``` @@ -249,10 +257,12 @@ Here’s an example of the `result` property: "message": "5 prices will be added" } ], - "advancement_count": 0 //number of prices processed so far. Will be 0 before the import is confirmed. + "advancement_count": 0 //number of prices processed so far. }, ``` +--- + ## 3. Confirm Batch Job A batch job can be confirmed only once the batch job has the status `pre_processed`. Once you confirm a batch job, the price import will start which will add prices to the price list @@ -265,8 +275,8 @@ To confirm a batch job send the following request: ```jsx medusa.admin.batchJobs.confirm(batchJobId) .then(( batch_job ) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -274,13 +284,13 @@ medusa.admin.batchJobs.confirm(batchJobId) ```jsx fetch(`/admin/batch-jobs/${batchJobId}/confirm`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", }) .then((response) => response.json()) .then(({ batch_job }) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -305,7 +315,9 @@ After confirming the batch job, you can check the status while it is processing - If the status is `failed`, it means an error has occurred during the import. You can check the error in `result.errors`. - If the status is `completed`, it means the import has finished successfully. -## What’s Next 🚀 +--- -- Learn more about [Batch Jobs and how they work](../backend/batch-jobs/index.md). -- Check out the [Batch Jobs API Reference](https://docs.medusajs.com/api/admin/#tag/Batch-Job). \ No newline at end of file +## See Also + +- [Batch Jobs Overview](../backend/batch-jobs/index.md) +- [Batch Jobs API Reference](https://docs.medusajs.com/api/admin/#tag/Batch-Job) diff --git a/docs/content/advanced/admin/import-products.mdx b/docs/content/advanced/admin/import-products.mdx index 7d2e3cc2c5..ee9074d0ca 100644 --- a/docs/content/advanced/admin/import-products.mdx +++ b/docs/content/advanced/admin/import-products.mdx @@ -9,11 +9,13 @@ In this document, you’ll learn how to use the Admin APIs to bulk import produc Using Medusa’s [Batch Job Admin APIs](https://docs.medusajs.com/api/admin/#tag/Batch-Job), you can import products into your Medusa server. This will either add new products or update existing products. +--- + ## Prerequisites ### Medusa Components -It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.md) to get started. +It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.mdx) to get started. ### Redis @@ -48,6 +50,8 @@ You must be an authenticated admin user before following along with the steps in You can learn more about [authenticating as an admin user in the API reference](/api/admin/#section/Authentication). +--- + ## 1. Upload CSV File The first step is to upload the CSV file that you want to import products. @@ -58,31 +62,31 @@ You can do that by sending the following request to the [Upload Files](https://d ```jsx -medusa.admin.uploads.create(file) //file is an instance of File +medusa.admin.uploads.create(file) // file is an instance of File .then(({ uploads }) => { - const key = uploads[0].key; -}); + const key = uploads[0].key +}) ``` ```jsx -const formData = new FormData(); -formData.append('files', file); //file is an instance of File +const formData = new FormData() +formData.append("files", file) // file is an instance of File fetch(`/admin/uploads`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'multipart/form-data', + "Content-Type": "multipart/form-data", }, - body: formData + body: formData, }) .then((response) => response.json()) .then(({ uploads }) => { - const key = uploads[0].key; -}); + const key = uploads[0].key +}) ``` @@ -100,6 +104,8 @@ curl -L -X POST '/admin/uploads' \ This request returns an array of uploads. Each item in the array is an object that includes the properties `url` and `key`. You’ll need the `key` to import the products next. +--- + ## 2. Create a Batch Job for Product Import To start a new product import, you must create a batch job. @@ -111,15 +117,15 @@ You can do that by sending the following request to the [Create a Batch Job](htt ```jsx medusa.admin.batchJobs.create({ - type: 'product-import', + type: "product-import", context: { - fileKey: key //obtained from previous step + fileKey: key, // obtained from previous step }, - dry_run: true + dry_run: true, }) .then(( batch_job ) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -127,23 +133,23 @@ medusa.admin.batchJobs.create({ ```jsx fetch(`/admin/batch-jobs`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - type: 'product-import', + type: "product-import", context: { - fileKey: key //obtained from previous step + fileKey: key, // obtained from previous step }, - dry_run: true - }) + dry_run: true, + }), }) .then((response) => response.json()) .then(({ batch_job }) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -180,6 +186,8 @@ If you don’t set `dry_run` or you set it to `false`, you don’t need to follo ::: +--- + ## (Optional) Retrieve Batch Job After creating the batch job, it will be pre-processed. At this point, the CSV file will be validated, and the number of products to add and update, or that are rejected are counted. @@ -192,8 +200,8 @@ You can retrieve all the details of the batch job, including its status and the ```jsx medusa.admin.batchJobs.retrieve(batchJobId) .then(( batch_job ) => { - console.log(batch_job.status, batch_job.result); -}); + console.log(batch_job.status, batch_job.result) +}) ``` @@ -201,12 +209,12 @@ medusa.admin.batchJobs.retrieve(batchJobId) ```jsx fetch(`/admin/batch-jobs/${batchJobId}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ batch_job }) => { - console.log(batch_job.status, batch_job.result); -}); + console.log(batch_job.status, batch_job.result) +}) ``` @@ -234,13 +242,15 @@ Here’s an example of the `result` property: { "key": "product-import-count", "name": "Products/variants to import", - "message": "There will be 2 products created (0 updated).\n 3 variants will be created and 0 updated" + "message": "There will be 2 products created..." } ], - "advancement_count": 0 //number of products processed so far. Will be 0 before the import is confirmed. + "advancement_count": 0 //number of products processed so far. }, ``` +--- + ## 3. Confirm Batch Job A batch job can be confirmed only once the batch job has the status `pre_processed`. Once you confirm a batch job, the product import will start which will create or update products on your server. @@ -253,8 +263,8 @@ To confirm a batch job send the following request: ```jsx medusa.admin.batchJobs.confirm(batchJobId) .then(( batch_job ) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -262,13 +272,13 @@ medusa.admin.batchJobs.confirm(batchJobId) ```jsx fetch(`/admin/batch-jobs/${batchJobId}/confirm`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", }) .then((response) => response.json()) .then(({ batch_job }) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -293,7 +303,9 @@ After confirming the batch job, you can check the status while it is processing - If the status is `failed`, it means an error has occurred during the import. You can check the error in `result.errors`. - If the status is `completed`, it means the import has finished successfully. -## What’s Next +--- -- Learn more about [Batch Jobs and how they work](../backend/batch-jobs/index.md). -- Check out the [Batch Jobs API Reference](https://docs.medusajs.com/api/admin/#tag/Batch-Job). +## See Also + +- [Batch Jobs Overview](../backend/batch-jobs/index.md) +- [Batch Jobs API Reference](https://docs.medusajs.com/api/admin/#tag/Batch-Job) diff --git a/docs/content/advanced/admin/manage-customers.mdx b/docs/content/advanced/admin/manage-customers.mdx new file mode 100644 index 0000000000..3d250b8f07 --- /dev/null +++ b/docs/content/advanced/admin/manage-customers.mdx @@ -0,0 +1,230 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# How to Manage Customers + +In this document, you’ll learn how to implement customer management functionalities for admin users. + +## Overview + +Using the customer admin REST APIs, you can manage customers, including creating, updating, and listing them. + +### Scenario + +You want to add or use the following admin functionalities: + +- List customers +- Add a new customer +- Edit a customer’s details + +--- + +## Prerequisites + +### Medusa Components + +It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.mdx) to get started. + +### JS Client + +This guide includes code snippets to send requests to your Medusa server using Medusa’s JS Client, JavaScript’s Fetch API, or cURL. + +If you follow the JS Client code blocks, it’s assumed you already have [Medusa’s JS Client](../../js-client/overview.md) installed and have [created an instance of the client](../../js-client/overview.md#configuration). + +### Authenticated Admin User + +You must be an authenticated admin user before following along with the steps in the tutorial. + +You can learn more about [authenticating as an admin user in the API reference](/api/admin/#section/Authentication). + +--- + +## List Customers + +You can show a list of customers by sending a request to the [List Customers](/api/admin/#tag/Customer/operation/GetCustomers) endpoint: + + + + +```ts +medusa.admin.customers.list() +.then(({ customers, limit, offset, count }) => { + console.log(customers.length) +}) +``` + + + + +```ts +fetch(`/admin/customers`, { + credentials: "include", +}) +.then((response) => response.json()) +.then(({ customers, limit, offset, count }) => { + console.log(customers.length) +}) +``` + + + + +```bash +curl -L -X GET '/admin/customers' \ +-H 'Authorization: Bearer ' +``` + + + + +This request doesn’t require any path or query parameters. You can pass it optional parameters used for filtering and pagination. Check out the [API reference](/api/admin/#tag/Customer/operation/GetCustomers) to learn more. + +This request returns the following data in the response: + +- `customers`: An array of customers. +- `limit`: The maximum number of customers that can be returned in the request. +- `offset`: The number of customers skipped in the result. +- `count`: The total number of customers available. + +:::info + +You can learn more about pagination in the [API reference](/api/admin/#section/Pagination). + +::: + +--- + +## Create a Customer + +Admins can create customer accounts. They have to supply the customer’s credentials and basic info. + +You can create a customer account by sending a request to the [Create a Customer](/api/admin/#tag/Customer/operation/PostCustomers) endpoint: + + + + +```ts +medusa.admin.customers.create({ + email, + password, + first_name, + last_name, +}) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```ts +fetch(`/admin/customers`, { + method: "POST", + credentials: "include", + body: JSON.stringify({ + email, + password, + first_name, + last_name, + }), +}) +.then((response) => response.json()) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```bash +curl -L -X POST '/admin/customers' \ +-H 'Authorization: Bearer ' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "email": "", + "first_name": "", + "last_name": "", + "password": "" +}' +``` + + + + +This request requires the following body parameters: + +- `email`: The email of the customer. +- `password`: The password of the customer. +- `first_name`: The customer’s first name. +- `last_name`: the customer’s last name. + +You can also pass other optional parameters. To learn more, check out the [API reference](/api/admin/#tag/Customer/operation/PostCustomers). + +The request returns the created customer object in the response. + +--- + +## Edit Customer’s Information + +An admin can edit a customer’s basic information and credentials. + +You can edit a customer’s information by sending a request to the [Update a Customer](/api/admin/#tag/Customer/operation/PostCustomersCustomer) endpoint: + + + + +```ts +medusa.admin.customers.update(customerId, { + first_name, +}) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```ts +fetch(`/admin/customers/${customerId}`, { + method: "POST", + credentials: "include", + body: JSON.stringify({ + first_name, + }), +}) +.then((response) => response.json()) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```bash +curl -L -X POST '/admin/customers/' \ +-H 'Authorization: Bearer ' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "first_name": "" +}' +``` + + + + +This request accepts any of the customer’s fields as body parameters. In this example, you update the customer’s first name. You can learn more about accepted body parameters in the [API reference](/api/admin/#tag/Customer/operation/PostCustomersCustomer). + +This request returns the updated customer object in the response. + +--- + +## See Also + +- [Manage customer groups](./use-customergroups-api.mdx) +- [Customers admin API reference](/api/admin) +- [Customers overview](../backend/customers/index.md) +- [Implement customer profiles in the storefront](../storefront/customer-profiles.mdx) diff --git a/docs/content/advanced/admin/manage-discounts.mdx b/docs/content/advanced/admin/manage-discounts.mdx index 26a2a5f21b..c3a148e7b1 100644 --- a/docs/content/advanced/admin/manage-discounts.mdx +++ b/docs/content/advanced/admin/manage-discounts.mdx @@ -1,7 +1,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Manage Discounts using Admin APIs +# How to Manage Discounts using Admin APIs In this document, you’ll learn how to use the Admin’s Discount APIs to manage discounts, discount conditions, and more. @@ -29,11 +29,13 @@ You can use Medusa’s Admin APIs to achieve more functionalities as well. Check ::: +--- + # Prerequisites ### Medusa Components -It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.md) to get started. +It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.mdx) to get started. ### JS Client @@ -47,6 +49,8 @@ You must be an authenticated admin user before following along with the steps in You can learn more about [authenticating as an admin user in the API reference](/api/admin/#section/Authentication). +--- + ## Create a Discount You can create a discount by sending a request to the [Create Discount](/api/admin/#tag/Discount/operation/PostDiscounts) endpoint: @@ -56,21 +60,21 @@ You can create a discount by sending a request to the [Create Discount](/api/adm ```jsx import { AllocationType, DiscountRuleType } from "@medusajs/medusa" -//... +// ... medusa.admin.discounts.create({ code, rule: { type: DiscountRuleType.FIXED, value: 10, - allocation: AllocationType.ITEM + allocation: AllocationType.ITEM, }, regions: [ - regionId - ] + regionId, + ], }) .then(({ discount }) => { - console.log(discount.id); -}); + console.log(discount.id) +}) ``` @@ -78,27 +82,27 @@ medusa.admin.discounts.create({ ```jsx fetch(`/admin/discounts`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ code, rule: { - type: 'fixed', + type: "fixed", value: 10, - allocation: 'item' + allocation: "item", }, regions: [ - regionId - ] - }) + regionId, + ], + }), }) .then((response) => response.json()) .then(({ discount }) => { - console.log(discount.id); -}); + console.log(discount.id) +}) ``` @@ -135,6 +139,8 @@ This request accepts [many request-body parameters](/api/admin/#tag/Discount/ope This request returns the full `discount` object. +--- + ## Update Discount You can update any of the discount’s information, configurations, and conditions by sending a request to the [Update Discount](/api/admin/#tag/Discount/operation/PostDiscountsDiscount) endpoint. @@ -147,11 +153,11 @@ For example, you can update the discount’s description and status by sending t ```jsx medusa.admin.discounts.update(discountId, { description: "New description", - is_disabled: true + is_disabled: true, }) .then(({ discount }) => { - console.log(discount.id); -}); + console.log(discount.id) +}) ``` @@ -159,20 +165,20 @@ medusa.admin.discounts.update(discountId, { ```jsx fetch(`/admin/discounts/${discountId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ description: "New description", - is_disabled: true - }) + is_disabled: true, + }), }) .then((response) => response.json()) .then(({ discount }) => { - console.log(discount.id); -}); + console.log(discount.id) +}) ``` @@ -197,6 +203,8 @@ You can check the [API reference](/api/admin/#tag/Discount/operation/PostDiscoun This updates the discount’s information and returns the full updated `discount` object in the response. +--- + ## Manage Conditions ### Create a Condition @@ -214,16 +222,16 @@ You can send a request to the [Create Condition](/api/admin/#tag/Discount-Condit ```jsx import { DiscountConditionOperator } from "@medusajs/medusa" -//... +// ... medusa.admin.discounts.createCondition(discount_id, { operator: DiscountConditionOperator.IN, products: [ - productId - ] + productId, + ], }) .then(({ discount }) => { - console.log(discount.id); -}); + console.log(discount.id) +}) ``` @@ -231,22 +239,22 @@ medusa.admin.discounts.createCondition(discount_id, { ```jsx fetch(`/admin/discounts/${discountId}/conditions`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - operator: 'in', + operator: "in", products: [ - productId - ] - }) + productId, + ], + }), }) .then((response) => response.json()) .then(({ discount }) => { - console.log(discount.id); -}); + console.log(discount.id) +}) ``` @@ -293,24 +301,28 @@ You can retrieve a condition and its resources by sending a request to the [Get ```jsx medusa.admin.discounts.getCondition(discountId, conditionId, { - expand: 'products' + expand: "products", }) .then(({ discount_condition }) => { - console.log(discount_condition.id, discount_condition.products); -}); + console.log(discount_condition.id, discount_condition.products) +}) ``` ```jsx -fetch(`/admin/discounts/${discountId}/conditions/${conditionId}&expand=products`, { - credentials: 'include' -}) +fetch( + `/admin/discounts/${discountId}` + + `/conditions/${conditionId}&expand=products`, + { + credentials: "include", + } +) .then((response) => response.json()) .then(({ discount_condition }) => { - console.log(discount_condition.id, discount_condition.products); -}); + console.log(discount_condition.id, discount_condition.products) +}) ``` @@ -343,35 +355,38 @@ For example, to update the products in a condition: medusa.admin.discounts.updateCondition(discountId, conditionId, { products: [ productId1, - productId2 - ] + productId2, + ], }) .then(({ discount }) => { - console.log(discount.id); -}); + console.log(discount.id) +}) ``` ```jsx -fetch(`/admin/discounts/${discountId}/conditions/${conditionId}`, { - method: 'POST', - credentials: 'include', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - products: [ - productId1, - productId2 - ] - }) -}) +fetch( + `/admin/discounts/${discountId}/conditions/${conditionId}`, + { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + products: [ + productId1, + productId2, + ], + }), + } +) .then((response) => response.json()) .then(({ discount }) => { - console.log(discount.id); -}); + console.log(discount.id) +}) ``` @@ -408,22 +423,25 @@ You can delete a condition by sending a request to the [Delete Condition](/api/a ```jsx medusa.admin.discounts.deleteCondition(discountId, conditionId) .then(({ discount }) => { - console.log(discount); -}); + console.log(discount) +}) ``` ```jsx -fetch(`/admin/discounts/${discountId}/conditions/${conditionId}`, { - method: 'DELETE', - credentials: 'include' -}) +fetch( + `/admin/discounts/${discountId}/conditions/${conditionId}`, + { + method: "DELETE", + credentials: "include", + } +) .then((response) => response.json()) .then(({ discount }) => { - console.log(discount.id); -}); + console.log(discount.id) +}) ``` @@ -441,6 +459,8 @@ This request accepts as a path parameter the discount ID and the condition ID. It returns the `discount` object in the response. +--- + ## Delete Discount You can delete a discount by sending a request to the [Delete Discount](/api/admin/#tag/Discount/operation/DeleteDiscountsDiscount) endpoint: @@ -451,8 +471,8 @@ You can delete a discount by sending a request to the [Delete Discount](/api/adm ```jsx medusa.admin.discounts.delete(discount_id) .then(({ id, object, deleted }) => { - console.log(id); -}); + console.log(id) +}) ``` @@ -460,13 +480,13 @@ medusa.admin.discounts.delete(discount_id) ```jsx fetch(`/admin/discounts/${discountId}`, { - method: 'DELETE', - credentials: 'include' + method: "DELETE", + credentials: "include", }) .then((response) => response.json()) .then(({ id, object, deleted }) => { - console.log(id); -}); + console.log(id) +}) ``` @@ -488,7 +508,9 @@ It returns in the response the following fields: - `object`: A string indicating the type of object deleted. By default, its value is `discount`. - `deleted`: A boolean value indicating whether the discount was deleted or not. -## What’s Next +--- -- Check out more [Admin Discount APIs in the API reference](/api/admin/#tag/Discount). -- Learn how you can [use Discounts on the storefront](../storefront/use-discounts-in-checkout.mdx). +## See Also + +- [Discounts API reference](/api/admin/#tag/Discount) +- [Use Discounts on the storefront](../storefront/use-discounts-in-checkout.mdx) diff --git a/docs/content/advanced/admin/manage-regions.mdx b/docs/content/advanced/admin/manage-regions.mdx index 20d6c0961e..52def1da8e 100644 --- a/docs/content/advanced/admin/manage-regions.mdx +++ b/docs/content/advanced/admin/manage-regions.mdx @@ -1,7 +1,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Manage Regions using Admin APIs +# How to Manage Regions using Admin APIs In this document, you’ll learn how to manage regions using the Admin APIs. @@ -31,7 +31,7 @@ You can use Medusa’s Admin APIs to achieve more functionalities as well. Check ### Medusa Components -It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.md) to get started. +It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.mdx) to get started. ### JS Client @@ -57,9 +57,9 @@ You can retrieve regions available on your server using the [List Regions](/api/ ```tsx medusa.admin.regions.list() .then(({ regions, limit, offset, count }) => { - console.log(regions.length); - //display regions -}); + console.log(regions.length) + // display regions +}) ``` @@ -67,13 +67,13 @@ medusa.admin.regions.list() ```tsx fetch(`/admin/regions`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ regions, limit, offset, count }) => { - console.log(regions.length); - //display regions -}); + console.log(regions.length) + // display regions +}) ``` @@ -102,22 +102,22 @@ You can create a region by sending a request to the [Create a Region](/api/admin ```tsx medusa.admin.regions.create({ - name: 'Europe', - currency_code: 'eur', + name: "Europe", + currency_code: "eur", tax_rate: 0, payment_providers: [ - 'manual' + "manual", ], fulfillment_providers: [ - 'manual' + "manual", ], countries: [ - 'DK' - ] + "DK", + ], }) .then(({ region }) => { - console.log(region.id); -}); + console.log(region.id) +}) ``` @@ -125,27 +125,27 @@ medusa.admin.regions.create({ ```tsx fetch(`/admin/regions`, { - credentials: 'include', - method: 'POST', + credentials: "include", + method: "POST", body: JSON.stringify({ - name: 'Europe', - currency_code: 'eur', + name: "Europe", + currency_code: "eur", tax_rate: 0, payment_providers: [ - 'manual' + "manual", ], fulfillment_providers: [ - 'manual' + "manual", ], countries: [ - 'DK' - ] - }) + "DK", + ], + }), }) .then((response) => response.json()) .then(({ region }) => { - console.log(region.id); -}); + console.log(region.id) +}) ``` @@ -202,12 +202,12 @@ Alternatively, you can update the details of a region using the [Update a Region medusa.admin.regions.update(regionId, { countries: [ "DK", - "DE" - ] + "DE", + ], }) .then(({ region }) => { - console.log(region.id); -}); + console.log(region.id) +}) ``` @@ -215,25 +215,25 @@ medusa.admin.regions.update(regionId, { ```tsx fetch(`/admin/regions/${regionId}`, { - credentials: 'include', - method: 'POST', + credentials: "include", + method: "POST", body: JSON.stringify({ countries: [ - 'DK', - 'DE' - ] - }) + "DK", + "DE", + ], + }), }) .then((response) => response.json()) .then(({ region }) => { - console.log(region.id); -}); + console.log(region.id) +}) ``` -```tsx +```bash curl -L -X POST '/admin/regions/' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ @@ -271,17 +271,17 @@ You can add a shipping option to a region by sending a request to the [Create Sh ```tsx medusa.admin.shippingOptions.create({ - name: 'PostFake', + name: "PostFake", region_id: regionId, provider_id: "manual", data: { }, - price_type: 'flat_rate', - amount: 1000 + price_type: "flat_rate", + amount: 1000, }) .then(({ shipping_option }) => { - console.log(shipping_option.id); -}); + console.log(shipping_option.id) +}) ``` @@ -289,28 +289,28 @@ medusa.admin.shippingOptions.create({ ```tsx fetch(`/admin/shipping-options`, { - credentials: 'include', - method: 'POST', + credentials: "include", + method: "POST", body: JSON.stringify({ - name: 'PostFake', + name: "PostFake", region_id: regionId, provider_id: "manual", - price_type: 'flat_rate', + price_type: "flat_rate", data: { }, - amount: 1000 - }) + amount: 1000, + }), }) .then((response) => response.json()) .then(({ shipping_option }) => { - console.log(shipping_option.id); -}); + console.log(shipping_option.id) +}) ``` -```tsx +```bash curl -L -X POST '/admin/shipping-options' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ @@ -360,8 +360,8 @@ You can delete a region by sending a request to the [Delete a Region](/api/admin ```tsx medusa.admin.regions.delete(regionId) .then(({ id, object, deleted }) => { - console.log(id); -}); + console.log(id) +}) ``` @@ -369,19 +369,19 @@ medusa.admin.regions.delete(regionId) ```tsx fetch(`/admin/regions/${regionId}`, { - credentials: 'include', - method: 'DELETE' + credentials: "include", + method: "DELETE", }) .then((response) => response.json()) .then(({ id, object, deleted }) => { - console.log(id); -}); + console.log(id) +}) ``` -```tsx +```bash curl -L -X DELETE '/admin/regions/' \ -H 'Authorization: Bearer ' ``` @@ -397,7 +397,7 @@ This request requires the region ID as a path parameter. It deletes the region a --- -## What’s Next +## See Also -- Learn more about [Regions’ architecture](../backend/regions/overview.md). -- Learn [how to use Regions on the storefront](../storefront/use-regions.mdx). \ No newline at end of file +- [Regions Overview](../backend/regions/overview.md) +- [Use Regions on the storefront](../storefront/use-regions.mdx) \ No newline at end of file diff --git a/docs/content/advanced/admin/order-edit.mdx b/docs/content/advanced/admin/order-edit.mdx new file mode 100644 index 0000000000..dfc73fe224 --- /dev/null +++ b/docs/content/advanced/admin/order-edit.mdx @@ -0,0 +1,616 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# How to Edit an Order + +In this document, you’ll learn how to create an order edit using the Admin API endpoints. + +:::note + +The Order Editing feature is currently in beta mode and guarded by a feature flag. To use Order Editing either: + +1. Enable the `MEDUSA_FF_ORDER_EDITING` environment variable; +2. Or enable the `order_editing` key in the Medusa server's settings. + +You can learn more about enabling it in the [feature flags](../backend/feature-flags/toggle.md) documentation. + +::: + +## Overview + +The Admin API can be used to edit a customer’s order using the Order Editing feature. + +The following changes can be made on an order: + +- Add a new item to the original order +- Edit an item’s quantity in the original order. +- Delete an item from the original order. + +Medusa then takes care of the calculation of subtotals, taxes, and more. + +The Order Edit can then either be confirmed using the Storefront API as a customer, or force-confirmed using the Admin API as a merchant. + +The changes are only reflected on the original order once the Order Edit is confirmed. + +![Order edit documentation](https://res.cloudinary.com/dza7lstvk/image/upload/v1671719712/Medusa%20Docs/Diagrams/Order_Edits_xvquwc.jpg) + +### Scenario + +You want to add or use the following admin functionalities related to Order Editing: + +- Create an order edit. +- Add, edit, and delete items from an order. +- Revert an item change in an order edit. +- Move order edit into request state. +- Force-confirm an order edit. + +:::note + +You can perform other functionalities related to order editing. To learn more, check out the [API reference](/api/admin/#tag/OrderEdit). + +::: + +--- + +## Prerequisites + +### Medusa Components + +It is assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.mdx) to get started. + +### JS Client + +This guide includes code snippets to send requests to your Medusa server using Medusa’s JS Client, JavaScript’s Fetch API, or cURL. + +If you follow the JS Client code blocks, it’s assumed you already have [Medusa’s JS Client](../../js-client/overview.md) installed and have [created an instance of the client](../../js-client/overview.md#configuration). + +### Authenticated Admin User + +You must be an authenticated admin user before following along with the steps in the tutorial. + +You can learn more about [authenticating as an admin user in the API reference](/api/admin/#section/Authentication). + +### Previous Steps + +You must have an existing order that you want to edit. + +--- + +## Create an Order Edit + +Before you can start making changes to an order, you have to create a new order edit. + +To do that, send a request to the [Create an OrderEdit](/api/admin/#tag/OrderEdit/operation/PostOrderEdits) endpoint: + + + + +```ts +medusa.admin.orderEdits.create({ + order_id, // required +}) +.then(({ order_edit }) => { + console.log(order_edit.id) +}) +``` + + + + +```ts +fetch(`/admin/order-edits`, { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + order_id, + }), +}) +.then((response) => response.json()) +.then(({ order_edit }) => { + console.log(order_edit.id) +}) +``` + + + + +```bash +curl -L -X POST '/admin/order-edits' \ +-H 'Authorization: Bearer ' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "order_id": "" +}' +``` + + + + +This endpoint has one required request body parameter `order_id` which is the ID of the order this edit is being created for. + +This request returns the Order Edit under the `order_edit` property. + +:::info + +You can only create one Order Edit at a time. So, if you try to create a new Order Edit for an order that is already being edited, you will receive an error. + +:::info + +--- + +## Make Changes to an Order’s Items + +You can add new items into the original order, edit existing item in the original order, or delete items in the original order. + +:::info + +You can only make changes to items that have not been fulfilled yet in the order. + +::: + +### Add an Item + +To add a new item to the original order, send a request to the [Add Line Item](/api/admin/#tag/OrderEdit/operation/PostOrderEditsEditLineItems) endpoint: + + + + +```ts +medusa.admin.orderEdits.addLineItem(orderEditId, { + quantity: 1, + variant_id, +}) +.then(({ order_edit }) => { + console.log(order_edit.changes) +}) +``` + + + + +```ts +fetch(`/admin/order-edits/${orderEditId}/items`, { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + quantity: 1, + variant_id, + }), +}) +.then((response) => response.json()) +.then(({ order_edit }) => { + console.log(order_edit.changes) +}) +``` + + + + +```bash +curl -L -X POST '/admin/order-edits//items' \ +-H 'Authorization: Bearer ' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "quantity": 1, + "variant_id": "" +}' +``` + + + + +This request requires the ID of the order edit as a path parameter. + +In the body of the request, you pass the two parameters `quantity` and `variant_id` which will be used to add a new item into the original order. + +This request returns the Order Edit object. You can access returned item changes using `order_edit.changes`. + +### Update an Item + +You can edit an item’s quantity in the original order. + +To update an item, send a request to the [Update Line Item](/api/admin/#tag/OrderEdit/operation/PostOrderEditsEditLineItemsLineItem) endpoint: + + + + +```ts +medusa.admin.orderEdits.updateLineItem(orderEditId, itemId, { + quantity: 2, +}) +.then(({ order_edit }) => { + console.log(order_edit.changes) +}) +``` + + + + +```ts +fetch(`/admin/order-edits/${orderEditId}/items/${itemId}`, { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + quantity: 2, + }), +}) +.then((response) => response.json()) +.then(({ order_edit }) => { + console.log(order_edit.changes) +}) +``` + + + + +```bash +curl -L -X POST '/admin/order-edits//items/' \ +-H 'Authorization: Bearer ' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "quantity": 2 +}' +``` + + + + +This request requires the ID of the order edit and the ID of the item in the original order as path parameters. + +In the body of the request, you can pass the `quantity` parameter, with its value being the new item quantity. In this example, you change the quantity of the item to `2`. + +This request returns the Order Edit object. You can access returned item changes using `order_edit.changes`. + +### Remove an Item + +You can remove an item from the original order by sending a request to the [Remove Line Item](/api/admin/#tag/OrderEdit/operation/DeleteOrderEditsOrderEditLineItemsLineItem) endpoint: + + + + +```ts +medusa.admin.orderEdits.removeLineItem(orderEditId, itemId) +.then(({ order_edit }) => { + console.log(order_edit.changes) +}) +``` + + + + +```ts +fetch(`/admin/order-edits/${orderEditId}/items/${itemId}`, { + method: "DELETE", + credentials: "include", +}) +.then((response) => response.json()) +.then(({ order_edit }) => { + console.log(order_edit.changes) +}) +``` + + + + +```bash +curl -L -X DELETE '/admin/order-edits//items/' \ +-H 'Authorization: Bearer ' +``` + + + + +This request requires the order edit’s ID and the ID of the item in the original order as path parameters. + +This request returns the Order Edit object. You can access returned item changes using `order_edit.changes`. + +--- + +## Revert an Item Change + +A merchant might make a mistake while making a change to the original order’s items. Using the Admin API, you can revert item changes previously created. + +To revert an item change, send a request to the [Delete Item Change](/api/admin/#tag/OrderEdit/operation/DeleteOrderEditsOrderEditItemChange) endpoint: + + + + +```ts +medusa.admin.orderEdits.deleteItemChange(orderEditId, changeId) +.then(({ id, object, deleted }) => { + console.log(id) +}) +``` + + + + +```ts +fetch( + `/admin/order-edits/${orderEditId}/changes/${changeId}`, + { + method: "DELETE", + credentials: "include", + } +) +.then((response) => response.json()) +.then(({ id, object, deleted }) => { + console.log(id, object, deleted) +}) +``` + + + + +```bash +curl -L -X DELETE '/admin/order-edits//changes/' \ +-H 'Authorization: Bearer ' +``` + + + + +This request requires the order edit’s ID and the item change’s ID as path parameters. + +This request returns an object with the following properties: + +- `id`: The ID of the deleted object. In this case, it’s the ID of the item change. +- `object`: A string indicating the type of deleted object. In this case, it’s `item_change`. +- `deleted`: A boolean value indicating whether the item change was deleted. + +--- + +## Move into Request State + +After an Order Edit is created and all the item changes are added, it must be moved into the request state. + +To move an Order Edit into the request state, send a request to the [Request Confirmation](/api/admin/#tag/OrderEdit/operation/PostOrderEditsOrderEditRequest) endpoint: + + + + +```ts +medusa.admin.orderEdits.requestConfirmation(orderEditId) +.then(({ order_edit }) => { + console.log(order_edit.requested_at, order_edit.requested_by) +}) +``` + + + + +```ts +fetch(`/admin/order-edits/${orderEditId}/request`, { + method: "POST", + credentials: "include", +}) +.then((response) => response.json()) +.then(({ order_edit }) => { + console.log(order_edit.requested_at, order_edit.requested_by) +}) +``` + + + + +```bash +curl -L -X POST '/admin/order-edits//request' \ +-H 'Authorization: Bearer ' +``` + + + + +This request requires the order edit’s ID as a path parameter. + +It returns the Order Edit object. You can access the following properties related to the confirmation request: + +- `requested_at`: A timestamp indicating when the request confirmation was created. +- `requested_by`: The ID of the user that requested this order edit. + +:::tip + +💡 This request triggers the event `order-edit.requested`. You can use a subscriber to send an email to the customer with a link to view the order edit on the storefront. You can learn more in the [Events reference](../backend/subscribers/events-list.md). + +::: + +--- + +## Force-Confirm an Order Edit + +There are two ways to confirm an Order Edit: + +1. Using the Storefront API, which would confirm the Order Edit as a customer; +2. Or using the Admin API, which would force-confirm the Order Edit as a merchant. + +Once an Order Edit is confirmed, the changes to the items defined in the Order Edit will be reflected on the original order. So, a change in the totals of the original order, such as the subtotal, will be reflected as well. + +This change can lead to either required additional payments from the customer, or a refund to be made to the customer. + +When the merchant force-confirms the order edit, however, it bypasses the payment flow. This means that the admin can’t capture any additional payment. + +This section covers how the Admin API can be used to force-confirm the Order Edit. You can refer to [this documentation to learn how to implement Order Edit confirmation on the storefront](../storefront/handle-order-edits.mdx). + +To confirm an Order Edit, send a request to the [Confirm Order Edit](/api/admin/#tag/OrderEdit/operation/PostOrderEditsOrderEditConfirm) endpoint: + + + + +```ts +medusa.admin.orderEdits.confirm(orderEditId) +.then(({ order_edit }) => { + console.log(order_edit.confirmed_at, order_edit.confirmed_by) +}) +``` + + + + +```ts +fetch(`/admin/order-edits/${orderEditId}/confirm`, { + method: "POST", + credentials: "include", +}) +.then((response) => response.json()) +.then(({ order_edit }) => { + console.log(order_edit.confirmed_at, order_edit.confirmed_by) +}) +``` + + + + +```bash +curl -L -X POST '/admin/order-edits//confirm' \ +-H 'Authorization: Bearer ' +``` + + + + +This request accepts the order edit ID as a path parameter. + +It returns the Order Edit object. You can access the following properties related to the order edit confirmation: + +- `confirmed_at`: A timestamp indicating when the order edit was confirmed. +- `confirmed_by`: The ID of the user that confirmed the order edit. + +--- + +## Receive Additional Payment + +When the total after the order edit is greater than the total of the original order, the merchant can capture the difference from the customer. + +For order edits that are confirmed by the customer, the customer authorizes the payment before confirming it. So, the merchant can capture the payment. + +For force-confirmed order edits, as the customer didn’t authorize the payment, the merchant can’t capture the payment. It has to be handled manually by the merchant. + +:::info + +You can learn how to allow customers to authorize payment on the storefront in [this documentation](../storefront/handle-order-edits.mdx). + +::: + +### Capture Payment + +If the payment is authorized by the customer, it can be captured by sending a request to the [Capture Payment](/api/admin/#tag/Payment/operation/PostPaymentsPaymentCapture) endpoint: + + + + +```ts +medusa.admin.payments.capturePayment(paymentId) +.then(({ payment }) => { + console.log(payment.captured_at) +}) +``` + + + + +```ts +fetch(`/admin/payments/${paymentId}/capture`, { + method: "POST", + credentials: "include", +}) +.then((response) => response.json()) +.then(({ payment }) => { + console.log(payment.captured_at) +}) +``` + + + + +```bash +curl -L -X POST '/admin/payments//capture' \ +-H 'Authorization: Bearer ' +``` + + + + +This request requires the ID of the payment as a path parameter. The payment can be retrieved from the order by accessing the array property `order.payments`. + +It returns in the response the full Payment object. + +## Refund Payment + +When the total after the order edit is less than the original order total, the merchant can refund the difference to the customer. + +To refund the difference to the customer, send a request to the [Refund Payment](/api/admin/#tag/Payment/operation/PostPaymentsPaymentRefunds) endpoint: + + + + +```ts +medusa.admin.payments.refundPayment(paymentId, { + amount, +}) +.then(({ refund }) => { + console.log(refund.id) +}) +``` + + + + +```ts +fetch(`/admin/payments/${paymentId}/refund`, { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + amount, + }), +}) +.then((response) => response.json()) +.then(({ refund }) => { + console.log(refund.id) +}) +``` + + + + +```bash +curl -L -X POST '/admin/payments//refund' \ +-H 'Authorization: Bearer ' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "amount": 1000 +}' +``` + + + + +This request requires the ID of the payment as a path parameter. The payment can be retrieved from the order by accessing the array property `order.payments`. + +In the request’s body parameters, the `amount` field parameter is required. It is the amount to be refunded. + +:::note + +Check out what other parameters can be sent in the [API reference](/api/admin/#tag/Payment/operation/PostPaymentsPaymentRefunds). + +::: + +It returns in the response the full Refund object. + +--- + +## See Also + +- [Handle order edits on the storefront](../storefront/handle-order-edits). +- [Order Edits API reference](/api/admin/#tag/OrderEdit). diff --git a/docs/content/advanced/admin/use-customergroups-api.mdx b/docs/content/advanced/admin/use-customergroups-api.mdx index 4447de5516..346a1e0a08 100644 --- a/docs/content/advanced/admin/use-customergroups-api.mdx +++ b/docs/content/advanced/admin/use-customergroups-api.mdx @@ -1,7 +1,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# How to Use CustomerGroup APIs +# How to Manage Customer Groups In this document, you’ll learn how to use the customer groups admin APIs to manage customer groups and their associated customers and price lists. @@ -19,7 +19,7 @@ This guide covers how to use these APIs to perform these tasks. ### Medusa Components -It is assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.md) to get started. +It is assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.mdx) to get started. ### JS Client @@ -44,11 +44,11 @@ You can create a customer group by sending a request to the Create Customer Grou ```jsx medusa.admin.customerGroups.create({ - name: 'VIP' + name: "VIP", }) .then(({ customer_group }) => { - console.log(customer_group.id); -}); + console.log(customer_group.id) +}) ``` @@ -56,19 +56,19 @@ medusa.admin.customerGroups.create({ ```jsx fetch(`/admin/customer-groups`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - name: 'VIP' - }) + name: "VIP", + }), }) .then((response) => response.json()) .then(({ customer_group }) => { console.log(customer_group.id) -}); +}) ``` @@ -100,8 +100,8 @@ You can get a list of all customer groups by sending a request to the List Custo ```jsx medusa.admin.customerGroups.list() .then(({ customer_groups, limit, offset, count }) => { - console.log(customer_groups.length); -}); + console.log(customer_groups.length) +}) ``` @@ -109,12 +109,12 @@ medusa.admin.customerGroups.list() ```jsx fetch(`/admin/customer-groups`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ customer_groups, limit, offset, count }) => { console.log(customer_groups.length) -}); +}) ``` @@ -144,8 +144,8 @@ You can retrieve a single customer group by sending a request to the Get a Custo ```jsx medusa.admin.customerGroups.retrieve(customerGroupId) .then(({ customer_group }) => { - console.log(customer_group.id); -}); + console.log(customer_group.id) +}) ``` @@ -153,12 +153,12 @@ medusa.admin.customerGroups.retrieve(customerGroupId) ```jsx fetch(`/admin/customer-groups/${customerGroupId}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ customer_group }) => { console.log(customer_group.id) -}); +}) ``` @@ -186,12 +186,12 @@ You can update a customer group’s data by sending a request to the Update Cust ```jsx medusa.admin.customerGroups.update(customerGroupId, { metadata: { - is_seller: true - } + is_seller: true, + }, }) .then(({ customer_group }) => { - console.log(customer_group.id); -}); + console.log(customer_group.id) +}) ``` @@ -199,21 +199,21 @@ medusa.admin.customerGroups.update(customerGroupId, { ```jsx fetch(`/admin/customer-groups/${customerGroupId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ metadata: { - is_seller: true - } - }) + is_seller: true, + }, + }), }) .then((response) => response.json()) .then(({ customer_group }) => { console.log(customer_group.id) -}); +}) ``` @@ -247,8 +247,8 @@ You can delete a customer group by sending a request to the Delete a Customer Gr ```jsx medusa.admin.customerGroups.delete(customerGroupId) .then(({ id, object, deleted }) => { - console.log(id); -}); + console.log(id) +}) ``` @@ -256,13 +256,13 @@ medusa.admin.customerGroups.delete(customerGroupId) ```jsx fetch(`/admin/customer-groups/${customerGroupId}`, { - method: 'DELETE', - credentials: 'include', + method: "DELETE", + credentials: "include", }) .then((response) => response.json()) .then(({ id, object, deleted }) => { console.log(id) -}); +}) ``` @@ -293,37 +293,40 @@ You can add a customer to a group by sending a request to the Customer Group’s medusa.admin.customerGroups.addCustomers(customerGroupId, { customer_ids: [ { - id: customerId - } - ] + id: customerId, + }, + ], }) .then(({ customer_group }) => { - console.log(customer_group.id); -}); + console.log(customer_group.id) +}) ``` ```jsx -fetch(`/admin/customer-groups/${customerGroupId}/customers/batch`, { - method: 'POST', - credentials: 'include', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - customer_ids: [ - { - id: customerId - } - ] - }) -}) +fetch( + `/admin/customer-groups/${customerGroupId}/customers/batch`, + { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + customer_ids: [ + { + id: customerId, + }, + ], + }), + } +) .then((response) => response.json()) .then(({ customer_group }) => { console.log(customer_group.id) -}); +}) ``` @@ -357,8 +360,8 @@ You can retrieve a list of all customers in a customer group using the List Cust ```jsx medusa.admin.customerGroups.listCustomers(customerGroupId) .then(({ customers, count, offset, limit }) => { - console.log(customers.length); -}); + console.log(customers.length) +}) ``` @@ -366,12 +369,12 @@ medusa.admin.customerGroups.listCustomers(customerGroupId) ```jsx fetch(`/admin/customer-groups/${customerGroupId}/customers`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ customers, count, offset, limit }) => { console.log(customers.length) -}); +}) ``` @@ -404,37 +407,40 @@ You can remove customers from a customer group by sending a request to the Remov medusa.admin.customerGroups.removeCustomers(customer_group_id, { customer_ids: [ { - id: customer_id - } - ] + id: customer_id, + }, + ], }) .then(({ customer_group }) => { - console.log(customer_group.id); -}); + console.log(customer_group.id) +}) ``` ```jsx -fetch(`/admin/customer-groups/${customerGroupId}/customers/batch`, { - method: 'DELETE', - credentials: 'include', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - customer_ids: [ - { - id: customerId - } - ] - }) -}) +fetch( + `/admin/customer-groups/${customerGroupId}/customers/batch`, + { + method: "DELETE", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + customer_ids: [ + { + id: customerId, + }, + ], + }), + } +) .then((response) => response.json()) .then(({ customer_group }) => { console.log(customer_group.id) -}); +}) ``` @@ -468,7 +474,7 @@ When you create or update a price list, you can specify one or more customer gro --- -## What’s Next +## See Also -- Learn more about [Customer Groups](../backend/customer-groups/index.md). -- Learn about [how to use Sales Channels](../backend/sales-channels/manage-admin.mdx). \ No newline at end of file +- [Customer Groups Overview](../backend/customer-groups/index.md). +- [Use Sales Channels Admin APIs](../backend/sales-channels/manage-admin.mdx). \ No newline at end of file diff --git a/docs/content/advanced/backend/batch-jobs/create.md b/docs/content/advanced/backend/batch-jobs/create.md index 17f3312b17..3cfc6d829a 100644 --- a/docs/content/advanced/backend/batch-jobs/create.md +++ b/docs/content/advanced/backend/batch-jobs/create.md @@ -17,11 +17,13 @@ Batch jobs can be used to perform long tasks in the background of your Medusa se This documentation helps you learn how to create a batch job strategy. The batch job strategy used in this example changes the status of all draft products to `published`. +--- + ## Prerequisites ### Medusa Components -It is assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../../quickstart/quick-start.md) to get started. +It is assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../../quickstart/quick-start.mdx) to get started. ### Redis @@ -31,29 +33,36 @@ Redis is required for batch jobs to work. Make sure you [install Redis](../../. If you use SQLite during your development, it’s highly recommended that you use PostgreSQL when working with batch jobs. Learn how to [install PostgreSQL](../../../tutorial/0-set-up-your-development-environment.mdx#postgresql) and [configure it with your Medusa server](../../../usage/configurations.md#postgresql-configurations). +--- + ## 1. Create a File A batch job strategy is essentially a class defined in a TypeScript or JavaScript file. You should create this file in `src/strategies`. Following the example used in this documentation, create the file `src/strategies/publish.ts`. +--- + ## 2. Create Class Batch job strategies must extend the abstract class `AbstractBatchJobStrategy` and implement its abstract methods. Add the following content to the file you created: -```tsx title=src/strategies/publish.ts -import { AbstractBatchJobStrategy, BatchJobService } from '@medusajs/medusa' -import { EntityManager } from 'typeorm' +```ts title=src/strategies/publish.ts +import { + AbstractBatchJobStrategy, + BatchJobService, +} from "@medusajs/medusa" +import { EntityManager } from "typeorm" class PublishStrategy extends AbstractBatchJobStrategy { protected batchJobService_: BatchJobService processJob(batchJobId: string): Promise { - throw new Error('Method not implemented.') + throw new Error("Method not implemented.") } buildTemplate(): Promise { - throw new Error('Method not implemented.') + throw new Error("Method not implemented.") } protected manager_: EntityManager protected transactionManager_: EntityManager @@ -63,6 +72,8 @@ class PublishStrategy extends AbstractBatchJobStrategy { export default PublishStrategy ``` +--- + ## 3. Define Required Properties A batch job strategy class must have two static properties: the `identifier` and `batchType` properties. The `identifier` must be a unique string associated with your batch job strategy, and `batchType` must be the batch job's type. @@ -71,15 +82,17 @@ You will use the `batchType` later when you [interact with the Batch Job APIs](# Following the same example, add the following properties to the `PublishStrategy` class: -```tsx +```ts class PublishStrategy extends AbstractBatchJobStrategy { - static identifier = 'publish-products-strategy' - static batchType = 'publish-products' + static identifier = "publish-products-strategy" + static batchType = "publish-products" - //... + // ... } ``` +--- + ## 4. Define Methods ### (Optional) prepareBatchJobForProcessing @@ -88,10 +101,16 @@ Medusa runs this method before it creates the batch job to prepare the content o Implementing this method is optional. For example: -```tsx -async prepareBatchJobForProcessing(batchJob: CreateBatchJobInput, req: Express.Request): Promise { - //make changes to the batch job's fields... - return batchJob +```ts +class PublishStrategy extends AbstractBatchJobStrategy { + // ... + async prepareBatchJobForProcessing( + batchJob: CreateBatchJobInput, + req: Express.Request + ): Promise { + // make changes to the batch job's fields... + return batchJob + } } ``` @@ -101,35 +120,38 @@ Medusa runs this method after it creates the batch job, but before it is confirm For example, this implementation of the `preProcessBatchJob` method calculates how many draft products it will published and adds it to the `result` attribute of the batch job: -```tsx -async preProcessBatchJob(batchJobId: string): Promise { - return await this.atomicPhase_(async (transactionManager) => { - const batchJob = (await this.batchJobService_ - .withTransaction(transactionManager) - .retrieve(batchJobId)) - - const count = await this.productService_ - .withTransaction(transactionManager) - .count({ - status: ProductStatus.DRAFT - }); +```ts +class PublishStrategy extends AbstractBatchJobStrategy { + // ... + async preProcessBatchJob(batchJobId: string): Promise { + return await this.atomicPhase_(async (transactionManager) => { + const batchJob = (await this.batchJobService_ + .withTransaction(transactionManager) + .retrieve(batchJobId)) + + const count = await this.productService_ + .withTransaction(transactionManager) + .count({ + status: ProductStatus.DRAFT, + }) - await this.batchJobService_ - .withTransaction(transactionManager) - .update(batchJob, { - result: { - advancement_count: 0, - count, - stat_descriptors: [ - { - key: 'product-publish-count', - name: 'Number of products to publish', - message: `${count} product(s) will be published.` - } - ] - } - }) - }) + await this.batchJobService_ + .withTransaction(transactionManager) + .update(batchJob, { + result: { + advancement_count: 0, + count, + stat_descriptors: [ + { + key: "product-publish-count", + name: "Number of products to publish", + message: `${count} product(s) will be published.`, + }, + ], + }, + }) + }) + } } ``` @@ -145,34 +167,37 @@ Medusa runs this method to process the batch job once it is confirmed. For example, this implementation of the `processJob` method retrieves all draft products and changes their status to published: -```tsx -async processJob(batchJobId: string): Promise { - return await this.atomicPhase_( - async (transactionManager) => { - const productServiceTx = this.productService_ - .withTransaction(transactionManager) +```ts +class PublishStrategy extends AbstractBatchJobStrategy { + // ... + async processJob(batchJobId: string): Promise { + return await this.atomicPhase_( + async (transactionManager) => { + const productServiceTx = this.productService_ + .withTransaction(transactionManager) - const productList = await productServiceTx - .list({ - status: [ProductStatus.DRAFT] - }) - - productList.forEach(async (product: Product) => { - await productServiceTx - .update(product.id, { - status: ProductStatus.PUBLISHED + const productList = await productServiceTx + .list({ + status: [ProductStatus.DRAFT], }) - }) - - await this.batchJobService_ - .withTransaction(transactionManager) - .update(batchJobId, { - result: { - advancement_count: productList.length - } + + productList.forEach(async (product: Product) => { + await productServiceTx + .update(product.id, { + status: ProductStatus.PUBLISHED, + }) }) - } - ) + + await this.batchJobService_ + .withTransaction(transactionManager) + .update(batchJobId, { + result: { + advancement_count: productList.length, + }, + }) + } + ) + } } ``` @@ -188,9 +213,12 @@ This method can be used in cases where you provide a template file to download, If not necessary to your use case, you can simply return an empty string: -```tsx -async buildTemplate(): Promise { - return '' +```ts +class PublishStrategy extends AbstractBatchJobStrategy { + // ... + async buildTemplate(): Promise { + return "" + } } ``` @@ -202,9 +230,15 @@ By default, the `AbstractBatchJobStrategy` class implements this method and retu If you would like to change that behavior, you can override this method to return a different value: -```tsx -protected async shouldRetryOnProcessingError(batchJob: BatchJob, err: unknown): Promise { - return true +```ts +class PublishStrategy extends AbstractBatchJobStrategy { + // ... + protected async shouldRetryOnProcessingError( + batchJob: BatchJob, + err: unknown + ): Promise { + return true + } } ``` @@ -216,12 +250,21 @@ You can use this method as implemented in `AbstractBatchJobStrategy` at any poin You can also override this method in your batch job strategy and change how it works: -```tsx -protected async handleProcessingError(batchJobId: string, err: unknown, result: T): Promise { - //different implementation... +```ts +class PublishStrategy extends AbstractBatchJobStrategy { + // ... + protected async handleProcessingError( + batchJobId: string, + err: unknown, + result: T + ): Promise { + // different implementation... + } } ``` +--- + ## 5. Run Build Command After you create the batch job and before testing it out, you must run the build command in the directory of your Medusa server: @@ -230,6 +273,8 @@ After you create the batch job and before testing it out, you must run the build npm run build ``` +--- + ## Test your Batch Job Strategy This section covers how to test and use your batch job strategy. Make sure to start your server first: @@ -259,13 +304,13 @@ For example, this creates a batch job of the type `publish-products`: ```jsx medusa.admin.batchJobs.create({ - type: 'publish-products', + type: "publish-products", context: { }, - dry_run: true + dry_run: true, }) .then(( batch_job ) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -273,21 +318,21 @@ medusa.admin.batchJobs.create({ ```jsx fetch(`/admin/batch-jobs`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - type: 'publish-products', + type: "publish-products", context: { }, - dry_run: true - }) + dry_run: true, + }), }) .then((response) => response.json()) .then(({ batch_job }) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -321,8 +366,8 @@ You can retrieve the batch job afterward to get its status and view details abou ```jsx medusa.admin.batchJobs.retrieve(batchJobId) .then(( batch_job ) => { - console.log(batch_job.status, batch_job.result); -}); + console.log(batch_job.status, batch_job.result) +}) ``` @@ -330,12 +375,12 @@ medusa.admin.batchJobs.retrieve(batchJobId) ```jsx fetch(`/admin/batch-jobs/${batchJobId}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ batch_job }) => { - console.log(batch_job.status, batch_job.result); -}); + console.log(batch_job.status, batch_job.result) +}) ``` @@ -376,8 +421,8 @@ To process the batch job, send a request to [confirm the batch job](https://docs ```jsx medusa.admin.batchJobs.confirm(batchJobId) .then(( batch_job ) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -385,13 +430,13 @@ medusa.admin.batchJobs.confirm(batchJobId) ```jsx fetch(`/admin/batch-jobs/${batchJobId}/confirm`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", }) .then((response) => response.json()) .then(({ batch_job }) => { - console.log(batch_job.status); -}); + console.log(batch_job.status) +}) ``` @@ -410,7 +455,9 @@ The batch job will start processing afterward. Based on the batch job strategy i You can [retrieve the batch job](#optional-retrieve-batch-job) at any given point to check its status. -## What’s Next +--- -- Learn more about [batch jobs](./index.md). -- Learn how to [import products using the Admin API](../../admin/import-products.mdx). +## See Also + +- [Batch Jobs Overview](./index.md). +- [Import products using the Admin API](../../admin/import-products.mdx). diff --git a/docs/content/advanced/backend/batch-jobs/customize-import.md b/docs/content/advanced/backend/batch-jobs/customize-import.md index caf919ca62..e1a656fa4b 100644 --- a/docs/content/advanced/backend/batch-jobs/customize-import.md +++ b/docs/content/advanced/backend/batch-jobs/customize-import.md @@ -8,11 +8,13 @@ Product Import Strategy is essentially a batch job strategy. Medusa provides the Although this documentation specifically targets import strategies, you can use the same steps to overwrite any batch job strategy in Medusa, including export strategies. +--- + ## Prerequisites ### Medusa Components -It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../../quickstart/quick-start.md) to get started. +It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../../quickstart/quick-start.mdx) to get started. ### Redis @@ -22,6 +24,8 @@ Redis is required for batch jobs to work. Make sure you [install Redis](../../. If you use SQLite during your development, it’s highly recommended that you use PostgreSQL when working with batch jobs. Learn how to [install PostgreSQL](../../../tutorial/0-set-up-your-development-environment.mdx#postgresql) and [configure it with your Medusa server](../../../usage/configurations.md#postgresql-configurations). +--- + ## Overwrite Batch Job Strategy The steps required for overwriting a batch job strategy are essentially the same steps required to create a batch job strategy with a minor difference. For that reason, this documentation does not cover the basics of a batch job strategy. @@ -103,13 +107,17 @@ Specifically, since you create batch jobs using the [Create Batch Job](https://d If you overwrote the import functionality, you can follow [these steps to learn how to import products using the Admin APIs](../../admin/import-products.mdx). +--- + ## Create Custom Batch Job Strategy If you don’t want to overwrite Medusa’s batch job strategy, you can create a custom batch job strategy with a different `batchType` value. Then, use that type when you send a request to [Create a Batch Job](https://docs.medusajs.com/api/admin/#tag/Batch-Job). For more details on creating custom batch job strategies, please check out the [Create Batch Job Strategy documentation](create.md). +--- + ## What’s Next -- Learn more about [batch jobs](./index.md). -- Learn [how to use the Import Product APIs](../../admin/import-products.mdx). +- [Batch Jobs Overview](./index.md). +- [Use the Import Product APIs](../../admin/import-products.mdx). diff --git a/docs/content/advanced/backend/batch-jobs/index.md b/docs/content/advanced/backend/batch-jobs/index.md index c2e4122684..caf20ccd22 100644 --- a/docs/content/advanced/backend/batch-jobs/index.md +++ b/docs/content/advanced/backend/batch-jobs/index.md @@ -26,6 +26,8 @@ A batch job is stored in the database as a [BatchJob](https://docs.medusajs.com/ - `count`: A number that includes the total count of records related to the operation. For example, in the case of product exports, it is used to indicate the total number of products exported. - `advancement_count`: A number that indicates the number of records processed so far. Can be helpful when retrying a batch job. +--- + ## What are Batch Job Strategies Batch jobs are handled by batch job strategies. A batch job strategy is a class that extends the `AbstractBatchJobStrategy` abstract class and implements the methods defined in that class to handle the different states of a batch job. @@ -34,6 +36,8 @@ A batch job strategy must implement the necessary methods to handle the preparat When you create a batch job strategy, the `batchType` class property indicates the batch job types this strategy handles. Then, when you create a new batch job, you set the batch job’s type to the value of `batchType` in your strategy. +--- + ## How Batch Jobs Work A batch job’s flow from creation to completion is: @@ -56,6 +60,8 @@ If the batch job fails at any point in this flow, its status is changed to `fail ![Flowchart summarizing the batch job's flow from creation to completion](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001632/Medusa%20Docs/Diagrams/Qja0kAz_ns4vm8.png) +--- + ## What’s Next -- Learn about the [Batch Job’s events](../subscribers/events-list.md#batch-jobs-events). +- [Batch Job’s Events Reference](../subscribers/events-list.md#batch-jobs-events). diff --git a/docs/content/advanced/backend/customer-groups/index.md b/docs/content/advanced/backend/customer-groups/index.md index a9349812bc..6823503e2e 100644 --- a/docs/content/advanced/backend/customer-groups/index.md +++ b/docs/content/advanced/backend/customer-groups/index.md @@ -24,7 +24,7 @@ A customer group is stored in the database as a [CustomerGroup](../../../refere Similar to all entities in Medusa, you can use the `metadata` object attribute to store any custom data you want. For example, you can add some flag or tag to the customer group for a custom use case: -```jsx noReport +```js noReport metadata: { is_seller: true } @@ -54,7 +54,7 @@ The relation between the `PriceList` and `CustomerGroup` entities is available o --- -## What’s Next +## See Also -- Learn [how to manage customer groups using the Admin APIs](../../admin/use-customergroups-api.mdx). -- Learn more about [Price Lists and how they work](../price-lists/index.md). +- [Manage customer groups using the Admin APIs](../../admin/use-customergroups-api.mdx). +- [Price Lists Overview](../price-lists/index.md). diff --git a/docs/content/advanced/backend/customers/index.md b/docs/content/advanced/backend/customers/index.md new file mode 100644 index 0000000000..1f5d6cb104 --- /dev/null +++ b/docs/content/advanced/backend/customers/index.md @@ -0,0 +1,78 @@ +# Customers + +In this document, you’ll learn about Customers and their relation to other entities in Medusa. + +## Introduction + +Customers are individuals that make purchases in your store. In Medusa, there are two types of customers: registered customers and guests or unregistered customers. + +Both registered and unregistered customers can make purchases. However, only registered customers can log into their accounts and manage their details and orders. + +An admin user can view and manage their customers, their details, their orders, and what customer group they’re in. + +--- + +## Customer Entity Overview + +A customer is stored in the database as a `Customer` entity. A customer has attributes related to the customer’s details such as `first_name`, `last_name`, and `phone`. However, the only required attribute is `email`. + +### has_account Attribute + +As mentioned earlier, customers can be either registered or unregistered. The type of customer is identified in the `has_account` attribute. This is a boolean attribute that indicates whether the customer is registered. + +For example, when a guest customer places an order, a new `Customer` record is created with the email used (if it doesn’t already exist) and the value for `has_account` is `false`. When the unregistered customer creates an account using the same email, a new `Customer` record will be created with the value of `has_account` set to `true`. + +### Email Uniqueness + +An email is unique to a type of customer. So, an email can be associated with only one registered customer (where `has_account` is `true`), and one unregistered customer (where `has_account` is `false`). + +In the example mentioned above, after the unregistered customer places an order with an email, then creates an account with the same email, two `Customer` records are created. Each of these records have different `has_account` value. + +:::info + +This architecture allows creating the Claim Order flow, where a registered customer can claim an order they placed as an unregistered customer. You can learn more about it in [this documentation](../../storefront/implement-claim-order.mdx). + +::: + +--- + +## Relations to Other Entities + +### CustomerGroup + +Customer groups allow dividing customers into groups of similar attributes, then apply special pricing or rules for these customer groups. + +:::info + +You can learn more about customer groups in [this documentation](../customer-groups/index.md). + +::: + +A customer can belong to more than one customer group. The relation between the `Customer` and `CustomerGroup` entities is available on both entities: + +- You can access the customer groups of a customer by expanding the `groups` relation and accessing `customer.groups`. +- You can access the customers in a customer group by expanding the `customers` relation and accessing `customerGroup.customers`. + +### Orders + +Customers can have more than one order. The relation between the `Customer` and `Order` entities is available on both entities: + +- You can access the orders of a customer by expanding the `orders` relation and accessing `customer.orders`. +- You can access the customer that placed an order by expanding the `customer` relation and accessing `order.customer`. + +### Address + +A customer can have a billing address and more than one shipping address. Both billing and shipping addresses are represented by the `Address` entity. + +The relation between the `Customer` and `Address` entities is available on both entities: + +- You can access the billing address of a customer by expanding the `billing_address` relation and accessing `customer.billing_address`. You can also access the shipping addresses of a customer by expanding the `shipping_addresses` relation and accessing `customer.shipping_addresses`. +- Likewise, you can access the customer that an address is associated with by expanding the `customer` relation and accessing `address.customer`. + +--- + +## See Also + +- [Implement customer profiles in the storefront](../../storefront/customer-profiles.mdx) +- [Manage customers using the admin APIs](../../admin/manage-customers.mdx) +- Customers [Admin](/api/admin/#tag/Customer) and [Storefront](/api/store/#tag/Customer) API References diff --git a/docs/content/advanced/backend/dependency-container/index.md b/docs/content/advanced/backend/dependency-container/index.md index d5966b7b44..ea28a8462d 100644 --- a/docs/content/advanced/backend/dependency-container/index.md +++ b/docs/content/advanced/backend/dependency-container/index.md @@ -26,6 +26,8 @@ When you run the Medusa server, a container of the type `MedusaContainer` is cre The server then registers all important resources in the container, which makes them accessible in classes and endpoints. +--- + ## Registered Resources The Medusa server scans the core Medusa package, plugins, and your files in the `dist` directory and registers the following resources: @@ -550,6 +552,8 @@ Its camel-case name. +--- + ## Loading Resources This section covers how to load resources that the Medusa server registers when it starts running. @@ -560,8 +564,8 @@ To load resources, such as services, in endpoints, use the `req.scope.resolve` f For example: -```typescript -const logger = req.scope.resolve('logger'); +```ts +const logger = req.scope.resolve("logger") ``` Please note that in endpoints some resources, such as repositories, are not available. @@ -572,19 +576,21 @@ In classes such as services, strategies, or subscribers, you can load resources For example: -```typescript -import { OrderService } from '@medusajs/medusa'; +```ts +import { OrderService } from "@medusajs/medusa" class OrderSubscriber { - protected orderService: OrderService; + protected orderService: OrderService constructor({ orderService }) { - this.orderService = orderService; + this.orderService = orderService } } ``` -## What’s Next +--- -- Learn [how to create services](../services/create-service.md). -- Learn [how to create subscribers](../subscribers/create-subscriber.md). +## See Also + +- [Create services](../services/create-service.md). +- [Create subscribers](../subscribers/create-subscriber.md). diff --git a/docs/content/advanced/backend/discounts/index.md b/docs/content/advanced/backend/discounts/index.md index 2a1b0d7d9b..094f96c43e 100644 --- a/docs/content/advanced/backend/discounts/index.md +++ b/docs/content/advanced/backend/discounts/index.md @@ -98,7 +98,7 @@ Based on the value of `type`, one of the following relations can be used to retr --- -## What’s Next +## See Also -- Learn [how to create a discount using the admin APIs](../../admin/manage-discounts.mdx) -- Learn [how to use discounts on the storefront](../../storefront/use-discounts-in-checkout.mdx) +- [Create a discount using the admin APIs](../../admin/manage-discounts.mdx) +- [Use discounts on the storefront](../../storefront/use-discounts-in-checkout.mdx) diff --git a/docs/content/advanced/backend/endpoints/add.md b/docs/content/advanced/backend/endpoints/add.md index 86a204143b..e0cc102b78 100644 --- a/docs/content/advanced/backend/endpoints/add.md +++ b/docs/content/advanced/backend/endpoints/add.md @@ -6,6 +6,8 @@ In this document, you’ll learn how to create endpoints in your Medusa server. Custom endpoints reside under the `src/api` directory in your Medusa Backend. They're defined in a TypeScript or JavaScript file that is named `index` (for example, `index.ts`). This file should export a function that returns an Express router. +--- + ## Implementation To create a new endpoint, start by creating a new file in `src/api` called `index.ts`. At its basic format, `index.ts` should look something like this: @@ -42,6 +44,8 @@ By Medusa’s conventions: You can also create endpoints that don't reside under these two prefixes, similar to the `hello` endpoint in the previous example. +--- + ## CORS Configuration If you’re adding a storefront or admin endpoint and you want to access these endpoints from the storefront or Medusa admin, you need to pass your endpoints Cross-Origin Resource Origin (CORS) options using the `cors` package. @@ -58,12 +62,13 @@ Next, in the exported function, retrieve the CORS configurations of your server ```ts export default (rootDirectory) => { - //... + // ... - const { configModule } = getConfigFile(rootDirectory, "medusa-config") + const { configModule } = + getConfigFile(rootDirectory, "medusa-config") const { projectConfig } = configModule - //.... + // .... } ``` @@ -90,10 +95,12 @@ Finally, for each route you add, create an `OPTIONS` request and add `cors`  ```ts router.options("/admin/hello", cors(corsOptions)) router.get("/admin/hello", cors(corsOptions), (req, res) => { - //... + // ... }) ``` +--- + ## Create Multiple Endpoints ### Same File @@ -185,6 +192,8 @@ export default () => { } ``` +--- + ## Protected Routes Protected routes are routes that should be accessible by logged-in customers or users only. @@ -194,20 +203,24 @@ Protected routes are routes that should be accessible by logged-in customers or To make a storefront route protected, first, import the `authenticate-customer` middleware: ```ts -import authenticate from "@medusajs/medusa/dist/api/middlewares/authenticate-customer" +import + authenticate +from "@medusajs/medusa/dist/api/middlewares/authenticate-customer" ``` Then, add the middleware to your route: ```ts router.options("/store/hello", cors(corsOptions)) -router.get("/store/hello", cors(corsOptions), authenticate(), async (req, res) => { - if (req.user) { - //user is logged in - //to get customer id: req.user.customer_id +router.get("/store/hello", cors(corsOptions), authenticate(), + async (req, res) => { + if (req.user) { + // user is logged in + // to get customer id: req.user.customer_id + } + // ... } - //... -}) +) ``` Please note that the endpoint is still accessible by all users, however, you’ll be able to access the current logged-in customer if there’s any. @@ -219,25 +232,31 @@ To disallow guest customers from accessing the endpoint, you can throw an error To make an admin route protected, first, import the `authenticate` middleware: ```ts -import authenticate from "@medusajs/medusa/dist/api/middlewares/authenticate" +import + authenticate +from "@medusajs/medusa/dist/api/middlewares/authenticate" ``` Then, add the middleware to your route: ```ts router.options("/admin/products/count", cors(corsOptions)) -router.get("/admin/products/count", cors(corsOptions), authenticate(), async (req, res) => { - //access current user - const id = req.user.userId - const userService = req.scope.resolve("userService") - - const user = await userService.retrieve(id) - //... -}) +router.get("/admin/products/count", cors(corsOptions), authenticate(), + async (req, res) => { + // access current user + const id = req.user.userId + const userService = req.scope.resolve("userService") + + const user = await userService.retrieve(id) + // ... + } +) ``` Now, only authenticated users can access this endpoint. +--- + ## Use Services Services in Medusa bundle a set of functionalities into one class. Then, you can use that class anywhere in your backend. For example, you can use the `ProductService` to retrieve products or perform operations like creating or updating a product. @@ -247,19 +266,23 @@ You can retrieve any registered service in your endpoint using `req.scope.resol Here’s an example of an endpoint that retrieves the count of products in your store: ```ts -router.get("/admin/products/count", cors(corsOptions), authenticate(), (req, res) => { - const productService = req.scope.resolve("productService") +router.get("/admin/products/count", cors(corsOptions), authenticate(), + (req, res) => { + const productService = req.scope.resolve("productService") - productService.count().then((count) => { - res.json({ - count, + productService.count().then((count) => { + res.json({ + count, + }) }) - }) -}) + } +) ``` The `productService` has a `count` method that returns a Promise. This Promise resolves to the count of the products. You return a JSON of the product count. +--- + ## Building Files Custom endpoints must be transpiled and moved to the `dist` directory. This happens when you run your server using `medusa develop` and while it’s running, and when you run the following command: @@ -268,7 +291,10 @@ Custom endpoints must be transpiled and moved to the `dist` directory. This happ npm run build ``` -## What’s Next +--- -- Check out the available [Admin](https://docs.medusajs.com/api/admin/) and [Storefront](https://docs.medusajs.com/api/store/) APIs. -- Learn how to create a [Service](./../services/create-service.md). +## See Also + +- [Storefront API Reference](/api/store) +- [Admin API Reference](/api/admin) +- [Create a Service](./../services/create-service.md). diff --git a/docs/content/advanced/backend/entities/index.md b/docs/content/advanced/backend/entities/index.md index 89d63127e6..c7abea1ea1 100644 --- a/docs/content/advanced/backend/entities/index.md +++ b/docs/content/advanced/backend/entities/index.md @@ -6,15 +6,15 @@ In this document, you’ll learn how you can create an [Entity](overview.md). To create an entity, create a TypeScript file in `src/models`. For example, here’s a `Post` entity defined in the file `src/models/post.ts`: -```tsx title=src/models/post.ts -import { BeforeInsert, Column, Entity, PrimaryColumn } from "typeorm"; -import { BaseEntity} from "@medusajs/medusa"; +```ts title=src/models/post.ts +import { BeforeInsert, Column, Entity, PrimaryColumn } from "typeorm" +import { BaseEntity } from "@medusajs/medusa" import { generateEntityId } from "@medusajs/medusa/dist/utils" @Entity() export class Post extends BaseEntity { - @Column({type: 'varchar'}) - title: string | null; + @Column({ type: "varchar" }) + title: string | null @BeforeInsert() private beforeInsert(): void { @@ -31,12 +31,12 @@ To generate an ID for your entity that matches the IDs generated for Medusa’s If you want the entity to also be soft deletable then it should extend `SoftDeletableEntity` instead: -```tsx -import { SoftDeletableEntity } from "@medusajs/medusa"; +```ts +import { SoftDeletableEntity } from "@medusajs/medusa" @Entity() export class Post extends SoftDeletableEntity { - //... + // ... } ``` @@ -52,7 +52,7 @@ You can learn more about Migrations, how to create them, and how to run them in Entities data can be easily accessed and modified using Typeorm [Repositories](https://typeorm.io/working-with-repository). To create a repository, create a file in `src/repositories`. For example, here’s a repository `PostRepository` created in `src/repositories/post.ts`: -```tsx title=src/repositories/post.ts +```ts title=src/repositories/post.ts import { EntityRepository, Repository } from "typeorm" import { Post } from "../models/post" @@ -69,6 +69,8 @@ Be careful with your file names as it can cause unclear errors in Typeorm. Make ::: +--- + ## Access a Custom Entity :::note @@ -83,24 +85,25 @@ npm run build You can access your custom entity data in the database in services or subscribers using the repository. For example, here’s a service that lists all posts: -```tsx -import { TransactionBaseService } from '@medusajs/medusa'; +```ts +import { TransactionBaseService } from "@medusajs/medusa" class PostService extends TransactionBaseService { constructor({ postRepository, manager }) { - super({ postRepository, manager }); + super({ postRepository, manager }) - this.postRepository = postRepository; - this.manager_ = manager; + this.postRepository = postRepository + this.manager_ = manager } async list() { - const postRepository = this.manager_.getCustomRepository(this.postRepository); - return await postRepository.find(); + const postRepository = this.manager_ + .getCustomRepository(this.postRepository) + return await postRepository.find() } } -export default PostService; +export default PostService ``` In the constructor, you can use dependency injection to get access to instances of services and repositories. Here, you initialize class fields `postRepository` and `manager`. The `manager` is a [Typeorm Entity Manager](https://typeorm.io/working-with-entity-manager). @@ -121,12 +124,14 @@ This same usage of repositories can be done in subscribers as well. To delete soft-deletable entities that extend the `SoftDeletableEntity` class, you can use the repository method `softDelete` method: -```tsx -await postRepository.softDelete(post.id); +```ts +await postRepository.softDelete(post.id) ``` -## What’s Next +--- -- Check out Medusa's entities in the [Entities' reference](../../../references/entities/classes/Address.md). -- Learn about [migrations](../migrations/overview.md). -- Learn more about [Services](../services/create-service.md) and how to use them. +## See Also + +- [Entities' reference](../../../references/entities/classes/Address.md) +- [Migrations Overview](../migrations/overview.md) +- [Create a Services](../services/create-service.md) diff --git a/docs/content/advanced/backend/entities/overview.md b/docs/content/advanced/backend/entities/overview.md index 8b32de6193..550e80da20 100644 --- a/docs/content/advanced/backend/entities/overview.md +++ b/docs/content/advanced/backend/entities/overview.md @@ -10,13 +10,17 @@ Aside from Medusa’s core entities, you can also create your own entities to us Entities are TypeScript files and they are based on [Typeorm’s Entities](https://typeorm.io/entities) and use Typeorm decorators. +--- + ## Base Entities All entities must extend either the `BaseEntity` or `SoftDeletableEntity` classes. The `BaseEntity` class holds common columns including the `id`, `created_at`, and `updated_at` columns. The `SoftDeletableEntity` class extends the `BaseEntity` class and adds another column `deleted_at`. If an entity can be soft deleted, meaning that a row in it can appear to the user as deleted but still be available in the database, it should extend `SoftDeletableEntity`. -## What's Next +--- -- Learn [how to create an entity](./index.md). -- Check out Medusa's entities in the [Entities' reference](../../../references/entities/classes/Address.md). \ No newline at end of file +## See Also + +- [Create an entity](./index.md) +- [Entities' reference](../../../references/entities/classes/Address.md) \ No newline at end of file diff --git a/docs/content/advanced/backend/feature-flags/toggle.md b/docs/content/advanced/backend/feature-flags/toggle.md index a1f5a6904c..69cebd2c62 100644 --- a/docs/content/advanced/backend/feature-flags/toggle.md +++ b/docs/content/advanced/backend/feature-flags/toggle.md @@ -8,6 +8,8 @@ Feature flags are used in Medusa to guard beta features that aren’t ready for To use these beta features, you must enable their feature flags. +--- + ## Available Feature Flags You can view a list of available feature flags that you can toggle in [the Medusa GitHub mono-repository](https://github.com/medusajs/medusa/tree/master/packages/medusa/src/loaders/feature-flags). In each feature flag file, you can find the default value of the feature flag, its name, environment variable name, and more. @@ -18,6 +20,8 @@ If a feature flag is enabled/disabled by default, you don’t need to manually e ::: +--- + ## Enable Feature Flags :::caution @@ -47,9 +51,9 @@ For example, to enable the Tax-Inclusive Pricing beta feature, add the following ```jsx title=medusa-config.js module.exports = { featureFlags: { - tax_inclusive_pricing: true + tax_inclusive_pricing: true, }, - //... + // ... } ``` @@ -73,6 +77,8 @@ You can learn more about migrations in this documentation. ::: +--- + ## Disable Feature Flags Disabling feature flags follows the same process as enabling the feature flags. All you have to do is change the value in the environment variables or the server settings to `false`. @@ -85,7 +91,9 @@ If you had the feature flag previously enabled, and you want to disable this fea You can follow [this documentation to learn how to revert the last migration you ran](https://docs.medusajs.com/cli/reference#migrations). -## What’s Next +--- -- Learn more about [Migrations](../migrations/overview.md). -- Learn how to [configure your Medusa server](../../../usage/configurations.md). +## See Also + +- [Migrations Overview](../migrations/overview.md). +- [Configure your Medusa server](../../../usage/configurations.md). diff --git a/docs/content/advanced/backend/migrations/index.md b/docs/content/advanced/backend/migrations/index.md index f555afdbf5..784bb8a317 100644 --- a/docs/content/advanced/backend/migrations/index.md +++ b/docs/content/advanced/backend/migrations/index.md @@ -20,12 +20,16 @@ You can alternatively use Typeorm's `generate` command to generate a Migration f ::: +--- + ## Write Migration File The migration file contains the necessary commands to create the database columns, foreign keys, and more. You can learn more about writing the migration file in You can learn more about writing migrations in [Typeorm’s Documentation](https://typeorm.io/migrations). +--- + ## Build Files Before you can run the migrations you need to run the build command to transpile the TypeScript files to JavaScript files: @@ -34,6 +38,8 @@ Before you can run the migrations you need to run the build command to transpile npm run build ``` +--- + ## Run Migration The last step is to run the migration with the command detailed earlier @@ -44,6 +50,8 @@ medusa migrations run If you check your database now you should see that the change defined by the migration has been applied successfully. +--- + ## What’s Next -- Learn more about [setting up your development server](../../../tutorial/0-set-up-your-development-environment.mdx). +- [Set up your development server](../../../tutorial/0-set-up-your-development-environment.mdx). diff --git a/docs/content/advanced/backend/migrations/overview.md b/docs/content/advanced/backend/migrations/overview.md index eaee22ae25..743991da6d 100644 --- a/docs/content/advanced/backend/migrations/overview.md +++ b/docs/content/advanced/backend/migrations/overview.md @@ -22,6 +22,8 @@ Migrations are used to apply changes to the database schema. However, there are ::: +--- + ## How to Run Migrations Migrations in Medusa can be done in one of two ways: @@ -48,7 +50,9 @@ npm run seed This will use the underlying `seed` command provided by Medusa's CLI to seed your database with data from the file `data/seed.json` on your Medusa server. -## What's Next +--- -- Learn [how to create a migration](index.md) -- Learn more about [setting up your development server](../../../tutorial/set-up-your-development-environment). +## See Also + +- [Create a migration](index.md) +- [Set up your development environment](../../../tutorial/set-up-your-development-environment) diff --git a/docs/content/advanced/backend/notification/how-to-create-notification-provider.md b/docs/content/advanced/backend/notification/how-to-create-notification-provider.md index 395ea0ac47..ede8131a57 100644 --- a/docs/content/advanced/backend/notification/how-to-create-notification-provider.md +++ b/docs/content/advanced/backend/notification/how-to-create-notification-provider.md @@ -10,10 +10,12 @@ If you’re unfamiliar with the Notification architecture in Medusa, it is recom ## Prerequisites -Before you start creating a Notification Provider, you need to install a [Medusa server](../../../quickstart/quick-start.md). +Before you start creating a Notification Provider, you need to install a [Medusa server](../../../quickstart/quick-start.mdx). You also need to [setup Redis](../../../tutorial/0-set-up-your-development-environment.mdx#redis) and [configure it with the Medusa server](../../../usage/configurations.md#redis). +--- + ## Create a Notification Provider Creating a Notification Provider is as simple as creating a TypeScript or JavaScript file in `src/services`. The name of the file is the name of the provider (for example, `sendgrid.ts`). A Notification Provider is essentially a Service that extends the `AbstractNotificationService` from `@medusajs/medusa`. @@ -21,23 +23,39 @@ Creating a Notification Provider is as simple as creating a TypeScript or JavaS For example, create the file `src/services/email-sender.ts` with the following content: ```ts title=src/services/email-sender.ts -import { AbstractNotificationService } from "@medusajs/medusa"; -import { EntityManager } from "typeorm"; +import { AbstractNotificationService } from "@medusajs/medusa" +import { EntityManager } from "typeorm" class EmailSenderService extends AbstractNotificationService { - protected manager_: EntityManager; - protected transactionManager_: EntityManager; + protected manager_: EntityManager + protected transactionManager_: EntityManager - sendNotification(event: string, data: unknown, attachmentGenerator: unknown): Promise<{ to: string; status: string; data: Record; }> { - throw new Error("Method not implemented."); + sendNotification( + event: string, + data: unknown, + attachmentGenerator: unknown + ): Promise<{ + to: string; + status: string; + data: Record; + }> { + throw new Error("Method not implemented.") } - resendNotification(notification: unknown, config: unknown, attachmentGenerator: unknown): Promise<{ to: string; status: string; data: Record; }> { - throw new Error("Method not implemented."); + resendNotification( + notification: unknown, + config: unknown, + attachmentGenerator: unknown + ): Promise<{ + to: string; + status: string; + data: Record; + }> { + throw new Error("Method not implemented.") } } -export default EmailSenderService; +export default EmailSenderService ``` Where `EmailSenderService` is the name of your Notification Provider Service. @@ -61,7 +79,10 @@ The value of this property is also used later when you want to subscribe the Not For example, in the class you created in the previous code snippet you can add the following property: ```ts -static identifier = "email-sender"; +class EmailSenderService extends AbstractNotificationService { + static identifier = "email-sender" + // ... +} ``` ### constructor @@ -81,23 +102,26 @@ You can learn more about plugins and how to create them in the [Plugins](../plug Continuing on with the previous example, if you want to use the [`OrderService`](../../../references/services/classes/OrderService.md) later when sending notifications, you can inject it into the constructor: ```ts -import { AbstractNotificationService, OrderService } from "@medusajs/medusa"; +import { + AbstractNotificationService, + OrderService, +} from "@medusajs/medusa" class EmailSenderService extends AbstractNotificationService { - protected manager_: EntityManager; - protected transactionManager_: EntityManager; - static identifier = "email-sender"; - protected orderService: OrderService; + protected manager_: EntityManager + protected transactionManager_: EntityManager + static identifier = "email-sender" + protected orderService: OrderService constructor(container, options) { - super(container); - //you can access options here in case you're - //using a plugin + super(container) + // you can access options here in case you're + // using a plugin - this.orderService = container.orderService; + this.orderService = container.orderService } - //... + // ... } ``` @@ -127,23 +151,34 @@ This method must return an object containing two properties: Continuing with the previous example you can have the following implementation of the `sendNotification` method: ```ts -async sendNotification(event: string, data: any, attachmentGenerator: unknown): Promise<{ to: string; status: string; data: Record; }> { - if (event === 'order.placed') { - //retrieve order - const order = await this.orderService.retrieve(data.id); - //TODO send email +class EmailSenderService extends AbstractNotificationService { + // ... + async sendNotification( + event: string, + data: any, + attachmentGenerator: unknown + ): Promise<{ + to: string; + status: string; + data: Record; + }> { + if (event === "order.placed") { + // retrieve order + const order = await this.orderService.retrieve(data.id) + // TODO send email - console.log('Notification sent'); - return { - to: order.email, - status: 'done', - data: { - //any data necessary to send the email - //for example: - subject: 'You placed a new order!', - items: order.items + console.log("Notification sent") + return { + to: order.email, + status: "done", + data: { + // any data necessary to send the email + // for example: + subject: "You placed a new order!", + items: order.items, + }, } - }; + } } } ``` @@ -178,17 +213,29 @@ Similarly to the `sendNotification` method, this method must return an object co Continuing with the previous example you can have the following implementation of the `resendNotification` method: ```ts -async resendNotification(notification: any, config: any, attachmentGenerator: unknown): Promise<{ to: string; status: string; data: Record; }> { - //check if the receiver of the notification should be changed - const to: string = config.to ? config.to : notification.to; +class EmailSenderService extends AbstractNotificationService { + // ... + async resendNotification( + notification: any, + config: any, + attachmentGenerator: unknown + ): Promise<{ + to: string; + status: string; + data: Record; + }> { + // check if the receiver of the notification should be changed + const to: string = config.to ? config.to : notification.to - //TODO resend the notification using the same data that is saved under notification.data + // TODO resend the notification using the same data + // that is saved under notification.data - console.log('Notification resent'); - return { - to, - status: 'done', - data: notification.data //you can also make changes to the data + console.log("Notification resent") + return { + to, + status: "done", + data: notification.data, // you can also make changes to the data + } } } ``` @@ -205,6 +252,8 @@ The `to` and `data` properties are used in the `NotificationService` in Medusa ::: +--- + ## Create a Subscriber After creating your Notification Provider Service, you must create a Subscriber that registers this Service as a notification handler of events. @@ -220,11 +269,12 @@ Following the previous example, to make sure the `email-sender` Notification Pro ```ts title=src/subscribers/notification.js class NotificationSubscriber { constructor({ notificationService }) { - notificationService.subscribe('order.placed', 'email-sender'); + notificationService.subscribe("order.placed", "email-sender") } + // ... } -export default NotificationSubscriber; +export default NotificationSubscriber ``` This subscriber accesses the `notificationService` using dependency injection. The `notificationService` contains a `subscribe` method that accepts 2 parameters. The first one is the name of the event to subscribe to, and the second is the identifier of the Notification Provider that is subscribing to that event. @@ -235,6 +285,8 @@ Notice that the value of the `identifier` static property defined in the `EmailS ::: +--- + ## Test Sending Notifications with your Notification Provider Make sure you've configured Redis with your Medusa server as explained in the Prerequisites section and that the Redis service is running. @@ -249,12 +301,14 @@ Then, place an order either using the [REST APIs](https://docs.medusajs.com/api/ :::tip -If you don’t have a storefront installed you can get started with either the [Next.js](../../../starters/nextjs-medusa-starter.md) or [Gatsby](../../../starters/gatsby-medusa-starter.md) starter storefronts in minutes. +If you don’t have a storefront installed you can get started with either the [Next.js](../../../starters/nextjs-medusa-starter.mdx) or [Gatsby](../../../starters/gatsby-medusa-starter.mdx) starter storefronts in minutes. ::: After placing an order, you can see in your console the message “Notification Sent”. If you added your own notification sending logic, you should receive an email or alternatively the type of notification you’ve set up. +--- + ## Test Resending Notifications with your Notification Provider To test resending a notification, first, retrieve the ID of the notification you just sent using the [List Notifications admin endpoint](https://docs.medusajs.com/api/admin/#tag/Notification/operation/GetNotifications). You can pass as a body parameter the `to` or `event_name` parameters to filter out the notification you just sent. @@ -273,9 +327,12 @@ Then, send a request to the [Resend Notification](https://docs.medusajs.com/api/ This request returns the same notification object as the List Notifications endpoint, but it now has a new object in the `resends` array. This is the resent notification. If you supplied a `to` parameter in the request body, you should see its value in the `to` property of the resent notification object. -## What’s Next +--- -- Check out the [list of events](../subscribers/events-list.md) you can listen to. -- Check out the [SendGrid](../../../add-plugins/sendgrid.mdx) plugin for easy integration of email notifications. -- Learn how to [create your own plugin](../plugins/create.md). -- Learn more about [Subscribers](../subscribers/create-subscriber.md) and [Services](../services/create-service.md). +## See Also + +- [Events reference](../subscribers/events-list.md) +- [SendGrid Plugin](../../../add-plugins/sendgrid.mdx) +- [Create a Subscriber](../subscribers/create-subscriber.md) +- [Create a Service](../services/create-service.md) +- [Create a Plugin](../plugins/create.md) diff --git a/docs/content/advanced/backend/notification/overview.md b/docs/content/advanced/backend/notification/overview.md index 4183049aba..dd43920783 100644 --- a/docs/content/advanced/backend/notification/overview.md +++ b/docs/content/advanced/backend/notification/overview.md @@ -8,6 +8,8 @@ Medusa provides a Notification API to mainly handle sending and resending notifi The Notification architecture is made up of two main components: the Notification Provider and the Notification. Simply put, the Notification Provider handles the sending and resending of a Notification. +--- + ## Notification Provider A Notification Provider is a provider that handles sending and resending of notifications. You can either create and integrate your own provider or install a Notification Provider through a third-party plugin. @@ -32,6 +34,8 @@ The `NotificationProvider` entity only has 2 attributes: `id` and `is_installed` If you installed a Notification provider and then removed the Service files or plugin that registered the Notification Provider, the Notification Provider remains in your database, but the value of the `is_installed` field changes to `false`. +--- + ## Notification A notification is a form of an alert sent to the customers or users to inform them of an action that has occurred. For example, if an order is placed, the notification, in this case, can be an email that confirms their order and lists the order details. @@ -67,6 +71,8 @@ You can also access the specific resource using the `resource_id` property, whic The `Notification` entity also includes properties related to the receiver of the Notification. In case the receiver is a customer, the `customer_id` property is used to identify which customer. +--- + ## Automating Flows with Notifications With Medusa you can create notifications as a reaction to a wide spectrum of events, allowing you to automate communication and processes. @@ -78,10 +84,13 @@ An example of a flow that can be implemented using Medusa's Notification API is - The customer returns the items triggering the `return.recieved` event. - The Notification Provider listens to the `return.received` event and sends an email to the customer with confirmation that their items have been received and that a refund has been issued. -## What’s Next +--- + +## See Also + +- [Create a Notification Provider](how-to-create-notification-provider.md) +- [Events reference](../subscribers/events-list.md) +- [SendGrid Plugin](../../../add-plugins/sendgrid.mdx) +- [Subscribers Overview](../subscribers/create-subscriber.md) +- [Services Overview](../services/create-service.md) -- Learn how to [create your own Notification Provider](how-to-create-notification-provider.md). -- Check out the [list of events](../subscribers/events-list.md) in Medusa. -- Check the [`NotificationService`](../../../references/services/classes/NotificationService.md) API reference for more details on how it works. -- Check out the [SendGrid](../../../add-plugins/sendgrid.mdx) Notification plugin. -- Learn more about [Subscribers](../subscribers/create-subscriber.md) and [Services](../services/create-service.md) in Medusa. diff --git a/docs/content/advanced/backend/payment/how-to-create-payment-provider.md b/docs/content/advanced/backend/payment/how-to-create-payment-provider.md index efb27405ad..da374726c3 100644 --- a/docs/content/advanced/backend/payment/how-to-create-payment-provider.md +++ b/docs/content/advanced/backend/payment/how-to-create-payment-provider.md @@ -42,57 +42,68 @@ These methods are used at different points in the Checkout flow as well as when ![Checkout Flow - Payment](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001750/Medusa%20Docs/Diagrams/WeDr0ph_idcrir.jpg) +--- + ## Create a Payment Provider The first step to create a payment provider is to create a JavaScript or TypeScript file in `src/services`. The file's name should be the name of the payment provider. For example, create the file `src/services/my-payment.ts` with the following content: + + ```ts title=src/services/my-payment.ts -import { AbstractPaymentService, Cart, Data, Payment, PaymentSession, PaymentSessionStatus, TransactionBaseService } from "@medusajs/medusa" -import { EntityManager } from "typeorm"; +import { + AbstractPaymentService, + Cart, Data, Payment, PaymentSession, + PaymentSessionStatus, TransactionBaseService, +} from "@medusajs/medusa" +import { EntityManager } from "typeorm" class MyPaymentService extends AbstractPaymentService { - protected manager_: EntityManager; - protected transactionManager_: EntityManager; + protected manager_: EntityManager + protected transactionManager_: EntityManager getPaymentData(paymentSession: PaymentSession): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } updatePaymentData(paymentSessionData: Data, data: Data): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } createPayment(cart: Cart): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } retrievePayment(paymentData: Data): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } updatePayment(paymentSessionData: Data, cart: Cart): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } - authorizePayment(paymentSession: PaymentSession, context: Data): Promise<{ data: Data; status: PaymentSessionStatus; }> { - throw new Error("Method not implemented."); + authorizePayment( + paymentSession: PaymentSession, + context: Data + ): Promise<{ data: Data; status: PaymentSessionStatus; }> { + throw new Error("Method not implemented.") } capturePayment(payment: Payment): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } refundPayment(payment: Payment, refundAmount: number): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } cancelPayment(payment: Payment): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } deletePayment(paymentSession: PaymentSession): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } getStatus(data: Data): Promise { - throw new Error("Method not implemented."); + throw new Error("Method not implemented.") } } -export default MyPaymentService; +export default MyPaymentService ``` Where `MyPaymentService` is the name of your Payment Provider service. For example, Stripe’s Payment Provider Service is called `StripeProviderService`. @@ -121,10 +132,16 @@ You can also use the constructor to initialize your integration with the third-p Additionally, if you’re creating your Payment Provider as an external plugin to be installed on any Medusa server and you want to access the options added for the plugin, you can access it in the constructor. The options are passed as a second parameter: + + ```ts -constructor({ productService }, options) { - super(); - //you can access options here +class MyPaymentService extends AbstractPaymentService { + // ... + constructor({ productService }, options) { + super() + // you can access options here + } + // ... } ``` @@ -138,15 +155,20 @@ This method must return an object that is going to be stored in the `data` field An example of a minimal implementation of `createPayment` that does not interact with any third-party providers: + + ```ts import { Cart, Data } from "@medusajs/medusa" -//... +// ... -async createPayment(cart: Cart): Promise { - return { - id: 'test-payment', - status: 'pending' - }; +class MyPaymentService extends AbstractPaymentService { + // ... + async createPayment(cart: Cart): Promise { + return { + id: "test-payment", + status: "pending", + } + } } ``` @@ -160,12 +182,17 @@ This method must return an object containing the data from the third-party provi An example of a minimal implementation of `retrievePayment` where you don’t need to interact with the third-party provider: + + ```ts import { Data } from "@medusajs/medusa" -//... +// ... -async retrievePayment(paymentData: Data): Promise { - return {}; +class MyPaymentService extends AbstractPaymentService { + // ... + async retrievePayment(paymentData: Data): Promise { + return {} + } } ``` @@ -187,12 +214,17 @@ This method returns a string that represents the status. The status must be one An example of a minimal implementation of `getStatus` where you don’t need to interact with the third-party provider: + + ```ts import { Data, PaymentSessionStatus } from "@medusajs/medusa" -//... +// ... -async getStatus(data: Data): Promise { - return PaymentSessionStatus.AUTHORIZED; +class MyPaymentService extends AbstractPaymentService { + // ... + async getStatus(data: Data): Promise { + return PaymentSessionStatus.AUTHORIZED + } } ``` @@ -220,12 +252,17 @@ This method must return an object that will be stored in the `data` field of the An example of a minimal implementation of `updatePayment` that does not need to make any updates on the third-party provider or the `data` field of the Payment Session: -```ts -import { Cart, Data } from "@medusajs/medusa"; -//... + -async updatePayment(paymentSessionData: Data, cart: Cart): Promise { - return paymentSessionData; +```ts +import { Cart, Data } from "@medusajs/medusa" +// ... + +class MyPaymentService extends AbstractPaymentService { + // ... + async updatePayment(paymentSessionData: Data, cart: Cart): Promise { + return paymentSessionData + } } ``` @@ -241,12 +278,20 @@ This method must return an object that will be stored in the `data` field of the An example of a minimal implementation of `updatePaymentData` that returns the `updatedData` passed in the body of the request as-is to update the `data` field of the Payment Session. -```ts -import { Data } from "@medusajs/medusa"; -//... + -async updatePaymentData(paymentSessionData: Data, updatedData: Data): Promise { - return updatedData; +```ts +import { Data } from "@medusajs/medusa" +// ... + +class MyPaymentService extends AbstractPaymentService { + // ... + async updatePaymentData( + paymentSessionData: Data, + updatedData: Data + ): Promise { + return updatedData + } } ``` @@ -265,12 +310,17 @@ You can use this method to interact with the third-party provider to delete data An example of a minimal implementation of `deletePayment` where no interaction with a third-party provider is required: -```ts -import { PaymentSession } from "@medusajs/medusa"; -//... + -async deletePayment(paymentSession: PaymentSession): Promise { - return; +```ts +import { PaymentSession } from "@medusajs/medusa" +// ... + +class MyPaymentService extends AbstractPaymentService { + // ... + async deletePayment(paymentSession: PaymentSession): Promise { + return + } } ``` @@ -303,17 +353,29 @@ You can utilize this method to interact with the third-party provider and perfor An example of a minimal implementation of `authorizePayment` that doesn’t need to interact with any third-party provider: -```ts -import { Data, PaymentSession, PaymentSessionStatus } from "@medusajs/medusa"; -//... + -async authorizePayment(paymentSession: PaymentSession, context: Data): Promise<{ data: Data; status: PaymentSessionStatus; }> { - return { - status: PaymentSessionStatus.AUTHORIZED, - data: { - id: 'test' +```ts +import { + Data, + PaymentSession, + PaymentSessionStatus, +} from "@medusajs/medusa" +// ... + +class MyPaymentService extends AbstractPaymentService { + // ... + async authorizePayment( + paymentSession: PaymentSession, + context: Data + ): Promise<{ data: Data; status: PaymentSessionStatus; }> { + return { + status: PaymentSessionStatus.AUTHORIZED, + data: { + id: "test", + }, } - }; + } } ``` @@ -327,12 +389,17 @@ This method must return an object to be stored in the `data` field of the Paymen An example of a minimal implementation of `getPaymentData`: -```ts -import { Data, PaymentSession } from "@medusajs/medusa"; -//... + -async getPaymentData(paymentSession: PaymentSession): Promise { - return paymentSession.data; +```ts +import { Data, PaymentSession } from "@medusajs/medusa" +// ... + +class MyPaymentService extends AbstractPaymentService { + // ... + async getPaymentData(paymentSession: PaymentSession): Promise { + return paymentSession.data + } } ``` @@ -350,14 +417,19 @@ This method must return an object that will be stored in the `data` field of the An example of a minimal implementation of `capturePayment` that doesn’t need to interact with a third-party provider: -```ts -import { Data, Payment } from "@medusajs/medusa"; -//... + -async capturePayment(payment: Payment): Promise { - return { - status: 'captured' - }; +```ts +import { Data, Payment } from "@medusajs/medusa" +// ... + +class MyPaymentService extends AbstractPaymentService { + // ... + async capturePayment(payment: Payment): Promise { + return { + status: "captured", + } + } } ``` @@ -375,13 +447,21 @@ This method must return an object that is stored in the `data` field of the Paym An example of a minimal implementation of `refundPayment` that doesn’t need to interact with a third-party provider: -```ts -import { Data, Payment } from "@medusajs/medusa"; -//... + -async refundPayment(payment: Payment, refundAmount: number): Promise { - return { - id: 'test' +```ts +import { Data, Payment } from "@medusajs/medusa" +// ... + +class MyPaymentService extends AbstractPaymentService { + // ... + async refundPayment( + payment: Payment, + refundAmount: number + ): Promise { + return { + id: "test", + } } } ``` @@ -403,17 +483,24 @@ This method must return an object that is stored in the `data` field of the Paym An example of a minimal implementation of `cancelPayment` that doesn’t need to interact with a third-party provider: -```ts -import { Data, Payment } from "@medusajs/medusa"; -//... + -async cancelPayment(payment: Payment): Promise { - return { - id: 'test' +```ts +import { Data, Payment } from "@medusajs/medusa" +// ... + +class MyPaymentService extends AbstractPaymentService { + // ... + async cancelPayment(payment: Payment): Promise { + return { + id: "test", + } } } ``` +--- + ## Optional Methods ### retrieveSavedMethods @@ -428,36 +515,43 @@ This method returns an array of saved payment methods retrieved from the third-p :::note -If you’re using Medusa’s [Next.js](../../../starters/nextjs-medusa-starter.md) or [Gatsby](../../../starters/gatsby-medusa-starter.md) storefront starters, note that the presentation of this method is not implemented. You’ll need to implement the UI and pages for this method based on your implementation and the provider you are using. +If you’re using Medusa’s [Next.js](../../../starters/nextjs-medusa-starter.mdx) or [Gatsby](../../../starters/gatsby-medusa-starter.mdx) storefront starters, note that the presentation of this method is not implemented. You’ll need to implement the UI and pages for this method based on your implementation and the provider you are using. ::: An example of the implementation of `retrieveSavedMethods` taken from Stripe’s Payment Provider: + + ```ts import { Customer, Data } from "@medusajs/medusa" -//... +// ... -/** -* Fetches a customers saved payment methods if registered in Stripe. -* @param {object} customer - customer to fetch saved cards for -* @returns {Promise>} saved payments methods -*/ -async retrieveSavedMethods(customer: Customer): Promise { - if (customer.metadata && customer.metadata.stripe_id) { - const methods = await this.stripe_.paymentMethods.list({ - customer: customer.metadata.stripe_id, - type: "card", - }) +class MyPaymentService extends AbstractPaymentService { + // ... + /** + * Fetches a customers saved payment methods if registered in Stripe. + * @param {object} customer - customer to fetch saved cards for + * @return {Promise>} saved payments methods + */ + async retrieveSavedMethods(customer: Customer): Promise { + if (customer.metadata && customer.metadata.stripe_id) { + const methods = await this.stripe_.paymentMethods.list({ + customer: customer.metadata.stripe_id, + type: "card", + }) - return methods.data + return methods.data + } + + return Promise.resolve([]) } - - return Promise.resolve([]) } ``` -## What’s Next +--- -- Check out the Payment Providers for [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) for implementation examples. -- Learn more about the [frontend checkout flow](./../../storefront/how-to-implement-checkout-flow.mdx). +## 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 providers. +- [Implement checkout flow on the storefront](./../../storefront/how-to-implement-checkout-flow.mdx). diff --git a/docs/content/advanced/backend/payment/overview.md b/docs/content/advanced/backend/payment/overview.md index 82b0afd2bd..cfea8ef5b9 100644 --- a/docs/content/advanced/backend/payment/overview.md +++ b/docs/content/advanced/backend/payment/overview.md @@ -14,6 +14,8 @@ In Medusa, there are 3 main components in the payment architecture: Payment Prov An important part in the Payment architecture to understand is the **Idempotency Key**. It’s a unique value that’s generated for a cart and is used to retry payments during checkout if they fail. +--- + ## Payment Provider A Payment Provider in Medusa is a method to handle payments in selected regions. It is not associated with a cart, customer, or order in particular. It provides the necessary implementation to create Payment Sessions and Payments, as well as authorize and capture payments, among other functionalities. @@ -30,7 +32,7 @@ As a developer, you will mainly work with the Payment Provider when integrating When you run your Medusa server, the Payment Provider will be registered on your server if it hasn’t been already. -Once the Payment Provider is added to the server, the store operator will be able to choose on the [Medusa Admin](../../../admin/quickstart.md) the payment providers available in a region. These payment providers are shown to the customer at checkout to choose from and use. +Once the Payment Provider is added to the server, the store operator will be able to choose on the [Medusa Admin](../../../admin/quickstart.mdx) the payment providers available in a region. These payment providers are shown to the customer at checkout to choose from and use. :::caution @@ -42,6 +44,8 @@ It’s important to choose a payment provider in the list of payment providers i The [`PaymentProvider`](../../../references/entities/classes/PaymentProvider.md) entity only has 2 attributes: `is_installed` to indicate if the payment provider is installed and its value is a boolean; and `id` which is the unique identifier that you define in the Payment Provider service. +--- + ## Payment Session Payment Sessions are linked to a customer’s cart. Each Payment Session is associated with a payment provider that is available in the customer cart’s region. @@ -80,6 +84,8 @@ The `status` attributes indicates the current status of the Payment Session. It These statuses are important in the checkout flow to determine the current step the customer is at and which action should come next. For example, if there is an attempt to place the order but the status of the Payment Session is not `authorized`, an error will be thrown. +--- + ## Payment A Payment is used to represent the amount authorized for a customer’s purchase. It is associated with the order placed by the customer and will be used after that for all operations related to the order’s payment such as capturing or refunding the payment. @@ -104,6 +110,8 @@ Similar to `PaymentSession`, `Payment` has a `data` attribute which is an objec Additionally, `Payment` has the `captured_at` date-time attribute which is filled when the payment has been captured, and a `canceled_at` date-time attribute which is filled when the order has been canceled. +--- + ## Idempotency Key An Idempotency Key is a unique key associated with a cart. It is generated at the last step of checkout before authorization of the payment is attempted. @@ -118,7 +126,9 @@ If then the request is interrupted for any reason or the payment fails, the clie This prevents any payment issues from occurring with the customers and allows for secure retries of failed payments or interrupted connections. -## What’s Next +--- -- [Check out how the checkout flow is implemented on the frontend.](./../../storefront/how-to-implement-checkout-flow.mdx) -- Check out payment plugins like [Stripe](../../../add-plugins/stripe.md), [Paypal](/add-plugins/paypal), and [Klarna](../../../add-plugins/klarna.md). +## See Also + +- [Create a Payment Provider](./how-to-create-payment-provider.md) +- [Implement the checkout flow in the storefront](./../../storefront/how-to-implement-checkout-flow.mdx) diff --git a/docs/content/advanced/backend/plugins/create.md b/docs/content/advanced/backend/plugins/create.md index c520e4c96a..f2f21a2886 100644 --- a/docs/content/advanced/backend/plugins/create.md +++ b/docs/content/advanced/backend/plugins/create.md @@ -16,6 +16,8 @@ If you run into any errors while installing the CLI tool, check out the [trouble ::: +--- + ## Initialize Project The recommended way to create a plugin is using the Medusa CLI. Run the following command to create a new Medusa project: @@ -28,6 +30,8 @@ Where `medusa-plugin-custom` is the name of the plugin you’re creating. In Med By convention, all plugin names start with `medusa` followed by a descriptive name of what the plugin does. For example, the Stripe plugin is named `medusa-payment-stripe`. +--- + ## Changes to package.json ### Rename Project Name @@ -145,6 +149,8 @@ npm install --save-dev cross-env - `repository`: The repository that holds your plugin’s codebase. - `keywords`: This should hold the keywords that are related to your plugin. It’s recommended that all plugins use the keywords `medusa-plugin` or `medusa`. +--- + ## Develop your Plugin Now, You can start developing your plugin. This can include adding services, endpoints, entities, or anything that's relevant to your plugin. @@ -196,6 +202,8 @@ This guide doesn't cover how to create different files and components. If you’ - How to [create an entity](./../entities/index.md) - How to [create a migration](../migrations/index.md) +--- + ## Add Plugin Configuration Plugins often allow developers that will later use them to enter their own configuration. For example, you can allow developers to specify the API key of a service you’re integrating. @@ -204,7 +212,7 @@ To pass a plugin its configurations on a Medusa server, you have to add it to th ```jsx title=medusa-config.js const plugins = [ - //... + // ... { resolve: `medusa-plugin-custom`, options: { @@ -217,19 +225,23 @@ const plugins = [ Then, you can have access to your plugin configuration in the constructor of services in your plugin: ```jsx title=src/service/test.ts -//In a service in your plugin -constructor({}, options) { - //options contains plugin configurations - this.name = options.name + // In a service in your plugin +class MyService extends TransactionBaseService { + constructor(container, options) { + super(container) + // options contains plugin configurations + this.name = options.name + } + // ... } ``` You can also have access to the configurations in endpoints in your plugin: ```jsx title=src/api/index.ts -//in an endpoint in your plugin +// in an endpoint in your plugin export default (rootDirectory, options) => { - //options contain the plugin configurations + // options contain the plugin configurations const router = Router() router.get("/hello-world", (req, res) => { @@ -248,6 +260,8 @@ Make sure to include in the README of your plugin the configurations that can be ::: +--- + ## Test Your Plugin While you develop your plugin, you’ll need to test it on an actual Medusa server. This can be done by using the [npm link](https://docs.npmjs.com/cli/v8/commands/npm-link) command. @@ -283,10 +297,10 @@ Then, add your plugin into the array of plugins in `medusa-config.js`: ```jsx title=medusa-config.js const plugins = [ - //... + // ... { resolve: `medusa-plugin-custom`, - //if your plugin has configurations + // if your plugin has configurations options: { name: "My Store", }, @@ -354,6 +368,8 @@ It is safe to ignore any `cross-env: command not found` error you may receive. ::: +--- + ## NPM Ignore File Not all files that you use while developing your plugin are necessary to be published. @@ -387,6 +403,8 @@ medusa-db.sql develop.sh ``` +--- + ## Publish Plugin Once you’re done developing your plugin you can publish the package on NPM’s registry so that other developers can benefit from it and use it. @@ -439,6 +457,8 @@ Then, publish the new update: npm publish ``` +--- + ## Add Plugin to Medusa’s Repository All officially-supported plugins are available in the [`packages` directory of the Medusa GitHub repository](https://github.com/medusajs/medusa/tree/master/packages). @@ -451,6 +471,8 @@ Before contributing to the Medusa repository, please check out the [contribution ::: +--- + ## Install a Plugin To install any published plugin, you can run the following command on any Medusa server project: @@ -459,8 +481,10 @@ To install any published plugin, you can run the following command on any Medusa npm install medusa-plugin-custom ``` -## What’s Next +--- -- Check out [available Services in Medusa](references/services/../../../../../references/services/classes/AuthService.md) that you can use in your plugin. -- Check out [available events](../subscribers/events-list.md) that you can listen to in Subscribers. -- Check out [available official plugins](https://github.com/medusajs/medusa/tree/master/packages). +## See Also + +- [Available official plugins](https://github.com/medusajs/medusa/tree/master/packages) +- [Services reference](references/services/../../../../../references/services/classes/AuthService.md) +- [Events reference](../subscribers/events-list.md) diff --git a/docs/content/advanced/backend/plugins/overview.md b/docs/content/advanced/backend/plugins/overview.md index aaad259683..2a3b68f267 100644 --- a/docs/content/advanced/backend/plugins/overview.md +++ b/docs/content/advanced/backend/plugins/overview.md @@ -14,6 +14,8 @@ An alternative approach is developing a custom way of handling payment on your e Plugins run within the same process as the core Medusa server eliminating the need for extra server capacity, infrastructure, and maintenance. As a result, plugins can use all other services as dependencies and access the database. +--- + ## Using Existing Plugins ### Official Plugins @@ -48,7 +50,9 @@ If you’re installing an official plugin from the Medusa repository, you can fi For community plugins, please refer to the installation instructions of that plugin to learn about any required configurations. -## What’s Next +--- -- Learn how to [create your own plugin](create.md). -- Learn how to [create a fulfillment provider](../shipping/add-fulfillment-provider.md) or a [payment provider](../payment/how-to-create-payment-provider.md). +## See Also + +- [Create your own plugin](create.md) +- [Create a fulfillment provider](../shipping/add-fulfillment-provider.md) or a [payment provider](../payment/how-to-create-payment-provider.md) diff --git a/docs/content/advanced/backend/price-lists/index.md b/docs/content/advanced/backend/price-lists/index.md index 4784a019e9..f8b10cdba4 100644 --- a/docs/content/advanced/backend/price-lists/index.md +++ b/docs/content/advanced/backend/price-lists/index.md @@ -81,7 +81,7 @@ Since the line item belongs to a cart, there’s no need to pass the `region_id` --- -## What’s Next +## See Also -- Learn more about [price selection strategies](../price-selection-strategy/index.md). -- Learn [how to use the PriceList Admin APIs](./use-api.mdx). +- [Price Selection Strategy Overview](../price-selection-strategy/index.md). +- [Use the PriceList Admin APIs](./use-api.mdx). diff --git a/docs/content/advanced/backend/price-lists/use-api.mdx b/docs/content/advanced/backend/price-lists/use-api.mdx index 48bb7da30f..03b190f827 100644 --- a/docs/content/advanced/backend/price-lists/use-api.mdx +++ b/docs/content/advanced/backend/price-lists/use-api.mdx @@ -15,7 +15,7 @@ This document doesn't cover what price lists are and their basics. If you’re i ### Medusa Components -It is assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../../quickstart/quick-start.md) to get started. +It is assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../../quickstart/quick-start.mdx) to get started. ### JS Client @@ -37,6 +37,8 @@ When you create a price list, you can specify different conditions to control wh In the body of your request, aside from the required fields, you can send the following fields to apply different conditions: + + ```js noReport { prices: [ @@ -70,28 +72,28 @@ For example, sending the following request creates a price list with two prices: import { PriceListType } from "@medusajs/medusa" medusa.admin.priceLists.create({ - name: 'New Price List', - description: 'A new price list', + name: "New Price List", + description: "A new price list", type: PriceListType.SALE, - status: 'active', + status: "active", prices: [ { amount: 1000, variant_id, - currency_code: 'eur', - max_quantity: 3 + currency_code: "eur", + max_quantity: 3, }, { amount: 1500, variant_id, - currency_code: 'eur', - min_quantity: 4 - } - ] + currency_code: "eur", + min_quantity: 4, + }, + ], }) .then(({ price_list }) => { - console.log(price_list.id); -}); + console.log(price_list.id) +}) ``` @@ -99,31 +101,31 @@ medusa.admin.priceLists.create({ ```jsx fetch(`/admin/price-lists`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - name: 'New Price List', - description: 'A new price list', - type: 'sale', - status: 'active', + name: "New Price List", + description: "A new price list", + type: "sale", + status: "active", prices: [ { amount: 1000, variant_id, - currency_code: 'eur', - max_quantity: 3 + currency_code: "eur", + max_quantity: 3, }, { amount: 1500, variant_id, - currency_code: 'eur', - min_quantity: 4 - } - ] - }) + currency_code: "eur", + min_quantity: 4, + }, + ], + }), }) .then((response) => response.json()) .then(({ price_list }) => { @@ -179,8 +181,8 @@ You can retrieve all of a price list’s details using the Get a Price List endp ```jsx medusa.admin.priceLists.retrieve(priceListId) .then(({ price_list }) => { - console.log(price_list.id); -}); + console.log(price_list.id) +}) ``` @@ -188,7 +190,7 @@ medusa.admin.priceLists.retrieve(priceListId) ```jsx fetch(`/admin/price-lists/${priceListId}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ price_list }) => { @@ -199,7 +201,7 @@ fetch(`/admin/price-lists/${priceListId}`, { -```jsx +```bash curl -L -X GET '/admin/price-lists/{id}' \ -H 'Authorization: Bearer ' ``` @@ -220,11 +222,11 @@ For example, by sending the following request the end date of the price list wil ```jsx medusa.admin.priceLists.update(priceListId, { - ends_at: '2022-10-11' + ends_at: "2022-10-11", }) .then(({ price_list }) => { - console.log(price_list.id); -}); + console.log(price_list.id) +}) ``` @@ -232,14 +234,14 @@ medusa.admin.priceLists.update(priceListId, { ```jsx fetch(`/admin/price-lists/${priceListId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - ends_at: '2022-10-11' - }) + ends_at: "2022-10-11", + }), }) .then((response) => response.json()) .then(({ price_list }) => { @@ -287,13 +289,13 @@ medusa.admin.priceLists.addPrices(priceListId, { { amount: 1200, variant_id, - currency_code: 'eur' - } - ] + currency_code: "eur", + }, + ], }) .then(({ price_list }) => { - console.log(price_list.id); -}); + console.log(price_list.id) +}) ``` @@ -301,20 +303,20 @@ medusa.admin.priceLists.addPrices(priceListId, { ```jsx fetch(`/admin/price-lists/${priceListId}/prices/batch`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ prices: [ { amount: 1200, variant_id, - currency_code: 'eur' - } - ] - }) + currency_code: "eur", + }, + ], + }), }) .then((response) => response.json()) .then(({ price_list }) => { @@ -357,18 +359,23 @@ You can delete all the prices of a product’s variants using the [Delete Produc ```jsx medusa.admin.priceLists.deleteProductPrices(priceListId, productId) .then(({ ids, object, deleted }) => { - console.log(ids.length); -}); + console.log(ids.length) +}) ``` + + ```jsx -fetch(`/admin/price-lists/${priceListId}/products/${productId}/prices`, { - method: 'DELETE', - credentials: 'include', -}) +fetch( + `/admin/price-lists/${priceListId}/products/${productId}/prices`, + { + method: "DELETE", + credentials: "include", + } +) .then((response) => response.json()) .then(({ ids, object, deleted }) => { console.log(ids.length) @@ -398,18 +405,23 @@ You can delete all the prices of a variant using the [Delete Variant Prices](htt ```jsx medusa.admin.priceLists.deleteVariantPrices(priceListId, variantId) .then(({ ids, object, deleted }) => { - console.log(ids); -}); + console.log(ids) +}) ``` + + ```jsx -fetch(`/admin/price-lists/${priceListId}/variants/${variantId}/prices`, { - method: 'DELETE', - credentials: 'include', -}) +fetch( + `/admin/price-lists/${priceListId}/variants/${variantId}/prices`, + { + method: "DELETE", + credentials: "include", + } +) .then((response) => response.json()) .then(({ ids, object, deleted }) => { console.log(ids.length) @@ -419,7 +431,7 @@ fetch(`/admin/price-lists/${priceListId}/variants/${variantId}/price -```jsx +```bash curl -L -X DELETE '/admin/price-lists//variants//prices' \ -H 'Authorization: Bearer ' ``` @@ -441,8 +453,8 @@ You can delete a price list, and subsequently all prices defined in it, using th ```jsx medusa.admin.priceLists.delete(priceListId) .then(({ id, object, deleted }) => { - console.log(id); -}); + console.log(id) +}) ``` @@ -450,8 +462,8 @@ medusa.admin.priceLists.delete(priceListId) ```jsx fetch(`/admin/price-lists/${priceListId}`, { - method: 'DELETE', - credentials: 'include', + method: "DELETE", + credentials: "include", }) .then((response) => response.json()) .then(({ id, object, deleted }) => { @@ -462,7 +474,7 @@ fetch(`/admin/price-lists/${priceListId}`, { -```jsx +```bash curl -L -X DELETE '/admin/price-lists/' \ -H 'Authorization: Bearer ' ``` @@ -474,7 +486,7 @@ This request returns the ID of the deleted price list. --- -## What’s Next +## See Also -- Learn more about [price lists](./index.md). -- Learn how the [price selection strategy works](../price-selection-strategy/index.md). \ No newline at end of file +- [Price Lists Overview](./index.md). +- [Price Selection Strategy Overview](../price-selection-strategy/index.md). diff --git a/docs/content/advanced/backend/price-selection-strategy/index.md b/docs/content/advanced/backend/price-selection-strategy/index.md index 4d552d81d5..1d4adcc7a7 100644 --- a/docs/content/advanced/backend/price-selection-strategy/index.md +++ b/docs/content/advanced/backend/price-selection-strategy/index.md @@ -60,7 +60,7 @@ The context that is passed to the `calculateVariantPrice` method is an object th --- -## What’s Next +## See Also -- Learn [how to override the price selection strategy](./override.md). -- Learn more about [price lists](./../price-lists/index.md). +- [Override the Price Selection Strategy](./override.md) +- [Price Lists Overview](./../price-lists/index.md) diff --git a/docs/content/advanced/backend/price-selection-strategy/override.md b/docs/content/advanced/backend/price-selection-strategy/override.md index a1274a2785..ad21f5949d 100644 --- a/docs/content/advanced/backend/price-selection-strategy/override.md +++ b/docs/content/advanced/backend/price-selection-strategy/override.md @@ -114,6 +114,6 @@ Then, try out your strategy using any of the [Products](https://docs.medusajs.co --- -## What’s Next +## See Also -- Learn more about [price list selection strategy](./index.md). +- [Price List Selection Strategy Overview](./index.md) diff --git a/docs/content/advanced/backend/regions/overview.md b/docs/content/advanced/backend/regions/overview.md index d374500bbb..5bf329ba4c 100644 --- a/docs/content/advanced/backend/regions/overview.md +++ b/docs/content/advanced/backend/regions/overview.md @@ -111,7 +111,7 @@ The relation between the `Region` and `TaxRate` entities is available on both en --- -## What’s Next +## See Also -- Learn [how to use regions in a storefront using the store REST APIs](../../storefront/use-regions.mdx). -- Learn how to [manage regions using the admin REST APIs](../../admin/manage-regions.mdx). +- [Use Regions in a storefront](../../storefront/use-regions.mdx). +- [Use Regions in the admin](../../admin/manage-regions.mdx). diff --git a/docs/content/advanced/backend/sales-channels/index.md b/docs/content/advanced/backend/sales-channels/index.md index 7d48c47d42..6101eaba79 100644 --- a/docs/content/advanced/backend/sales-channels/index.md +++ b/docs/content/advanced/backend/sales-channels/index.md @@ -68,7 +68,7 @@ The relation is implemented in the [Order](../../../references/entities/classes/ --- -## What’s Next +## See Also -- Learn how to [manage Sales Channels using the Admin APIs](./manage-admin.mdx). -- Check out the [Sales Channel’s Admin APIs](https://docs.medusajs.com/api/admin/#tag/Sales-Channel). +- [Manage Sales Channels using the Admin APIs](./manage-admin.mdx) +- [Sales Channel’s Admin APIs Reference](/api/admin/#tag/Sales-Channel) diff --git a/docs/content/advanced/backend/sales-channels/manage-admin.mdx b/docs/content/advanced/backend/sales-channels/manage-admin.mdx index f907b18d46..2cb813ee95 100644 --- a/docs/content/advanced/backend/sales-channels/manage-admin.mdx +++ b/docs/content/advanced/backend/sales-channels/manage-admin.mdx @@ -1,7 +1,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# How to Use SalesChannels APIs +# How to Manage Sales Channels In this document, you’ll learn how to manage sales channels and their products and orders using the Admin APIs. @@ -23,7 +23,7 @@ This guide explains how to perform all these operations using the Admin APIs. ### Medusa Components -It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../../quickstart/quick-start.md) to get started. +It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../../quickstart/quick-start.mdx) to get started. ### Enabled Feature Flags @@ -57,12 +57,12 @@ You can create a sales channel by sending a request to the Create a Sales Channe ```jsx medusa.admin.salesChannels.create({ - name: 'App', - description: 'Mobile app' + name: "App", + description: "Mobile app", }) .then(({ sales_channel }) => { - console.log(sales_channel.id); -}); + console.log(sales_channel.id) +}) ``` @@ -70,20 +70,20 @@ medusa.admin.salesChannels.create({ ```jsx fetch(`/admin/sales-channels`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - name: 'App', - description: 'Mobile app' - }) + name: "App", + description: "Mobile app", + }), }) .then((response) => response.json()) .then(({ sales_channel }) => { console.log(sales_channel.id) -}); +}) ``` @@ -118,8 +118,8 @@ You can list all sales channels by sending a request to the List Sales Channels ```jsx medusa.admin.salesChannels.list() .then(({ sales_channels, limit, offset, count }) => { - console.log(sales_channels.length); -}); + console.log(sales_channels.length) +}) ``` @@ -127,12 +127,12 @@ medusa.admin.salesChannels.list() ```jsx fetch(`/admin/sales-channels`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ sales_channels, limit, offset, count }) => { console.log(sales_channels.length) -}); +}) ``` @@ -160,8 +160,8 @@ You can retrieve a sales channel’s details by its ID using the Get Sales Chann ```jsx medusa.admin.salesChannels.retrieve(salesChannelId) .then(({ sales_channel }) => { - console.log(sales_channel.id); -}); + console.log(sales_channel.id) +}) ``` @@ -169,12 +169,12 @@ medusa.admin.salesChannels.retrieve(salesChannelId) ```jsx fetch(`/admin/sales-channels/${salesChannelId}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ sales_channels, limit, offset, count }) => { console.log(sales_channels.length) -}); +}) ``` @@ -201,11 +201,11 @@ You can update a Sales Channel’s details and attributes by sending a request t ```jsx medusa.admin.salesChannels.update(salesChannelId, { - is_disabled: false + is_disabled: false, }) .then(({ sales_channel }) => { - console.log(sales_channel.id); -}); + console.log(sales_channel.id) +}) ``` @@ -213,19 +213,19 @@ medusa.admin.salesChannels.update(salesChannelId, { ```jsx fetch(`/admin/sales-channels/${salesChannelId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - is_disabled: false - }) + is_disabled: false, + }), }) .then((response) => response.json()) .then(({ sales_channel }) => { console.log(sales_channel.id) -}); +}) ``` @@ -261,8 +261,8 @@ You can delete a sales channel by sending a request to the Delete Sales Channel ```jsx medusa.admin.salesChannels.delete(salesChannelId) .then(({ id, object, deleted }) => { - console.log(id); -}); + console.log(id) +}) ``` @@ -270,13 +270,13 @@ medusa.admin.salesChannels.delete(salesChannelId) ```jsx fetch(`/admin/sales-channels/${salesChannelId}`, { - method: 'DELETE', - credentials: 'include', + method: "DELETE", + credentials: "include", }) .then((response) => response.json()) .then(({ id, object, deleted }) => { console.log(id) -}); +}) ``` @@ -307,37 +307,40 @@ To add a product to a sales channel, send a request to the Sales Channel’s Add medusa.admin.salesChannels.addProducts(salesChannelId, { product_ids: [ { - id: productId - } - ] + id: productId, + }, + ], }) .then(({ sales_channel }) => { - console.log(sales_channel.id); -}); + console.log(sales_channel.id) +}) ``` ```jsx -fetch(`/admin/sales-channels/${salesChannelId}/products/batch`, { - method: 'POST', - credentials: 'include', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - product_ids: [ - { - id: productId - } - ] - }) -}) +fetch( + `/admin/sales-channels/${salesChannelId}/products/batch`, + { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + product_ids: [ + { + id: productId, + }, + ], + }), + } +) .then((response) => response.json()) .then(({ sales_channel }) => { console.log(sales_channel.id) -}); +}) ``` @@ -373,25 +376,28 @@ You can list the products available in a sales channel by sending a request to t ```jsx medusa.admin.products.list({ sales_channel_id: [ - salesChannelId - ] + salesChannelId, + ], }) .then(({ products, limit, offset, count }) => { - console.log(products.length); -}); + console.log(products.length) +}) ``` ```jsx -fetch(`/admin/products?sales_channel_id[0]=${salesChannelId}`, { - credentials: 'include', -}) +fetch( + `/admin/products?sales_channel_id[0]=${salesChannelId}`, + { + credentials: "include", + } +) .then((response) => response.json()) .then(({ products, limit, offset, count }) => { console.log(products.length) -}); +}) ``` @@ -424,43 +430,46 @@ You can delete a product from a sales channel by sending a request to the Sales medusa.admin.salesChannels.removeProducts(salesChannelId, { product_ids: [ { - id: productId - } - ] + id: productId, + }, + ], }) .then(({ sales_channel }) => { - console.log(sales_channel.id); -}); + console.log(sales_channel.id) +}) ``` ```jsx -fetch(`/admin/sales-channels/${salesChannelId}/products/batch`, { - method: 'DELETE', - credentials: 'include', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - product_ids: [ - { - id: productId - } - ] - }) -}) +fetch( + `/admin/sales-channels/${salesChannelId}/products/batch`, + { + method: "DELETE", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + product_ids: [ + { + id: productId, + }, + ], + }), + } +) .then((response) => response.json()) .then(({ sales_channel }) => { console.log(sales_channel.id) -}); +}) ``` -```jsx +```bash curl -L -X DELETE '/admin/sales-channels//products/batch' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ @@ -492,14 +501,14 @@ You can filter orders by a specific sales channel by sending a request to the Li ```jsx medusa.admin.orders.list({ sales_channel_id: [ - salesChannelId + salesChannelId, ], limit: 50, - offset: 0 + offset: 0, }) .then(({ orders, limit, offset, count }) => { - console.log(orders.length); -}); + console.log(orders.length) +}) ``` @@ -507,18 +516,18 @@ medusa.admin.orders.list({ ```jsx fetch(`/admin/orders?sales_channel_id[0]=${salesChannelId}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ orders, limit, offset, count }) => { console.log(orders.length) -}); +}) ``` -```jsx +```bash curl -L -X GET '/admin/orders?sales_channel_id[0]=' \ -H 'Authorization: Bearer ' ``` @@ -530,6 +539,6 @@ The request returns an array of orders that are associated with the specified sa --- -## What’s Next +## See Also -- Learn more about [Sales Channels and how they work](./index.md). \ No newline at end of file +- [Sales Channels Overview](./index.md). \ No newline at end of file diff --git a/docs/content/advanced/backend/scheduled-jobs/create.md b/docs/content/advanced/backend/scheduled-jobs/create.md index 246f2be93d..86fcf8e7e8 100644 --- a/docs/content/advanced/backend/scheduled-jobs/create.md +++ b/docs/content/advanced/backend/scheduled-jobs/create.md @@ -8,16 +8,20 @@ Medusa allows you to create scheduled jobs that run at specific times during you This guide explains how to create a scheduled job on your Medusa server. The scheduled job in this example will simply change the status of draft products to `published`. +--- + ## Prerequisites ### Medusa Components -It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../../quickstart/quick-start.md) to get started. +It is assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../../quickstart/quick-start.mdx) to get started. ### Redis Redis is required for scheduled jobs to work. Make sure you [install Redis](../../../tutorial/0-set-up-your-development-environment.mdx#redis) and [configure it with your Medusa server](../../../usage/configurations.md#redis). +--- + ## 1. Create a File Each scheduled job should reside in a TypeScript or JavaScript file under the `src/loaders` directory. @@ -26,29 +30,33 @@ Start by creating the `src/loaders` directory. Then, inside that directory, crea For the example in this tutorial, you can create the file `src/loaders/publish.ts`. +--- + ## 2. Create Cron Job To create a scheduled job, add the following code in the file you created, which is `src/loaders/publish.ts` in this example: ```ts title=src/loaders/publish.ts const publishJob = async (container, options) => { - const jobSchedulerService = container.resolve("jobSchedulerService"); - jobSchedulerService.create("publish-products", {}, "0 0 * * *", async () => { - //job to execute - const productService = container.resolve("productService"); - const draftProducts = await productService.list({ - status: 'draft' - }); + const jobSchedulerService = container.resolve("jobSchedulerService") + jobSchedulerService.create("publish-products", {}, "0 0 * * *", + async () => { + // job to execute + const productService = container.resolve("productService") + const draftProducts = await productService.list({ + status: "draft", + }) - for (const product of draftProducts) { - await productService.update(product.id, { - status: 'published' - }); + for (const product of draftProducts) { + await productService.update(product.id, { + status: "published", + }) + } } - }) + ) } -export default publishJob; +export default publishJob ``` :::info @@ -81,14 +89,16 @@ For example: ```ts jobSchedulerService.create("publish-products", { data: { - productId - } + productId, + }, }, "0 0 * * *", async (job) => { - console.log(job.data); // {productId: 'prod_124...'} - //... -}); + console.log(job.data) // {productId: 'prod_124...'} + // ... +}) ``` +--- + ## 3. Run Medusa Server :::info @@ -129,6 +139,8 @@ To test the previous example out instantly, you can change the scheduled job exp ::: -## What’s Next +--- -- Learn more about [services and how you can use them](../services/overview.md). +## See Also + +- [Services Overview](../services/overview.md). diff --git a/docs/content/advanced/backend/services/create-service.md b/docs/content/advanced/backend/services/create-service.md index 3b521eed30..5180c6adaa 100644 --- a/docs/content/advanced/backend/services/create-service.md +++ b/docs/content/advanced/backend/services/create-service.md @@ -9,12 +9,12 @@ To create a service, create a TypeScript or JavaScript file in `src/services` to For example, if you want to create a service `helloService`, create the file `hello.ts` in `src/services` with the following content: ```ts title=/src/services/hello.ts -import { TransactionBaseService } from '@medusajs/medusa'; -import { EntityManager } from 'typeorm'; +import { TransactionBaseService } from "@medusajs/medusa" +import { EntityManager } from "typeorm" class HelloService extends TransactionBaseService { - protected manager_: EntityManager; - protected transactionManager_: EntityManager; + protected manager_: EntityManager + protected transactionManager_: EntityManager getMessage() { return `Welcome to My Store!` } @@ -23,6 +23,8 @@ class HelloService extends TransactionBaseService { export default HelloService ``` +--- + ## Service Constructor As the service extends the `TransactionBaseService` class, all services in Medusa’s core, as well as all your custom services, will be available in your service’s constructor using dependency injection. @@ -30,22 +32,30 @@ As the service extends the `TransactionBaseService` class, all services in Medus So, if you want your service to use another service, simply add it as part of your constructor’s dependencies and set it to a field inside your service’s class: ```ts -private productService: ProductService; +class HelloService extends TransactionBaseService { + private productService: ProductService -constructor(container) { - super(container); - this.productService = container.productService; + constructor(container) { + super(container) + this.productService = container.productService + } + // ... } ``` Then, you can use that service anywhere in your custom service: ```ts -async getProductCount() { - return await this.productService.count(); +class HelloService extends TransactionBaseService { + // ... + async getProductCount() { + return await this.productService.count() + } } ``` +--- + ## Use a Service In this section, you'll learn how to use services throughout your Medusa server. This includes both Medusa's services and your custom services. @@ -65,9 +75,12 @@ npm run build To use your custom service in another custom service, you can have easy access to it in the dependencies injected to the constructor of your service: ```ts -constructor(container) { - super(container); - this.helloService = container.helloService; +class MyService extends TransactionBaseService { + constructor(container) { + super(container) + this.helloService = container.helloService + } + // ... } ``` @@ -88,12 +101,17 @@ res.json({ To use your custom service in a subscriber, you can have easy access to it in the subscriber’s dependencies injected to the constructor of your subscriber: ```ts -constructor({ helloService, eventBusService }) { - this.helloService = helloService; +class MySubscriber { + constructor({ helloService, eventBusService }) { + this.helloService = helloService + } + // ... } ``` -## What’s Next +--- -- Check out the [Services Reference](/references/services/classes/AuthService) to see a list of all services in Medusa. -- [Learn How to Create an Endpoint.](../endpoints/add.md) +## See Also + +- [Services Reference](/references/services/classes/AuthService) +- [Create an Endpoint](../endpoints/add.md) diff --git a/docs/content/advanced/backend/services/overview.md b/docs/content/advanced/backend/services/overview.md index 4fe54a9f25..6d4209f895 100644 --- a/docs/content/advanced/backend/services/overview.md +++ b/docs/content/advanced/backend/services/overview.md @@ -18,7 +18,9 @@ For example, if the file name is `hello.ts`, the service will be registered as ` The registration name of the service is important, as you’ll be referring to it when you want to get access to the service using dependency injection or in routes. -## What's Next +--- -- Learn [how to create a service](./create-service.md) -- Check out the [Services Reference](/references/services/classes/AuthService) to see a list of all services in Medusa. +## See Also + +- [Create a Service](./create-service.md) +- [Services Reference](/references/services/classes/AuthService) diff --git a/docs/content/advanced/backend/shipping/add-fulfillment-provider.md b/docs/content/advanced/backend/shipping/add-fulfillment-provider.md index 7bc75b204a..3d41fa456c 100644 --- a/docs/content/advanced/backend/shipping/add-fulfillment-provider.md +++ b/docs/content/advanced/backend/shipping/add-fulfillment-provider.md @@ -19,6 +19,8 @@ Also, the fulfillment provider class should have a static property `identifier`. Fulfillment providers are loaded and installed on the server startup. +--- + ## Create a Fulfillment Provider The first step is to create a JavaScript or TypeScript file under `src/services`. For example, create the file `src/services/my-fulfillment.ts` with the following content: @@ -30,7 +32,7 @@ class MyFulfillmentService extends FulfillmentService { } -export default MyFulfillmentService; +export default MyFulfillmentService ``` Fulfillment provider services must extend the `FulfillmentService` class imported from `medusa-interfaces`. @@ -53,10 +55,10 @@ The value of this property will also be used to reference the fulfillment provid import { FulfillmentService } from "medusa-interfaces" class MyFulfillmentService extends FulfillmentService { - static identifier = 'my-fulfillment'; + static identifier = "my-fulfillment" } -export default MyFulfillmentService; +export default MyFulfillmentService ``` ### constructor @@ -70,9 +72,12 @@ Additionally, if you’re creating your fulfillment provider as an external plug For example: ```ts -constructor({ productService }, options) { - super(); - //you can access options here +class MyFulfillmentService extends FulfillmentService { + // ... + constructor(container, options) { + super(container) + // you can access options here + } } ``` @@ -87,15 +92,18 @@ These fulfillment options are defined in the `getFulfillmentOptions` method. Thi For example: ```ts -async getFulfillmentOptions () { - return [ - { - id: 'my-fulfillment' - }, - { - id: 'my-fulfillment-dynamic' - } - ]; +class MyFulfillmentService extends FulfillmentService { + // ... + async getFulfillmentOptions() { + return [ + { + id: "my-fulfillment", + }, + { + id: "my-fulfillment-dynamic", + }, + ] + } } ``` @@ -114,8 +122,11 @@ This method returns a boolean. If the result is false, an error is thrown and th For example, you can use this method to ensure that the `id` in the `data` object is correct: ```ts -async validateOption (data) { - return data.id == 'my-fulfillment'; +class MyFulfillmentService extends FulfillmentService { + // ... + async validateOption(data) { + return data.id == "my-fulfillment" + } } ``` @@ -142,13 +153,16 @@ If everything is valid, this method must return a value that will be stored in t For example: ```ts -async validateFulfillmentData(optionData, data, cart) { - if (data.id !== "my-fulfillment") { - throw new Error("invalid data"); - } +class MyFulfillmentService extends FulfillmentService { + // ... + async validateFulfillmentData(optionData, data, cart) { + if (data.id !== "my-fulfillment") { + throw new Error("invalid data") + } - return { - ...data + return { + ...data, + } } } ``` @@ -171,14 +185,17 @@ You can use the `data` property in the shipping method (first parameter) to acce Here is a basic implementation of `createFulfillment` for a fulfillment provider that does not interact with any third-party provider to create the fulfillment: ```ts -createFulfillment( - methodData, - fulfillmentItems, - fromOrder, - fulfillment -) { - // No data is being sent anywhere - return Promise.resolve({}) +class MyFulfillmentService extends FulfillmentService { + // ... + createFulfillment( + methodData, + fulfillmentItems, + fromOrder, + fulfillment + ) { + // No data is being sent anywhere + return Promise.resolve({}) + } } ``` @@ -204,8 +221,11 @@ This method receives as a parameter the `data` object sent with the request that For example: ```ts -canCalculate(data) { - return data.id === 'my-fulfillment-dynamic'; +class MyFulfillmentService extends FulfillmentService { + // ... + canCalculate(data) { + return data.id === "my-fulfillment-dynamic" + } } ``` @@ -222,16 +242,22 @@ This method receives three parameters: If your fulfillment provider does not provide any dynamically calculated rates you can keep the function empty: ```ts -calculatePrice() { - +class MyFulfillmentService extends FulfillmentService { + // ... + calculatePrice() { + // leave empty + } } ``` Otherwise, you can use it to calculate the price with a custom logic. For example: ```ts -calculatePrice (optionData, data, cart) { - return cart.items.length * 1000; +class MyFulfillmentService extends FulfillmentService { + // ... + calculatePrice(optionData, data, cart) { + return cart.items.length * 1000 + } } ``` @@ -248,8 +274,11 @@ It receives the return created as a parameter. The value it returns is set to th This is the basic implementation of the method for a fulfillment provider that does not contact with a third-party provider to fulfill the return: ```ts -createReturn(returnOrder) { - return Promise.resolve({}) +class MyFulfillmentService extends FulfillmentService { + // ... + createReturn(returnOrder) { + return Promise.resolve({}) + } } ``` @@ -264,12 +293,16 @@ This method receives the fulfillment being cancelled as a parameter. This is the basic implementation of the method for a fulfillment provider that does not interact with a third-party provider to cancel the fulfillment: ```ts -cancelFulfillment(fulfillment) { - return Promise.resolve({}) +class MyFulfillmentService extends FulfillmentService { + // ... + cancelFulfillment(fulfillment) { + return Promise.resolve({}) + } } ``` -## What’s Next +--- -- Check out the [Webshipper plugin](https://github.com/medusajs/medusa/tree/cab5821f55cfa448c575a20250c918b7fc6835c9/packages/medusa-fulfillment-webshipper) for an example of a fulfillment provider that interacts with a third-party providers. -- Check out the [manual fulfillment plugin](https://github.com/medusajs/medusa/tree/cab5821f55cfa448c575a20250c918b7fc6835c9/packages/medusa-fulfillment-manual) for a basic implementation of a fulfillment provider. +## 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) diff --git a/docs/content/advanced/backend/shipping/overview.md b/docs/content/advanced/backend/shipping/overview.md index c14919ef26..e5c9f1384e 100644 --- a/docs/content/advanced/backend/shipping/overview.md +++ b/docs/content/advanced/backend/shipping/overview.md @@ -10,6 +10,8 @@ The distinction between the four is important. It has been carefully planned and It’s also constructed to support multiple regions, provide different shipment configurations and options for different product types, provide promotional shipments for your customers, and much more. +--- + ## Summary - **Fulfillment Provider:** Fulfillment providers are plugins or [Services](../services/create-service.md) used to ship the products to your customers, whether physically or virtually. An example of a fulfillment provider would be FedEx. @@ -19,6 +21,8 @@ It’s also constructed to support multiple regions, provide different shipment ![Shipping Architecture](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001762/Medusa%20Docs/Diagrams/QII2Hvn_vjkrdy.png) +--- + ## Fulfillment Provider A Fulfillment Provider in Medusa is a method to handle shipping products in selected regions. It is not associated with a cart, customer, or order in particular. @@ -37,12 +41,14 @@ As a developer, you will mainly work with the Fulfillment Provider when integrat When you run your Medusa server, the Fulfillment Provider will be registered on your server if it hasn’t been already. -Once the Fulfillment Provider is added to the server, the store operator will be able to associate on the [Medusa Admin](../../../quickstart/quick-start.md) the Fulfillment Provider with shipping options. +Once the Fulfillment Provider is added to the server, the store operator will be able to associate on the [Medusa Admin](../../../quickstart/quick-start.mdx) the Fulfillment Provider with shipping options. ### FulfillmentProvider Entity Overview The [`FulfillmentProvider`](../../../references/entities/classes/FulfillmentProvider.md) entity only has 2 attributes: `is_installed` to indicate if the fulfillment provider is installed and its value is a boolean; and `id` which is the unique identifier that you define in the Fulfillment Provider Service. +--- + ## Shipping Profile Shipping profiles are the highest in the hierarchy in the shipping architecture. @@ -69,6 +75,8 @@ The `ShippingProfile` has a `type` attribute that can be `default`, `gift_ca The `ShippingProfile` entity also has an array of `ShippingOption` instances. +--- + ## Shipping Option After the admin adds a shipping profile, they can add shipping options that belong to that shipping profile from the admin dashboard. @@ -105,6 +113,8 @@ The `data` attribute is used to specify any data necessary for fulfilling the The `data` attribute does not have any specific format. It’s up to you to choose whatever data is included here. +--- + ## Shipping Method Unlike the previous two components, a shipping method is not created by the admin. It’s created when a `POST` request is sent to `/store/carts/:id/shipping-methods` after the customer chooses a shipping option. @@ -135,7 +145,9 @@ The `ShippingMethod` also belongs to the `Order` entity. This association is The `ShippingMethod` instance holds a `price` attribute, which will either be the flat rate price or the calculated price. -## What’s Next +--- -- [Learn how to Create a Fulfillment Provider.](./add-fulfillment-provider.md) -- Check out [available shipping plugins](https://github.com/medusajs/medusa/tree/master/packages). +## See Also + +- [Create a Fulfillment Provider](./add-fulfillment-provider.md) +- [Available shipping plugins](https://github.com/medusajs/medusa/tree/master/packages) diff --git a/docs/content/advanced/backend/subscribers/create-subscriber.md b/docs/content/advanced/backend/subscribers/create-subscriber.md index 7a63a2151d..75dc810e03 100644 --- a/docs/content/advanced/backend/subscribers/create-subscriber.md +++ b/docs/content/advanced/backend/subscribers/create-subscriber.md @@ -8,6 +8,8 @@ Medusa's event system works by pushing data to a Queue that each handler then ge You can learn how to [install Redis](../../../tutorial/0-set-up-your-development-environment.mdx#redis) and [configure it with Medusa](../../../usage/configurations.md#redis) before you get started. +--- + ## Implementation A subscriber is a TypeScript or JavaScript file that is created under `src/subscribers`. Its file name, by convension, should be the class name of the subscriber without the word `Subscriber`. For example, if the subscriber is `HelloSubscriber`, the file name should be `hello.ts`. @@ -16,20 +18,20 @@ After creating the file under `src/subscribers`, in the constructor of your subs The `eventBusService.subscribe` method receives the name of the event as a first parameter and as a second parameter a method in your subscriber that will handle this event. -For example, here is the `OrderNotifierSubscriber` class created in `src/subscribers/orderNotifier.js`: +For example, here is the `OrderNotifierSubscriber` class created in `src/subscribers/orderNotifier.ts`: -```ts title=src/subscribers/orderNotifier.js +```ts title=src/subscribers/orderNotifier.ts class OrderNotifierSubscriber { constructor({ eventBusService }) { - eventBusService.subscribe("order.placed", this.handleOrder); + eventBusService.subscribe("order.placed", this.handleOrder) } handleOrder = async (data) => { console.log("New Order: " + data.id) - }; + } } -export default OrderNotifierSubscriber; +export default OrderNotifierSubscriber ``` This subscriber registers the method `handleOrder` as one of the handlers of the `order.placed` event. The method `handleOrder` will be executed every time an order is placed. It receives the order ID in the `data` parameter. You can then use the order’s details to perform any kind of task you need. @@ -40,6 +42,8 @@ The `data` object won't contain other order data. Only the ID of the order. You ::: +--- + ## Using Services in Subscribers You can access any service through the dependencies injected to your subscriber’s constructor. @@ -47,19 +51,25 @@ You can access any service through the dependencies injected to your subscriber For example: ```ts -constructor({ productService, eventBusService }) { - this.productService = productService; +class OrderNotifierSubscriber { + constructor({ productService, eventBusService }) { + this.productService = productService - eventBusService.subscribe("order.placed", this.handleOrder); + eventBusService.subscribe("order.placed", this.handleOrder) + } + // ... } ``` You can then use `this.productService` anywhere in your subscriber’s methods. For example: ```ts -handleOrder = async (data) => { - //... - const product = this.productService.list() +class OrderNotifierSubscriber { + // ... + handleOrder = async (data) => { + // ... + const product = this.productService.list() + } } ``` @@ -69,7 +79,9 @@ When using attributes defined in the subscriber, such as the `productService` in ::: -## What’s Next +--- -- [View the list of all events](events-list.md) -- [Learn how to create a service.](/advanced/backend/services/create-service) +## See Also + +- [Events reference](events-list.md) +- [Create a Service](../services/create-service) diff --git a/docs/content/advanced/backend/subscribers/events-list.md b/docs/content/advanced/backend/subscribers/events-list.md index 02953731bc..ee1144a7ef 100644 --- a/docs/content/advanced/backend/subscribers/events-list.md +++ b/docs/content/advanced/backend/subscribers/events-list.md @@ -6,6 +6,8 @@ This document details all events in Medusa, when they are triggered, and what da It is assumed you’re already familiar with [Subscribers in Medusa and how to listen to events](create-subscriber.md). You can then use the name of events from this documentation in your subscriber to listen to events. +--- + ## Legend Events in this document are listed under the entity they’re associated with. They’re listed in a table of three columns: @@ -14,6 +16,8 @@ Events in this document are listed under the entity they’re associated with. T 2. **Description:** When this event is triggered. 3. **Event Data Payload**: The data your handler receives as a parameter. +--- + ## Batch Jobs Events This section holds all events related to batch jobs. @@ -47,7 +51,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of batch job + id // string ID of batch job } ``` @@ -68,7 +72,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of batch job + id // string ID of batch job } ``` @@ -89,7 +93,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of batch job + id // string ID of batch job } ``` @@ -112,7 +116,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of batch job + id // string ID of batch job } ``` @@ -135,7 +139,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of batch job + id // string ID of batch job } ``` @@ -156,7 +160,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of batch job + id // string ID of batch job } ``` @@ -177,7 +181,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of batch job + id // string ID of batch job } ``` @@ -198,7 +202,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of batch job + id // string ID of batch job } ``` @@ -208,6 +212,8 @@ Object of the following format: +--- + ## Cart Events This section holds all events related to a cart. @@ -256,7 +262,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of cart + id // string ID of cart } ``` @@ -284,6 +290,8 @@ An object with at least the ID of the cart, however, in most cases the entire ca +--- + ## Claim Events This section holds all events related to claims. @@ -321,8 +329,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of claim - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of claim + no_notification // boolean indicating whether a notification should be sent } ``` @@ -346,8 +354,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of claim - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of claim + no_notification // boolean indicating whether a notification should be sent } ``` @@ -371,8 +379,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of claim - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of claim + no_notification // boolean indicating whether a notification should be sent } ``` @@ -396,9 +404,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of claim - fulfillment_id, //string ID of the fulfillment created - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of claim + fulfillment_id, // string ID of the fulfillment created + no_notification // boolean indicating whether a notification should be sent } ``` @@ -422,9 +430,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of claim - fulfillment_id, //string ID of the fulfillment created - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of claim + fulfillment_id, // string ID of the fulfillment created + no_notification // boolean indicating whether a notification should be sent } ``` @@ -448,8 +456,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of claim - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of claim + no_notification // boolean indicating whether a notification should be sent } ``` @@ -459,6 +467,8 @@ Object of the following format: +--- + ## Claim Item Events This section holds all events related to claim items. @@ -495,7 +505,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of claim item + id // string ID of claim item } ``` @@ -519,7 +529,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of claim item + id // string ID of claim item } ``` @@ -543,7 +553,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of claim item + id // string ID of claim item } ``` @@ -553,6 +563,8 @@ Object of the following format: +--- + ## Currency Events This section holds all events related to currencies. @@ -589,7 +601,7 @@ Object of the following format: ```js noReport noCopy { - code //string 3 character ISO code of the updated currency. + code // string 3 character ISO code of the updated currency. } ``` @@ -599,6 +611,8 @@ Object of the following format: +--- + ## Customer Events This section holds all events related to customers. @@ -671,11 +685,11 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of customer - email, //string email of the customer - first_name, //string first name of the customer - last_name, //string last name of the customer - token //string reset password token + id, // string ID of customer + email, // string email of the customer + first_name, // string first name of the customer + last_name, // string last name of the customer + token // string reset password token } ``` @@ -685,6 +699,8 @@ Object of the following format: +--- + ## Draft Order Events This section holds all events related to draft orders. @@ -721,7 +737,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of draft order + id // string ID of draft order } ``` @@ -745,7 +761,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of draft order + id // string ID of draft order } ``` @@ -755,6 +771,8 @@ Object of the following format: +--- + ## Gift Card Events This section holds all events related to gift cards. @@ -802,6 +820,8 @@ Object of the following format: +--- + ## Invite Events This section holds all events related to invites. @@ -838,9 +858,9 @@ Object of the following format: ```js noReport noCopy { - id //string ID of invite - token, //string token generated to validate the invited user - user_email //string email of invited user + id // string ID of invite + token, // string token generated to validate the invited user + user_email // string email of invited user } ``` @@ -849,6 +869,8 @@ Object of the following format: +--- + ## Note Events This section holds all events related to notes. @@ -885,7 +907,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of note + id // string ID of note } ``` @@ -909,7 +931,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of note + id // string ID of note } ``` @@ -933,7 +955,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of note + id // string ID of note } ``` @@ -943,6 +965,8 @@ Object of the following format: +--- + ## App Authentication Events This section holds all events related to app authentications. @@ -1008,6 +1032,8 @@ The returned data from the method `refreshToken` in the auth handler service of +--- + ## Order Events This section holds all events related to orders. @@ -1044,8 +1070,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1069,8 +1095,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - no_notification //(optional) boolean indicating whether a notification should be sent or not + id, // string ID of order + no_notification // (optional) boolean indicating whether a notification should be sent } ``` @@ -1094,8 +1120,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1119,8 +1145,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1168,7 +1194,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of order + id // string ID of order } ``` @@ -1192,8 +1218,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1217,10 +1243,10 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - payment_id, //string ID of Payment - error, //string error message - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + payment_id, // string ID of Payment + error, // string error message + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1244,9 +1270,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - fulfillment_id, //string ID of fulfillment - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + fulfillment_id, // string ID of fulfillment + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1270,9 +1296,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - fulfillment_id, //string ID of fulfillment - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + fulfillment_id, // string ID of fulfillment + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1296,9 +1322,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - fulfillment_id, //string ID of fulfillment - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + fulfillment_id, // string ID of fulfillment + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1322,9 +1348,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - return_id, //string ID of return - no_notification //(optional) boolean indicating whether a notification should be sent or not + id, // string ID of order + return_id, // string ID of return + no_notification // (optional) boolean indicating whether a notification should be sent } ``` @@ -1348,9 +1374,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - return_id, //string ID of return - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + return_id, // string ID of return + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1374,9 +1400,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - return_id, //string ID of return - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + return_id, // string ID of return + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1400,9 +1426,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of order - refund_id, //string ID of refund - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of order + refund_id, // string ID of refund + no_notification // boolean indicating whether a notification should be sent } ``` @@ -1460,6 +1486,8 @@ Object of the following format: +--- + ## Order Edit Events This section holds all events related to order edits. @@ -1603,7 +1631,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of order edit + id // string ID of order edit } ``` @@ -1637,6 +1665,8 @@ Object of the following format: +--- + ## Order Edit Item Changes Events This section holds all events related to order edit item changes. @@ -1682,7 +1712,7 @@ Triggered when an order edit item change is created. ```js noReport noCopy { - id //string ID of item change + id // string ID of item change } ``` @@ -1704,7 +1734,7 @@ Triggered when an order edit item change is deleted. ```js noReport noCopy { - id //string ID of item change + id // string ID of item change } ``` @@ -1714,6 +1744,8 @@ Triggered when an order edit item change is deleted. +--- + ## Payment Events This section holds all events related to payment. @@ -1859,6 +1891,8 @@ The entire payment passed as an object. You can refer to the [Payment entity](.. +--- + ## Payment Collection Events This section holds all events related to payment collections. @@ -1954,6 +1988,8 @@ The entire payment collection passed as an object. You can refer to the [Payment +--- + ## Product Events This section holds all events related to products. @@ -1991,7 +2027,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of product + id // string ID of product } ``` @@ -2017,8 +2053,8 @@ In one case, when the `/admin/products/{id}` endpoint is used to update the prod ```js noReport noCopy { - id, //id of product - fields //an array of field names that were updated + id, // id of product + fields // an array of field names that were updated } ``` @@ -2042,7 +2078,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of product + id // string ID of product } ``` @@ -2052,6 +2088,8 @@ Object of the following format: +--- + ## Product Variant Events This section holds all events related to product variants. @@ -2088,8 +2126,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of variant - product_id //string ID of product + id, // string ID of variant + product_id // string ID of product } ``` @@ -2113,9 +2151,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of variant - product_id, //string ID of product - fields //array of names of updated fields + id, // string ID of variant + product_id, // string ID of product + fields // array of names of updated fields } ``` @@ -2139,9 +2177,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of variant - product_id, //string ID of product - metadata //object of the `metadata` field of the variant + id, // string ID of variant + product_id, // string ID of product + metadata // object of the `metadata` field of the variant } ``` @@ -2151,6 +2189,8 @@ Object of the following format: +--- + ## Publishable API Key Events This section holds all events related to publishable API keys. @@ -2199,7 +2239,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of publishable API key + id // string ID of publishable API key } ``` @@ -2223,7 +2263,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of publishable API key + id // string ID of publishable API key } ``` @@ -2233,6 +2273,8 @@ Object of the following format: +--- + ## Region Events This section holds all events related to regions. @@ -2269,7 +2311,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of region + id // string ID of region } ``` @@ -2293,8 +2335,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of region - fields //array of names of updated fields + id, // string ID of region + fields // array of names of updated fields } ``` @@ -2318,7 +2360,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of region + id // string ID of region } ``` @@ -2327,6 +2369,8 @@ Object of the following format: +--- + ## Sales Channel Events This section holds all events related to sales channels. @@ -2374,7 +2418,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of sales channel + id // string ID of sales channel } ``` @@ -2422,7 +2466,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of sales channel + id // string ID of sales channel } ``` @@ -2431,6 +2475,8 @@ Object of the following format: +--- + ## Swap Events This section holds all events related to swaps. @@ -2467,8 +2513,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of swap - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of swap + no_notification // boolean indicating whether a notification should be sent } ``` @@ -2492,9 +2538,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of swap - order_id, //string ID of order - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of swap + order_id, // string ID of order + no_notification // boolean indicating whether a notification should be sent } ``` @@ -2518,9 +2564,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of swap - fulfillment_id, //string ID of fulfillment - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of swap + fulfillment_id, // string ID of fulfillment + no_notification // boolean indicating whether a notification should be sent } ``` @@ -2544,9 +2590,9 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of swap - fulfillment_id, //string ID of fulfillment - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of swap + fulfillment_id, // string ID of fulfillment + no_notification // boolean indicating whether a notification should be sent } ``` @@ -2570,8 +2616,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of swap - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of swap + no_notification // boolean indicating whether a notification should be sent } ``` @@ -2595,8 +2641,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of swap - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of swap + no_notification // boolean indicating whether a notification should be sent } ``` @@ -2620,8 +2666,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of swap - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of swap + no_notification // boolean indicating whether a notification should be sent } ``` @@ -2645,8 +2691,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of swap - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of swap + no_notification // boolean indicating whether a notification should be sent } ``` @@ -2670,8 +2716,8 @@ Object of the following format: ```js noReport noCopy { - id, //string ID of swap - no_notification //boolean indicating whether a notification should be sent or not + id, // string ID of swap + no_notification // boolean indicating whether a notification should be sent } ``` @@ -2681,6 +2727,8 @@ Object of the following format: +--- + ## Token Events This section holds all events related to tokens. @@ -2730,6 +2778,8 @@ Object of the following format: +--- + ## User Events This section holds all events related to users. @@ -2766,7 +2816,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of user + id // string ID of user } ``` @@ -2790,7 +2840,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of user + id // string ID of user } ``` @@ -2814,8 +2864,8 @@ Object of the following format: ```js noReport noCopy { - email, //string email of user requesting to reset their password - token //token create to reset the password + email, // string email of user requesting to reset their password + token // token create to reset the password } ``` @@ -2839,7 +2889,7 @@ Object of the following format: ```js noReport noCopy { - id //string ID of user + id // string ID of user } ``` @@ -2848,7 +2898,9 @@ Object of the following format: -## What’s Next +--- -- Learn how you can [use services in subscribers](create-subscriber.md#using-services-in-subscribers). -- Learn how to [create notifications](../notification/overview.md) in Medusa. +## See Also + +- [Use services in subscribers](create-subscriber.md#using-services-in-subscribers) +- [Create a notification provider](../notification/overview.md) diff --git a/docs/content/advanced/backend/subscribers/overview.md b/docs/content/advanced/backend/subscribers/overview.md index 2fd87d677f..ea8f46aa6d 100644 --- a/docs/content/advanced/backend/subscribers/overview.md +++ b/docs/content/advanced/backend/subscribers/overview.md @@ -10,6 +10,8 @@ The purpose of these events is to allow other parts of the platform, or third-pa Medusa's queuing and events system is handled by Redis. So, you must have [Redis configured](../../../tutorial/0-set-up-your-development-environment.mdx#redis) on your server to use subscribers. +--- + ## What are Subscribers Subscribers register handlers for an events and allows you to perform an action when that event occurs. For example, if you want to send your customer an email when they place an order, then you can listen to the `order.placed` event and send the email when the event is emitted. @@ -20,7 +22,9 @@ Custom subscribers are TypeScript or JavaScript files in your project's `src/sub Whenever an event is emitted, the subscriber’s registered handler method is executed. The handler method receives as a parameter an object that holds data related to the event. For example, if an order is placed the `order.placed` event will be emitted and all the handlers will receive the order id in the parameter object. -## What's Next +--- -- Learn [how to create a Subscriber](create-subscriber.md). -- [View the list of all events](events-list.md). +## See Also + +- [Create a Subscriber](create-subscriber.md). +- [Events reference](events-list.md). diff --git a/docs/content/advanced/backend/taxes/inclusive-pricing.md b/docs/content/advanced/backend/taxes/inclusive-pricing.md index 73e55952cd..a106fea87b 100644 --- a/docs/content/advanced/backend/taxes/inclusive-pricing.md +++ b/docs/content/advanced/backend/taxes/inclusive-pricing.md @@ -21,6 +21,8 @@ This can be useful when some countries have the same currency but have different Then, Medusa handles calculating the tax amount using the tax rate and the tax-inclusive price. This is managed in the backend and relayed to accounting and analytics tools. +--- + ## How is Tax Inclusivity Defined Tax inclusivity can be toggled for regions, currencies, price lists, and shipping options either during creation or while editing. This is represented by the boolean attribute `includes_tax` available in the entities `Region`, `Currency`, `PriceList`, and `ShippingOption`. By default, this attribute is set to `false`. @@ -54,6 +56,8 @@ When a shipping option is selected, a shipping method is created based on that s The `ShippingMethod` entity also has the `includes_tax` attribute. Its value is the same as the value of `includes_tax` of the shipping option the method is associated with. +--- + ## Tax Amount Calculation Formula When a price is tax-inclusive, the tax amount is calculated using the following formula: @@ -66,6 +70,8 @@ Where `taxRate` is the tax rate to be applied to the price, and `taxInclusivePri For example, if the tax rate is `0.25` and the price of a product is `100`, the resulting tax amount calculated by Medusa will be `0.25 * 100 / 1.25 = 20`. +--- + ## Retrieving Tax Amounts This section covers at which point tax amounts are calculated for different entities, how they are calculated when the price is tax inclusive, and what fields can be returned in the endpoints relative to each of the entities. @@ -120,7 +126,9 @@ Where `amount` is the amount of the variant’s price in the price list, `taxRat Here is an example of these fields when tax inclusivity is enabled for both the currency and the price list: -```jsx noReport + + +```js noReport { original_price: 110, calculated_price: 100, @@ -187,7 +195,9 @@ The relevant fields are: During the calculation of the totals of different components of the cart or order, such as shipping or line items, if tax inclusivity is enabled on that component, a process similar to those explained above will be applied to retrieve the total. -## What’s Next +--- -- Learn how to [calculate taxes manually](manual-calculation.md). -- [Check out the API reference](https://docs.medusajs.com/api/store/). +## See Also + +- [Calculate taxes manually](manual-calculation.md) +- [Storefront API reference](/api/store) diff --git a/docs/content/advanced/backend/taxes/manual-calculation.md b/docs/content/advanced/backend/taxes/manual-calculation.md index c3bbedeb85..a73d5e6712 100644 --- a/docs/content/advanced/backend/taxes/manual-calculation.md +++ b/docs/content/advanced/backend/taxes/manual-calculation.md @@ -8,6 +8,8 @@ By default, taxes are automatically calculated by Medusa during checkout. This b If you disable this behavior, you must manually trigger taxes calculation. When taxes are calculated, this means that requests will be sent to the tax provider to retrieve the tax rates. +--- + ## How to Manually Calculate Taxes in Checkout This section explores different ways you can calculate taxes based on your purpose. @@ -27,7 +29,7 @@ You can, however, force calculating the taxes of the cart by passing in the thir For example: ```jsx -cartService.retrieve('cart_01G8Z...', { }, { force_taxes: true }); +cartService.retrieve("cart_01G8Z...", { }, { force_taxes: true }) ``` :::tip @@ -43,20 +45,20 @@ Another way you can use the `CartService` to calculate taxes is using the method ```jsx export default () => { - //... + // ... router.get("/store/line-taxes", async (req, res) => { - //example of retrieving cart - const cartService = req.scope.resolve("cartService"); + // example of retrieving cart + const cartService = req.scope.resolve("cartService") const cart = await cartService.retrieve(cart_id) - //... - //retrieve taxes of line items + // ... + // retrieve taxes of line items const data = await decorateTotals(cart, { - force_taxes: true + force_taxes: true, }) - return res.status(200).json({ cart: data }); + return res.status(200).json({ cart: data }) }) } ``` @@ -70,7 +72,7 @@ You can calculate and retrieve taxes of line items using the `getLineItemTotals` ```jsx const itemTotals = await totalsService .getLineItemTotals(item, cart, { - include_tax: true + include_tax: true, }) ``` @@ -80,7 +82,9 @@ You can learn how to [retrieve and use services](../services/create-service.md#u ::: -## What’s Next +--- -- Learn about [tax-inclusive pricing](inclusive-pricing.md). -- Learn about available methods in [CartsService](../../../references/services/classes/CartService.md) and [TotalsService](../../../references/services/classes/TotalsService.md). +## See Also + +- [Tax-Inclusive Pricing Overview](inclusive-pricing.md) +- [CartsService](../../../references/services/classes/CartService.md) and [TotalsService](../../../references/services/classes/TotalsService.md) diff --git a/docs/content/advanced/backend/upgrade-guides/1-3-0.md b/docs/content/advanced/backend/upgrade-guides/1-3-0.md index a4710f6264..62768e48e8 100644 --- a/docs/content/advanced/backend/upgrade-guides/1-3-0.md +++ b/docs/content/advanced/backend/upgrade-guides/1-3-0.md @@ -20,6 +20,8 @@ TYPEORM_MIGRATIONS=./node_modules/@medusajs/medusa/dist/migrations/*.js These environment variables are used in the data migration scripts in this upgrade. Make sure to replace `` with your PostgreSQL database URL. +--- + ## Environment Variables In previous versions of Medusa, The server automatically loads all environment variables in the `.env` file at the root of the Medusa server. @@ -33,31 +35,34 @@ If you use a `.env` file to load environment variables on your server, you need You can add the following code snippet at the top of the file which uses the [dotenv](https://www.npmjs.com/package/dotenv) package to load the environment variables based on the current Node environment: ```jsx -const dotenv = require('dotenv') +const dotenv = require("dotenv") - let ENV_FILE_NAME = ''; + let ENV_FILE_NAME = "" switch (process.env.NODE_ENV) { - case 'production': - ENV_FILE_NAME = '.env.production'; - break; - case 'staging': - ENV_FILE_NAME = '.env.staging'; - break; - case 'test': - ENV_FILE_NAME = '.env.test'; - break; - case 'development': + case "production": + ENV_FILE_NAME = ".env.production" + break + case "staging": + ENV_FILE_NAME = ".env.staging" + break + case "test": + ENV_FILE_NAME = ".env.test" + break + case "development": default: - ENV_FILE_NAME = '.env'; - break; + ENV_FILE_NAME = ".env" + break } try { - dotenv.config({ path: process.cwd() + '/' + ENV_FILE_NAME }); + dotenv.config({ path: process.cwd() + "/" + ENV_FILE_NAME }) } catch (e) { + // handle error } ``` +--- + ## Line Item Adjustments This new version of Medusa allows store operators to adjust line items in an order or a swap which provides more customization capabilities. @@ -76,6 +81,8 @@ For that reason, it’s essential to run the data migration script after upgradi node ./node_modules/@medusajs/medusa/dist/scripts/line-item-adjustment-migration.js ``` +--- + ## Advanced Discount Conditions This new version of Medusa holds advanced promotions functionalities to provide store operators with even more customization capabilities when creating discounts. You can now add even more conditions to your discounts to make them specific for a set of products, collections, customer groups, and more. diff --git a/docs/content/advanced/backend/upgrade-guides/1-3-6.md b/docs/content/advanced/backend/upgrade-guides/1-3-6.md index c0a2bd0def..7f021aef8a 100644 --- a/docs/content/advanced/backend/upgrade-guides/1-3-6.md +++ b/docs/content/advanced/backend/upgrade-guides/1-3-6.md @@ -26,6 +26,8 @@ TYPEORM_MIGRATIONS=./node_modules/@medusajs/medusa/dist/migrations/*.js These environment variables are used in the data migration scripts in this upgrade. Make sure to replace `` with your PostgreSQL database URL. +--- + ## Sales Channels Sales Channels were introduced in v1.3.5 guarded by a [feature flag](../feature-flags/toggle.md). By enabling Sales Channels, developers and users can associate products and other entities with a specific Sales Channel. diff --git a/docs/content/advanced/backend/upgrade-guides/1-3-8.md b/docs/content/advanced/backend/upgrade-guides/1-3-8.md index 95a151edfe..15fd523957 100644 --- a/docs/content/advanced/backend/upgrade-guides/1-3-8.md +++ b/docs/content/advanced/backend/upgrade-guides/1-3-8.md @@ -10,6 +10,8 @@ Updating your medusa server to version `1.3.8` may cause issues when using NPM. It's highly recommended to use [yarn](https://yarnpkg.com/) when working with Medusa. Updating with yarn should resolve any issues you might run into during the update. +--- + ## Resolving Update Issues with NPM ### Update All Medusa Dependencies diff --git a/docs/content/advanced/backend/upgrade-guides/1-6-1.md b/docs/content/advanced/backend/upgrade-guides/1-6-1.md index 77b23ece1c..8c6d2a7365 100644 --- a/docs/content/advanced/backend/upgrade-guides/1-6-1.md +++ b/docs/content/advanced/backend/upgrade-guides/1-6-1.md @@ -12,6 +12,8 @@ As the new version `1.6.1` make changes to the database schema, it is required t Without running the migrations, you might have trouble accessing and using the Medusa admin. +--- + ## Actions Required After updating your server, run migrations with the following command: diff --git a/docs/content/advanced/backend/upgrade-guides/1-7-0.md b/docs/content/advanced/backend/upgrade-guides/1-7-0.md index a5eebd7e95..d6ef8caa9d 100644 --- a/docs/content/advanced/backend/upgrade-guides/1-7-0.md +++ b/docs/content/advanced/backend/upgrade-guides/1-7-0.md @@ -12,6 +12,8 @@ In this new version, the method [`retrieveByEmail` in the Customer Service](../. In addition, after introducing the Claim Order feature, this version of Medusa introduces changes in the database that allows two customers having the same email based on the value of the `has_account` field. This change requires running migrations after the update. +--- + ## Actions Required ### Run Migrations @@ -29,19 +31,19 @@ Instead of using `customerService.retrieveByEmail`, you should now use the metho The `customerService.retrieveRegisteredByEmail` method allows you to retrieve a registered customer by email: ```ts -customerService.retrieveRegisteredByEmail("example@gmail.com"); +customerService.retrieveRegisteredByEmail("example@gmail.com") ``` On the other hand, the `retrieveUnregisteredByEmail` method allows to retrieve guest customers by email: ```jsx -customerService.retrieveUnregisteredByEmail("example@gmail.com"); +customerService.retrieveUnregisteredByEmail("example@gmail.com") ``` To retrieve a customer by email regardless of whether they are registered or not, you can use the `customerService.list` method instead: ```ts customerService.list({ - email: "example@gmail.com" + email: "example@gmail.com", }) ``` diff --git a/docs/content/advanced/backend/upgrade-guides/1-7-1.md b/docs/content/advanced/backend/upgrade-guides/1-7-1.md new file mode 100644 index 0000000000..1a1f2d617c --- /dev/null +++ b/docs/content/advanced/backend/upgrade-guides/1-7-1.md @@ -0,0 +1,128 @@ +--- +description: 'Actions Required for v.1.7.1' +--- + +# v1.7.1 + +Version `1.7.1` of Medusa introduces the `JobSchedulerService` which changes how scheduled/cron jobs are created. + +## Overview + +Version `1.7.1` of Medusa introduces a new service `JobSchedulerService` that handles all logic and functionality related to created scheduled (previously named cron jobs). + +With this introduction, the previous use of `EventBus` to create a cron job has been deprecated of using the `JobSchedulerService`. + +In addition, this version features some fixes to gift cards that requires running migrations, and changes to how payment providers are implemented. + +--- + +## Actions Required + +### Run Migrations + +In the directory of your Medusa server, run the following command after updating the server: + +```bash +medusa migrations run +``` + +### Run Migration Script + +Following the fix gift cards calculation, you also need to run a migration script after updating the server. + +Start by adding the following environment variables in `.env`: + +```bash +TYPEORM_CONNECTION=postgres +TYPEORM_URL= +TYPEORM_USERNAME= +TYPEORM_PASSWORD= +TYPEORM_DATABASE= +TYPEORM_ENTITIES=./node_modules/@medusajs/medusa/dist/models/*.js +TYPEORM_MIGRATIONS=./node_modules/@medusajs/medusa/dist/migrations/*.js +``` + +Make sure to replace ``, ``, ``, and `` with your database connection details. + +Then, run the following command in the root directory of your Medusa server: + +```bash +node ./node_modules/@medusajs/medusa/dist/scripts/gift-card-tax-rate-migration.js +``` + +### Change to JobSchedulerService + +In your loader file that creates a cron job, replace the use of `eventBus` to `jobSchedulerService`: + +```ts +const myJob = async (container, options) => { + const jobSchedulerService = container.resolve("jobSchedulerService") + jobSchedulerService.create("my-job", {}, "0 0 * * *", async () => { + // ... + }) +} + +export default myJob +``` + +You can learn more in the [How to Create a Scheduled Job](../scheduled-jobs/create.md) documentation. + +### Change to Payment Provider + +This version of Medusa introduces a change in how payment providers are implemented. Mainly, the signature of the `createPayment` and `updatePayment` methods have changed, and the old signature is now deprecated. + +Although this change is currently backwards compatible, it is recommended to change the signature of these methods to the following: + + + +```ts +import { PaymentContext, PaymentSessionResponse } from "@medusajs/medusa" +// ... + +class MyPaymentService extends AbstractPaymentService { + // ... + async createPayment( + context: PaymentContext + ): Promise { + // ... + } + + async updatePayment( + paymentSessionData: PaymentSessionData, + context: PaymentContext + ): Promise { + // ... + } +} +``` + +Where `context` in both `createPayment` and `updatePayment` is made up of the following properties: + +```ts +type PaymentContext = { + cart: { + context: Record + id: string + email: string + shipping_address: Address | null + shipping_methods: ShippingMethod[] + } + currency_code: string + amount: number + resource_id?: string + customer?: Customer +} +``` + +So, you can pass the previous `cart` parameter inside the new `context` paramter. + +Furthermore, these methods are now expected to return `PaymentSessionResponse`. It is made up of the following properties: + +```ts +type PaymentSessionResponse = { + update_requests: { customer_metadata: Record } + session_data: Record +} +``` + +Where `session_data` would include the previously returned data from these methods. The property `update_requests` allows you to pass data from the payment provider plugin to the core to update internal resources. Currently, it can only be used to update the `metadata` field of the customer entity. diff --git a/docs/content/advanced/backend/upgrade-guides/admin/admin-vite.md b/docs/content/advanced/backend/upgrade-guides/admin/admin-vite.md index ffe9ddc266..07b20e27f0 100644 --- a/docs/content/advanced/backend/upgrade-guides/admin/admin-vite.md +++ b/docs/content/advanced/backend/upgrade-guides/admin/admin-vite.md @@ -12,6 +12,8 @@ Medusa Admin previously was built using Gatsby. As of a recent update, the Admin This introduced breaking changes related to environment variables used and the published directory. Read below for actions required following this update. +--- + ## Required Node.js Version @@ -20,6 +22,8 @@ Following the change to Vite 3, the required Node.js version for the Admin has c +--- + ## Changed Environment Variables Previously, the Medusa Admin used the environment variables `GATSBY_MEDUSA_BACKEND_URL` or `GATSBY_STORE_URL` to store the Medusa server’s URL. @@ -36,6 +40,8 @@ Change your `GATSBY_MEDUSA_BACKEND_URL` or `GATSBY_STORE_URL` environment variab MEDUSA_BACKEND_URL= ``` +--- + ## Changed Publish Directory Previously, the build output of the Medusa Admin was placed in the `dist` directory. After this update, the build output is placed in the `public` directory. diff --git a/docs/content/advanced/ecommerce/handle-order-claim-event.md b/docs/content/advanced/ecommerce/handle-order-claim-event.md index 5b5d08a750..2b394871ba 100644 --- a/docs/content/advanced/ecommerce/handle-order-claim-event.md +++ b/docs/content/advanced/ecommerce/handle-order-claim-event.md @@ -14,11 +14,13 @@ When the customer requests to claim the order, the event `order-update-token.cre In this document, you’ll learn how to handle the `order-update-token.created` event on the server to send the customer a confirmation email. +--- + ## Prerequisites ### Medusa Components -It's assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.md) to get started. +It's assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.mdx) to get started. ### Redis @@ -30,6 +32,8 @@ To send an email or another type of notification method, you must have a notific This document has an example using the [SendGrid](../../add-plugins/sendgrid.mdx) plugin. +--- + ## Step 1: Create a Subscriber To subscribe to and handle an event, you must create a subscriber. @@ -43,7 +47,7 @@ You can learn more about subscribers in the [Subscribers](../backend/subscribers Create the file `src/subscribers/claim-order.ts` with the following content: ```ts title=src/subscribers/claim-order.ts -import { EventBusService } from "@medusajs/medusa"; +import { EventBusService } from "@medusajs/medusa" type InjectedDependencies = { eventBusService: EventBusService, @@ -55,7 +59,7 @@ class ClaimOrderSubscriber { } } -export default ClaimOrderSubscriber; +export default ClaimOrderSubscriber ``` If you want to add any other dependencies, you can add them to the `InjectedDependencies` type. @@ -66,13 +70,21 @@ You can learn more about dependency injection in [this documentation](../backend ::: +--- + ## Step 2: Subscribe to the Event In the subscriber you created, add the following in the `constructor`: ```ts title=src/subscribers/claim-order.ts -constructor({ eventBusService }: InjectedDependencies) { - eventBusService.subscribe("order-update-token.created", this.handleRequestClaimOrder); +class ClaimOrderSubscriber { + constructor({ eventBusService }: InjectedDependencies) { + eventBusService.subscribe( + "order-update-token.created", + this.handleRequestClaimOrder + ) + } + // ... } ``` @@ -84,14 +96,14 @@ In the subscriber, add a new method `handleRequestClaimOrder`: ```ts title=src/subscribers/claim-order.ts class ClaimOrderSubscriber { - //... + // ... - handleRequestClaimOrder = async (data) { - //TODO: handle event + handleRequestClaimOrder = async (data) => { + // TODO: handle event } } -export default ClaimOrderSubscriber; +export default ClaimOrderSubscriber ``` The `handleRequestClaimOrder` event receives a `data` object as a parameter. This object holds the following properties: @@ -105,12 +117,14 @@ In this method, you should typically send an email to the customer’s old email The page would then send a request to the server to verify that the `token` is valid and associate the order with the customer. You can read more about how to implement this in your storefront in [this documentation](../storefront/implement-claim-order.mdx). +--- + ## Example: Using SendGrid For example, you can implement this subscriber to send emails using SendGrid: ```ts title=src/subscribers/claim-order.ts -import { EventBusService } from "@medusajs/medusa"; +import { EventBusService } from "@medusajs/medusa" type InjectedDependencies = { eventBusService: EventBusService, @@ -118,32 +132,37 @@ type InjectedDependencies = { } class ClaimOrderSubscriber { - protected sendGridService: any; + protected sendGridService: any constructor({ eventBusService, sendgridService }: InjectedDependencies) { - this.sendGridService = sendgridService; - eventBusService.subscribe("order-update-token.created", this.handleRequestClaimOrder); + this.sendGridService = sendgridService + eventBusService.subscribe( + "order-update-token.created", + this.handleRequestClaimOrder + ) } handleRequestClaimOrder = async (data) => { this.sendGridService.sendEmail({ - templateId: 'order-claim-confirmation', - from: 'hello@medusajs.com', + templateId: "order-claim-confirmation", + from: "hello@medusajs.com", to: data.old_email, data: { - link: `http://example-storefront.com/confirm-order-claim/${data.token}`, - //other data... - } + link: `http://example.com/confirm-order-claim/${data.token}`, + // other data... + }, }) } } -export default ClaimOrderSubscriber; +export default ClaimOrderSubscriber ``` Notice how the `token` is passed to the storefront link as a parameter. +--- + ## See Also -- Learn [how to implement claim-order flow in your storefront](../storefront/implement-claim-order.mdx). \ No newline at end of file +- [Implement claim-order flow in your storefront](../storefront/implement-claim-order.mdx) diff --git a/docs/content/advanced/storefront/customer-profiles.mdx b/docs/content/advanced/storefront/customer-profiles.mdx new file mode 100644 index 0000000000..d950a13b8d --- /dev/null +++ b/docs/content/advanced/storefront/customer-profiles.mdx @@ -0,0 +1,550 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# How to Implement Customer Profiles + +In this document, you’ll learn how to implement customer account functionalities in a storefront. + +## Overview + +Medusa provides the necessary functionalities and endpoints to allow integrating essential customer features. Customers can create accounts to manage their information and keep track of their orders. + +### Scenario + +You want to implement the following features in a storefront: + +- Customer registration +- Customer login and logout +- Allow customers to reset their password +- Allow customers to manage their basic information and shipping addresses +- Show customers their orders + +:::note + +You can use Medusa’s Store APIs to achieve more functionalities as well. Check out the [API reference](/api/store/#tag/Customer) to learn more. + +::: + +--- + +## Prerequisites + +### Medusa Components + +It's assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.mdx) to get started. + +It's also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.mdx) or [Gatsby](../../starters/gatsby-medusa-starter.mdx) storefronts. + +### JS Client + +This guide includes code snippets to send requests to your Medusa server using Medusa’s JS Client and JavaScript’s Fetch API. + +If you follow the JS Client code blocks, it’s assumed you already have [Medusa’s JS Client installed](../../js-client/overview.md) and have [created an instance of the client](../../js-client/overview.md#configuration). + +--- + +## Register a Customer + +A customer can register with an email and a password to store and manage their data. + +You can register a new customer by sending a request to the [Create a Customer](/api/store/#tag/Customer/operation/PostCustomers) endpoint: + + + + +```ts +medusa.customers.create({ + email, + password, + first_name, + last_name, +}) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```ts +fetch(`/store/customers`, { + method: "POST", + credentials: "include", + body: JSON.stringify({ + email, + password, + first_name, + last_name, + }), +}) +.then((response) => response.json()) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +This request requires the following body parameters: + +- `email`: An email used to log in after registration. This email must be unique. You can check if an email is unique using the “[Check if email exists](/api/store/#tag/Auth/operation/GetAuthEmail)” endpoint. +- `password`: A password used to log in after registration. +- `first_name`: The customer’s first name. +- `last_name`: The customer’s last name. + +This request also accepts optional body parameters, which you can check out in the [API reference](/api/store/#tag/Customer/operation/PostCustomers). + +It returns the created customer object in the response. + +--- + +## Log in a Customer + +A customer can log in to your store to manage their data and make purchases using their account. + +You can log in a customer into your store by sending a request to the [Customer Login](/api/store/#tag/Auth/operation/PostAuth) endpoint: + + + + +```ts +medusa.auth.authenticate({ + email, + password, +}) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```ts +fetch(`/store/auth`, { + method: "POST", + credentials: "include", + body: JSON.stringify({ + email, + password, + }), +}) +.then((response) => response.json()) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +This request requires the body parameters `email` and `password`. It returns the customer object in the response. + +If you’re using the Medusa JS Client, the customer’s session will already be set and used in all future requests. + +However, if you’re using the Fetch API, you must include the option `credentials` with the value `include` to make sure all future requests are authenticated. + +--- + +## Log out a Customer + +You can log out a customer by sending a request to the [Customer Logout](/api/store/#tag/Auth/operation/DeleteAuth) endpoint: + + + + +```ts +medusa.auth.deleteSession() +.then(() => { + // success +}) +``` + + + + +```ts +fetch(`/store/auth`, { + method: "DELETE", + credentials: "include", +}) +.then(() => { + // success +}) +``` + + + + +If this request is successful, the customer’s session will be deleted and they’ll be logged out. + +--- + +## Reset Password + +Customers might need to reset their password in case they forget it. To reset a customer’s password, you need to implement two steps. + +### Step 1: Request Password Reset + +The customer must first enter their account’s email. Then, if an account with that email address exists, an email will be sent to that email address with a link that points the customer to step 2. + +You can request to reset a customer’s password by sending a request to the [Request Password Reset](/api/store/#tag/Customer/operation/PostCustomersCustomerPasswordToken) endpoint: + + + + +```ts +medusa.customers.generatePasswordToken({ + email, +}) +.then(() => { + // successful +}) +.catch(() => { + // failed +}) +``` + + + + +```ts +fetch(`/store/customers/password-token`, { + method: "POST", + credentials: "include", + body: JSON.stringify({ + email, + }), +}) +.then(() => { + // successful +}) +.catch(() => { + // failed +}) +``` + + + + +This request requires the body parameter `email`. Its value must be the email associated with the customer’s account. + +If the request has been processed successfully, it returns a `204` status code in the response. In case it fails, an error will be thrown. + +:::note + +If the customer doesn’t receive an email after this request, make sure that you’ve set up a Notification provider like [SendGrid](../../add-plugins/sendgrid.mdx) successfully. You also need to add a subscriber that handles the [customer.password_reset](../backend/subscribers/events-list.md#customer-events) event and sends the email. + +::: + +### Step 2: Verify and Reset Password + +After the first step, the customer should receive an email with a link to a page in the storefront. This page should accept a `token` query parameter. Then, the customer should be prompted to enter their email and password. + +You can then reset the customer’s password to the new password they enter by sending a request to the [Reset Password](/api/store/#tag/Customer/operation/PostCustomersResetPassword) endpoint: + + + + +```ts +medusa.customers.resetPassword({ + email, + password, + token, +}) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```ts +fetch(`/store/customers/password-reset`, { + method: "POST", + credentials: "include", + body: JSON.stringify({ + email, + password, + token, + }), +}) +.then((response) => response.json()) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +This request requires the following body parameters: + +- `email`: The email of the customer. This must be the email associated with the account. +- `password`: The new password the customer wants to use for their account. +- `token`: The token passed as a query into the page. + +If successful, this request returns the customer object in the response. + +--- + +## Edit a Customer’s Info + +A logged-in customer can edit their info, such as their first name or email address. + +You can edit a customer’s info using the [Update Customer](/api/store/#tag/Customer/operation/PostCustomersCustomer) endpoint: + + + + +```ts +medusa.customers.update({ + first_name, +}) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```ts +fetch(`/store/customers/me`, { + method: "POST", + credentials: "include", + body: JSON.stringify({ + first_name, + }), +}) +.then((response) => response.json()) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +This request accepts any of the customer’s details that should be updated as body parameters. In the example above, the `first_name` of the customer is updated. You can check out the [API reference](/api/store/#tag/Customer/operation/PostCustomersCustomer) for a full list of accepted body parameters. + +It returns in the response the updated customer object. + +--- + +## Manage Shipping Addresses + +A logged-in customer uses their shipping addresses during the checkout process. They can have more than one shipping address, and they can choose one of them when placing an order. + +:::tip + +The customer object returned in the requests mentioned in this document include a `shipping_addresses` property. It’s an array of the customer’s shipping addresses. You can access it to display the customer’s shipping addresses. + +::: + +### Add a Shipping Address + +You can add a shipping address to a customer’s account by sending a request to the [Add a Shipping Address](/api/store/#tag/Customer/operation/PostCustomersCustomerAddresses) endpoint: + + + + +```ts +medusa.customers.addresses.addAddress({ + address: { + first_name, + last_name, + address_1, + city, + country_code, + postal_code, + phone, + company, + address_2, + province, + metadata, + }, +}) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```ts +fetch(`/store/customers/me/addresses`, { + method: "POST", + credentials: "include", + body: JSON.stringify({ + address: { + first_name, + last_name, + address_1, + city, + country_code, + postal_code, + phone, + company, + address_2, + province, + metadata, + }, + }), +}) +.then((response) => response.json()) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +This request requires an `address` object as a body parameter. The `address` object must have the following properties: + +- `first_name`: The first name associated with the shipping address +- `last_name`: The last name associated with the shipping address +- `address_1`: The first address line of the shipping address. +- `city`: The city of the shipping address. +- `country_code`: The 2 character ISO code of the country in lower case. +- `postal_code`: The postal code of the shipping address + +It also accepts other optional body parameters, which you can learn more about in the [API reference](/api/store/#tag/Customer/operation/PostCustomersCustomerAddresses). + +This request returns the updated customer object in the response. + +### Edit a Shipping Address + +You can edit a customer’s shipping address using the [Update a Shipping Address](/api/store/#tag/Customer/operation/PostCustomersCustomerAddressesAddress) endpoint: + + + + +```ts +medusa.customers.addresses.updateAddress(addressId, { + first_name, +}) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```ts +fetch(`/store/customers/me/addresses/${addressId}`, { + method: "POST", + credentials: "include", + body: JSON.stringify({ + first_name, + }), +}) +.then((response) => response.json()) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +This request requires the address’s ID as a path parameter. It accepts as a body parameter any of the address’s properties. In the example above, the `first_name` of the shipping address is updated. You can check the [API reference](/api/store/#tag/Customer/operation/PostCustomersCustomerAddressesAddress) for all the available body parameters. + +This request returns the updated customer object in the response. + +### Delete a Shipping Address + +You can delete a shipping address by sending a request to the [Delete an Address](/api/store/#tag/Customer/operation/DeleteCustomersCustomerAddressesAddress) endpoint: + + + + +```ts +medusa.customers.addresses.deleteAddress(addressId) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +```ts +fetch(`/store/customers/me/addresses/${addressId}`, { + method: "DELETE", + credentials: "include", +}) +.then((response) => response.json()) +.then(({ customer }) => { + console.log(customer.id) +}) +``` + + + + +This request requires the address’s ID as a path parameter. It returns in the response the updated customer object. + +--- + +## Retrieve a Customer’s Orders + +Logged-in customers can see their orders along with the orders’ details. + +You can retrieve a customer’s orders by sending a request to the [List Orders](/api/store/#tag/Customer/operation/GetCustomersCustomerOrders) endpoint: + + + + +```ts +medusa.customers.listOrders() +.then(({ orders, limit, offset, count }) => { + console.log(orders) +}) +``` + + + + +```ts +fetch(`/store/customers/me/orders`, { + credentials: "include", +}) +.then((response) => response.json()) +.then(({ orders, limit, offset, count }) => { + console.log(orders) +}) +``` + + + + +This request doesn’t require any path or query parameters. You can, however, send optional query parameters used for filters, pagination, and sorting. You can learn more in the [API reference](/api/store/#tag/Customer/operation/GetCustomersCustomerOrders). + +It returns the following data in the response: + +- `orders`: An array of orders. +- `limit`: The maximum number of orders that can be returned in the request. +- `offset`: The number of orders skipped in the result. +- `count`: The total number of orders available. + +:::info + +You can learn more about pagination in the [API reference](/api/store/#section/Pagination). + +::: + +--- + +## See Also + +- [Implement order-claim flow](./implement-claim-order.mdx) +- [Customers Store API reference](/api/store) +- [Customers overview](../backend/customers/index.md) +- [Manage customers using the admin APIs](../admin/manage-customers.mdx) diff --git a/docs/content/advanced/storefront/handle-order-edits.mdx b/docs/content/advanced/storefront/handle-order-edits.mdx new file mode 100644 index 0000000000..91ddeb5cda --- /dev/null +++ b/docs/content/advanced/storefront/handle-order-edits.mdx @@ -0,0 +1,358 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# How to Handle an Order Edit + +In this document, you’ll learn how to allow a customer to confirm or decline an Order Edit. + +:::note + +The Order Editing feature is currently in beta mode and guarded by a feature flag. To use Order Editing either: + +1. Enable the `MEDUSA_FF_ORDER_EDITING` environment variable; +2. Or enable the `order_editing` key in the Medusa server's settings. + +You can learn more about enabling it in the [feature flags](../backend/feature-flags/toggle.md) documentation. + +::: + +--- + +## Overview + +A merchant can request to edit an order to make changes to its items. The change can include removing an item, adding a new item, and changing the quantity of an item in the original order. + +When the Order Edit is in the “request” state, it requires either a confirmation from the customer, or it can be force-confirmed by the merchant. + +This guide focuses on how to use the Storefront APIs to implement the flow that allows a customer to either confirm or decline an Order Edit. + +:::note + +You can check out how to implement order editing using the Admin APIs in [this documentation](../admin/order-edit.mdx). + +::: + +### Scenarios + +You want to implement the following functionalities in your storefront: + +- List and show customers order-edit requests. +- Confirm order edits and authorize any additional payment if necessary. +- Decline order edits. + +:::note + +You can perform other functionalities related to order editing. To learn more, check out the API reference. + +::: + +--- + +## Prerequisites + +### Medusa Components + +It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.mdx) to get started. + +It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.mdx) or [Gatsby](../../starters/gatsby-medusa-starter.mdx) storefronts. + +### JS Client + +This guide includes code snippets to send requests to your Medusa server using Medusa’s JS Client and JavaScript’s Fetch API. + +If you follow the JS Client code blocks, it’s assumed you already have [Medusa’s JS Client installed](../../js-client/overview.md) and have [created an instance of the client](../../js-client/overview.md#configuration). + +### Previous Steps + +You must have an existing order edit in the “request” state. + +--- + +## Retrieve an Order Edit + +You can retrieve a single order edit by its ID by sending a request to the [Get Order Edit](/api/store/#tag/OrderEdit/operation/GetOrderEditsOrderEdit) endpoint: + + + + +```ts +medusa.orderEdits.retrieve(orderEditId) +.then(({ order_edit }) => { + console.log(order_edit.changes) + // show changed items to the customer +}) +``` + + + + +```ts +fetch(`/store/order-edits/${orderEditId}`) +.then((response) => response.json()) +.then(({ order_edit }) => { + console.log(order_edit.changes) + // show changed items to the customer +}) +``` + + + + +The request requires the order edit’s ID as a path parameter. + +It returns the Order Edit as an object. Some of its important fields are: + +- `order_id`: The ID of the order that this Order Edit belongs to. +- `difference_due`: The amount to either be refunded or paid. If the amount is greater than 0, then the customer is required to pay an additional amount. If the amount is less than 0, then the merchant has to refund the difference to the customer. +- `payment_collection_id`: The ID of the payment collection. This will be used to authorize additional payment if necessary. + +:::note + +You can learn more about what fields to expect in the [API reference](/api/store/#tag/OrderEdit/operation/GetOrderEditsOrderEdit). + +::: + +### Show Changed Items + +All data about changes to the original order’s items can be found in `order_edit.changes`. `changes` is an array of item changes. Each item change includes the following fields: + + + +```ts +{ + type: string, + line_item: LineItem | null, + original_line_item: LineItem | null +} +``` + +`type` can be either: + +- `item_add`: In this case, a new item is being added. `line_item` will be an item object and `original_line_item` will be `null`. +- `item_update`: In this case, an item’s quantity in the original order is updated. `line_item` will be the updated item, and `original_line_item` will be the item in the original order. You can either just use `line_item` to show the new quantity, or show the customer a comparison between the old and new quantity using `original_line_item` as well. +- `item_remove`: In this case, an item in the original order is removed. The `original_line_item` will be the item in the original order, and `line_item` will be `null`. + +Here’s an example of how you can use this data to show the customer the requested edits to the order: + +```jsx +
    + {orderEdit.changes.map((itemChange) => ( +
  • + + { + itemChange.line_item ? + itemChange.line_item.title : + itemChange.original_line_item.title + } + + {itemChange.type === "added" && New Item} + {itemChange.type === "removed" && Removed Item} + {itemChange.type === "edited" && + + Edited Item + Old Quantity: {itemChange.original_line_item.quantity} + New Quantity: {itemChange.line_item.quantity} + } +
  • + ))} +
+``` + +--- + +## Handle Payment + +After viewing the changes in the order edit, the customer can choose to confirm or decline the order edit. + +In case the customer wants to confirm the order edit, you must check whether a refund or an additional payment is required. You can check that by checking the value of `difference_due`. + +### Refund Amount + +If `difference_due` is less than 0, then the amount will be refunded to the customer by the merchant from the Medusa admin. No additional actions are required here before [completing the order edit](#complete-the-order-edit). + +### Make Additional Payments + +:::note + +💡 This section explains how to authorize the payment using one payment provider and payment session. However, payment collections allow customers to pay in installments or with more than one provider. You can learn more about how to do that using the [batch endpoints of the Payment APIs](/api/store/#tag/Payment/operation/PostPaymentCollectionsSessionsBatchAuthorize) + +::: + +If `difference_due` is greater than 0, then additional payment from the customer is required. In this case, you must implement these steps to allow the customer to authorize the payment: + +1. Show the customer the available payment providers. These can be retrieved from the details of [the region of the order](/api/store/#tag/Region/operation/GetRegionsRegion). +2. When the customer selects the payment provider, initialize the payment session of that provider in the payment collection. You can do that by sending a request to the [Manage Payment Sessions](/api/store/#tag/Payment/operation/PostPaymentCollectionsSessions) endpoint, passing it the payment collection’s ID as a path parameter, and the payment provider’s ID as a request body parameter: + + + + +```ts +medusa.paymentCollections.managePaymentSession(paymentCollectionId, { + provider_id, +}) +.then(({ payment_collection }) => { + console.log(payment_collection.payment_sessions) +}) +``` + + + + +```ts +fetch( + `/store/payment-collections/${paymentCollectionId}/sessions`, + { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + provider_id, + }), + } +) +.then((response) => response.json()) +.then(({ payment_collection }) => { + console.log(payment_collection.payment_sessions) +}) +``` + + + + +1. Show the customer the payment details form based on the payment session’s provider. For example, if the provider ID of a payment session is `stripe`, you must show Stripe’s card component to enter the customer’s card details. +2. Authorize the payment using the payment provider. The [Authorize Payment Session](/api/store/#tag/Payment/operation/PostPaymentCollectionsSessionsSessionAuthorize) endpoint accepts the payment collection’s ID and the ID of the payment session as path parameters: + + + + +```ts +medusa.paymentCollection + .authorizePaymentSession(paymentCollectionId, paymentSessionId) +.then(({ payment_session }) => { + console.log(payment_session.id) +}) +``` + + + + +```ts +fetch( + `/store/payment-collection/${paymentCollectionId}` + + `/sessions/${paymentSessionId}/authorize`, + { + method: "POST", + credentials: "include", + } +) +.then((response) => response.json()) +.then(({ payment_session }) => { + console.log(payment_session.id) +}) +``` + + + + +After performing the above steps, you can [complete the Order Edit](#complete-the-order-edit). + +--- + +## Complete the Order Edit + +To confirm and complete the order edit, send a request to the [Complete Order Edit](/api/store/#tag/OrderEdit/operation/PostOrderEditsOrderEditComplete) endpoint: + + + + +```ts +medusa.orderEdits.complete(orderEditId) +.then(({ order_edit }) => { + console.log(order_edit.confirmed_at) +}) +``` + + + + +```ts +fetch(`/store/order-edits/${orderEditId}/complete`, { + method: "POST", + credentials: "include", +}) +.then((response) => response.json()) +.then(({ order_edit }) => { + console.log(order_edit.confirmed_at) +}) +``` + + + + +This request accepts the order edit’s ID as a path parameter. + +It returns the full Order Edit object. You can find properties related to the order confirmation, such as `order_edit.confirmed_at`. + +After completing the order edit, the changes proposed in the Order Edit are reflected in the original order. + +:::info + +If the payment isn’t authorized first, the order edit completion will fail. + +::: + +--- + +## Decline an Order Edit + +If the customer wants to decline the Order Edit, you can do that by sending a request to the Decline Order Edit endpoint: + + + + +```ts +medusa.orderEdits.decline(orderEditId, { + decline_reason: "I am not satisfied", +}) +.then(({ order_edit }) => { + console.log(order_edit.declined_at) +}) +``` + + + + +```ts +fetch(`/store/order-edits/${orderEditId}/decline`, { + method: "POST", + credentials: "include", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + decline_reason: "I am not satisfied", + }), +}) +.then((response) => response.json()) +.then(({ order_edit }) => { + console.log(order_edit.declined_at) +}) +``` + + + + +The request requires passing the order edit’s ID as a path parameter. + +In the request body parameters, you can optionally pass the `decline_reason` parameter. It’s a string that indicates to the merchant the reason the customer declined the order edit. + +If the Order Edit is declined, the changes requested in the Order Edit aren't reflected on the original order and no refund or additional payments are required. + +--- + +## See Also + +- [Order Edit API reference](/api/store/#tag/OrderEdit) +- [Edit an order using Admin APIs](../admin/order-edit.mdx) diff --git a/docs/content/advanced/storefront/how-to-implement-checkout-flow.mdx b/docs/content/advanced/storefront/how-to-implement-checkout-flow.mdx index f6f8a99602..307d7c276b 100644 --- a/docs/content/advanced/storefront/how-to-implement-checkout-flow.mdx +++ b/docs/content/advanced/storefront/how-to-implement-checkout-flow.mdx @@ -17,13 +17,15 @@ It’s recommended to go through the [Shipping Architecture Overview](../backend ::: +--- + ## Prerequisites ### Medusa Components -It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.md) to get started. +It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.mdx) to get started. -It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.md) or [Gatsby](../../starters/gatsby-medusa-starter.md) storefronts. +It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.mdx) or [Gatsby](../../starters/gatsby-medusa-starter.mdx) storefronts. ### JS Client @@ -37,6 +39,8 @@ This document assumes you’ve already taken care of the add-to-cart flow. So, y You can learn how to implement the cart flow using [this documentation](../../guides/carts-in-medusa.mdx). +--- + ## Shipping Step In this step, the customer generally enters their shipping info, then chooses the available shipping option based on the entered info. @@ -60,11 +64,11 @@ medusa.carts.update(cartId, { country_code, province, postal_code, - phone + phone, }, }) .then(({ cart }) => { - console.log(cart.shipping_address); + console.log(cart.shipping_address) }) ``` @@ -73,8 +77,8 @@ medusa.carts.update(cartId, { ```jsx fetch(`/store/carts/${cartId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", body: JSON.stringify({ shipping_address: { company, @@ -86,17 +90,17 @@ fetch(`/store/carts/${cartId}`, { country_code, province, postal_code, - phone + phone, }, }), headers: { - 'Content-Type': 'application/json' - } + "Content-Type": "application/json", + }, }) .then((response) => response.json()) .then(({ cart }) => { - console.log(cart.shipping_address); -}); + console.log(cart.shipping_address) +}) ```
@@ -106,6 +110,8 @@ This request accepts the ID of the cart as a path parameter and the new shipping The request returns the updated cart, with the new shipping address available in `cart.shipping_address`. +--- + ### List Shipping Options After updating the cart with the customer’s address, the list of available [shipping options](../backend/shipping/overview.md#shipping-option) for that cart might change. So, you should retrieve the updated list of options. @@ -118,7 +124,7 @@ You can retrieve the list of shipping options by sending a `GET` request to the ```jsx medusa.shippingOptions.listCartOptions(cartId) .then(({ shipping_options }) => { - console.log(shipping_options.length); + console.log(shipping_options.length) }) ``` @@ -127,11 +133,11 @@ medusa.shippingOptions.listCartOptions(cartId) ```jsx fetch(`/store/shipping-options/${cartId}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ shipping_options }) => { - console.log(shipping_options.length); + console.log(shipping_options.length) }) ``` @@ -149,7 +155,7 @@ Once the customer chooses one of the available shipping options, send a `POST` r ```jsx medusa.carts.addShippingMethod(cartId, { - option_id: shippingOptionId //the ID of the selected option + option_id: shippingOptionId, // the ID of the selected option }) .then(({ cart }) => { console.log(cart.shipping_methods) @@ -161,14 +167,14 @@ medusa.carts.addShippingMethod(cartId, { ```jsx fetch(`/store/carts/${cartId}/shipping-methods`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", body: JSON.stringify({ - option_id: shippingOptionId //the ID of the selected option + option_id: shippingOptionId, // the ID of the selected option }), headers: { - 'Content-Type': 'application/json' - } + "Content-Type": "application/json", + }, }) .then((response) => response.json()) .then(({ cart }) => { @@ -183,6 +189,8 @@ The request accepts the ID of the cart as a path parameter and its body the ID o It returns the updated cart, with the created shipping method available in the array `cart.shipping_methods`. +--- + ## Payment Step In this step, the customer generally chooses a payment method to complete their purchase. The implementation of payment providers is done differently for each provider, so this section will just show the general steps you should follow when implementing this step. @@ -208,8 +216,8 @@ medusa.carts.createPaymentSessions(cartId) ```jsx fetch(`/store/carts/${cartId}/payment-sessions`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", }) .then((response) => response.json()) .then(({ cart }) => { @@ -231,7 +239,8 @@ When the customer chooses the payment provider they want to complete purchase wi ```jsx medusa.carts.setPaymentSession(cartId, { - provider_id: paymentProviderId // retrieved from the payment session selected by the customer + // retrieved from the payment session selected by the customer + provider_id: paymentProviderId, }) .then(({ cart }) => { console.log(cart.payment_session) @@ -243,14 +252,15 @@ medusa.carts.setPaymentSession(cartId, { ```jsx fetch(`/store/carts/${cartId}/payment-session`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", body: JSON.stringify({ - provider_id: paymentProviderId // retrieved from the payment session selected by the customer + // retrieved from the payment session selected by the customer + provider_id: paymentProviderId, }), headers: { - 'Content-Type': 'application/json' - } + "Content-Type": "application/json", + }, }) .then((response) => response.json()) .then(({ cart }) => { @@ -283,10 +293,10 @@ If you need to update that data at any point before the purchase is made, send a ```jsx medusa.carts.updatePaymentSession(cartId, paymentProviderId, { data: { - //pass any data you want to add in the `data` attribute - //for example: - "test": true - } + // pass any data you want to add in the `data` attribute + // for example: + "test": true, + }, }) .then(({ cart }) => { console.log(cart.payment_session.data) @@ -296,21 +306,26 @@ medusa.carts.updatePaymentSession(cartId, paymentProviderId, { + + ```jsx -fetch(`/store/carts/${cartId}/payment-sessions/${paymentProviderId}`, { - method: 'POST', - credentials: 'include', - body: JSON.stringify({ - data: { - //pass any data you want to add in the `data` attribute - //for example: - "test": true - } - }), - headers: { - 'Content-Type': 'application/json' +fetch( + `/store/carts/${cartId}/payment-sessions/${paymentProviderId}`, + { + method: "POST", + credentials: "include", + body: JSON.stringify({ + data: { + // pass any data you want to add in the `data` attribute + // for example: + "test": true, + }, + }), + headers: { + "Content-Type": "application/json", + }, } -}) +) .then((response) => response.json()) .then(({ cart }) => { console.log(cart.payment_session.data) @@ -336,7 +351,7 @@ To complete a cart, send a `POST` request to the [Complete a Cart](/api/store/#t ```jsx medusa.carts.complete(cartId) .then(({ type, data }) => { - console.log(type, data); + console.log(type, data) }) ``` @@ -345,15 +360,15 @@ medusa.carts.complete(cartId) ```jsx fetch(`/store/carts/${cartId}/complete`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' - } + "Content-Type": "application/json", + }, }) .then((response) => response.json()) .then(({ type, data }) => { - console.log(type, data); + console.log(type, data) }) ``` @@ -366,8 +381,11 @@ The request returns two properties: `type` and `data`. If the order was placed s If an error occurred while placing the order, `type` will be `cart` and `data` will be the cart's data. -## What’s Next +--- -- Learn more about the [JS Client and how to use it](../../js-client/overview.md). +## See Also + +- [Medusa JS Client Overview](../../js-client/overview.md). - Check out available plugins for popular payment providers such as [Stripe](../../add-plugins/stripe.md) and [PayPal](/add-plugins/paypal.md). -- Learn more about the [Payment](../backend/payment/overview.md) and [Shipping](../backend/shipping/overview.md) Architectures. +- [Payment Architecture](../backend/payment/overview.md) +- [Shipping Architecture](../backend/shipping/overview.md) diff --git a/docs/content/advanced/storefront/implement-claim-order.mdx b/docs/content/advanced/storefront/implement-claim-order.mdx index 00ba56203a..ea62a6dd7c 100644 --- a/docs/content/advanced/storefront/implement-claim-order.mdx +++ b/docs/content/advanced/storefront/implement-claim-order.mdx @@ -32,13 +32,15 @@ In this document, you’ll learn how to implement two parts of this flow: 1. Allow customers to claim their orders. 2. Verify a claim to an order. +--- + ## Prerequisites ### Medusa Components -It's assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.md) to get started. +It's assumed that you already have a Medusa server installed and set up. If not, you can follow the [quickstart guide](../../quickstart/quick-start.mdx) to get started. -It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.md) or [Gatsby](../../starters/gatsby-medusa-starter.md) storefronts. +It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.mdx) or [Gatsby](../../starters/gatsby-medusa-starter.mdx) storefronts. ### JS Client @@ -58,6 +60,8 @@ It is assumed you already have an order placed by a guest customer. You can refe In addition, it is assumed you already have a logged-in customer before performing the steps in this document. You can refer to the [API reference](/api/store/#tag/Auth/operation/PostAuth) for more details on that. +--- + ## Request to Claim an Order When the customer wants to claim an order, they must supply its ID. @@ -78,7 +82,7 @@ medusa.orders.claimOrders({ }) .catch(() => { // an error occurred -}); +}) ``` @@ -86,23 +90,23 @@ medusa.orders.claimOrders({ ```tsx fetch(`/store/orders/batch/customer/token`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", body: JSON.stringify({ order_ids: [ order_id, ], }), headers: { - 'Content-Type': 'application/json' - } + "Content-Type": "application/json", + }, }) .then(() => { - //successful + // successful }) .catch(() => { - //display an error to the customer -}); + // display an error to the customer +}) ``` @@ -114,6 +118,8 @@ If the customer’s request has been processed successfully, the request returns The customer at this point will receive an email with a link to verify their claim on the order. +--- + ## Manually Verify a Claim to an Order The link in the email that the customer receives should be a page in your storefront that accepts a `token` query parameter. @@ -125,14 +131,14 @@ Then, you send a request to the Verify Claim Order endpoint: ```tsx medusa.orders.confirmRequest({ - token + token, }) .then(() => { // successful }) .catch(() => { // an error occurred -}); +}) ``` @@ -140,21 +146,21 @@ medusa.orders.confirmRequest({ ```tsx fetch(`/store/orders/customer/confirm`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", body: JSON.stringify({ - token + token, }), headers: { - 'Content-Type': 'application/json' - } + "Content-Type": "application/json", + }, }) .then(() => { - //successful + // successful }) .catch(() => { - //display an error to the customer -}); + // display an error to the customer +}) ``` @@ -164,6 +170,8 @@ This request accepts as a body parameter the string `token`. This would be the t If the verification is successful, the order will now be associated with the customer and the customer will be able to see it among their orders. +--- + ## See Also -- Learn [how to send a confirmation email to claim an order](../ecommerce/handle-order-claim-event.md). +- [Send a confirmation email to claim an order](../ecommerce/handle-order-claim-event.md) diff --git a/docs/content/advanced/storefront/use-discounts-in-checkout.mdx b/docs/content/advanced/storefront/use-discounts-in-checkout.mdx index 0ba1288532..e7398ffaaa 100644 --- a/docs/content/advanced/storefront/use-discounts-in-checkout.mdx +++ b/docs/content/advanced/storefront/use-discounts-in-checkout.mdx @@ -17,17 +17,19 @@ Customers can use discounts during checkout to benefit from promotions that the In this document, you’ll learn how to add a discount to a cart, how to display details related to the discount, and how to remove a discount from a cart. -## Scenario +### Scenario You want to implement discount functionality in your store to allow customers to apply discount codes to their cart and remove them from the cart. You also want to display the discount details for the customer. +--- + ## Prerequisites ### Medusa Components -It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.md) to get started. +It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.mdx) to get started. -It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.md) or [Gatsby](../../starters/gatsby-medusa-starter.md) storefronts. +It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.mdx) or [Gatsby](../../starters/gatsby-medusa-starter.mdx) storefronts. ### JS Client @@ -41,6 +43,8 @@ This document assumes you’ve already taken care of the add-to-cart flow. So, y You can learn how to implement the cart flow using [this documentation](../../guides/carts-in-medusa.mdx). +--- + ## Add Discount to Cart The customer can enter a discount code during the checkout flow to benefit from a promotion. @@ -54,17 +58,17 @@ You can add a discount to a customer’s cart by sending the [Update Cart reques medusa.carts.update(cartId, { discounts: [ { - code - } - ] + code, + }, + ], }) .then(({ cart }) => { console.log(cart.discounts) }) .catch((e) => { - //display an error to the customer - alert('Discount is invalid') -}); + // display an error to the customer + alert("Discount is invalid") +}) ``` @@ -72,27 +76,27 @@ medusa.carts.update(cartId, { ```jsx fetch(`/store/carts/${cartId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", body: JSON.stringify({ discounts: [ { - code - } + code, + }, ], }), headers: { - 'Content-Type': 'application/json' - } + "Content-Type": "application/json", + }, }) .then((response) => response.json()) .then(({ cart }) => { - console.log(cart.discounts); + console.log(cart.discounts) }) .catch((e) => { - //display an error to the customer - alert('Discount is invalid') -}); + // display an error to the customer + alert("Discount is invalid") +}) ``` @@ -110,6 +114,8 @@ If the discount is applied successfully, the entire cart object will be returned In case the customer enters an invalid discount or the discount cannot be applied to the cart because it doesn’t meet its conditions, the request will return an error. You can handle the error in the `catch` method. +--- + ## Display Discount Details After the customer enters a discount code and it is applied to the cart, you can display the discount details to the customer. This shows the customer how much they benefitted from the discount. @@ -201,6 +207,8 @@ The returned `cart` object has the following properties that can be used to disp - The `shipping_total` property is the total shipping amount. If a Free Shipping discount is applied to the cart, `shipping_total` and `discount_total` will be 0. - The `total` property is the total amount of the cart after applying the discount. +--- + ## Remove Discount from Cart The customer can choose to remove a discount from their cart. @@ -214,7 +222,7 @@ You can remove a discount from a customer’s cart using the [Remove Discount re medusa.carts.deleteDiscount(cartId, code) .then(({ cart }) => { console.log(cart.discounts) -}); +}) ``` @@ -222,13 +230,13 @@ medusa.carts.deleteDiscount(cartId, code) ```jsx fetch(`/store/carts/${cartId}/discounts/${code}`, { - method: 'DELETE', - credentials: 'include' + method: "DELETE", + credentials: "include", }) .then((response) => response.json()) .then(({ cart }) => { - console.log(cart.discounts); -}); + console.log(cart.discounts) +}) ``` @@ -238,7 +246,9 @@ This request accepts the cart ID and the code of the discount to remove. If the The totals of the cart and its items will be updated as well. -## What’s Next +--- -- Learn [how to implement the checkout flow](./how-to-implement-checkout-flow.mdx). -- Learn [how to create discounts using the admin APIs](/api/admin/#tag/Discount/operation/PostDiscounts). \ No newline at end of file +## See Also + +- [Implement the checkout flow in a storefront](./how-to-implement-checkout-flow.mdx). +- [Manage discounts using the admin APIs](../admin/manage-discounts.mdx). diff --git a/docs/content/advanced/storefront/use-regions.mdx b/docs/content/advanced/storefront/use-regions.mdx index afd29ea9c4..64f0be708f 100644 --- a/docs/content/advanced/storefront/use-regions.mdx +++ b/docs/content/advanced/storefront/use-regions.mdx @@ -23,9 +23,9 @@ You want to implement the following in your storefront: ### Medusa Components -It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.md) to get started. +It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.mdx) to get started. -It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.md) or [Gatsby](../../starters/gatsby-medusa-starter.md) storefronts. +It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.mdx) or [Gatsby](../../starters/gatsby-medusa-starter.mdx) storefronts. ### JS Client @@ -47,9 +47,9 @@ You can retrieve available regions by sending a request to the [List Regions](/a ```tsx medusa.regions.list() .then(({ regions }) => { - console.log(regions.length); - //show customers available regions -}); + console.log(regions.length) + // show customers available regions +}) ``` @@ -57,13 +57,13 @@ medusa.regions.list() ```tsx fetch(`/store/regions`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ regions }) => { - console.log(regions.length); - //show customers available regions -}); + console.log(regions.length) + // show customers available regions +}) ``` @@ -86,12 +86,12 @@ For example: ```tsx medusa.products.list({ - region_id: regionId + region_id: regionId, }) .then(({ products, limit, offset, count }) => { - console.log(products.length); - //show customer the products -}); + console.log(products.length) + // show customer the products +}) ``` @@ -99,13 +99,13 @@ medusa.products.list({ ```tsx fetch(`/store/products?region_id=${regionId}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) .then(({ products, limit, offset, count }) => { - console.log(products.length); - //show customer the products -}); + console.log(products.length) + // show customer the products +}) ``` @@ -136,11 +136,11 @@ For example: ```tsx medusa.carts.update(cartId, { - region_id: regionId + region_id: regionId, }) .then(({ cart }) => { - console.log(cart.id); -}); + console.log(cart.id) +}) ``` @@ -148,16 +148,16 @@ medusa.carts.update(cartId, { ```tsx fetch(`/store/carts/${cartId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", body: JSON.stringify({ - region_id: regionId - }) + region_id: regionId, + }), }) .then((response) => response.json()) .then(({ cart }) => { - console.log(cart.id); -}); + console.log(cart.id) +}) ``` @@ -169,7 +169,7 @@ This request returns the full object of the updated cart. --- -## What’s Next +## See Also -- Learn [how to implement cart functionalities in your storefront](../../guides/carts-in-medusa.mdx) -- Learn [how to implement checkout in your storefront](./how-to-implement-checkout-flow.mdx) \ No newline at end of file +- [Implement cart functionalities in your storefront](../../guides/carts-in-medusa.mdx) +- [Implement checkout in your storefront](./how-to-implement-checkout-flow.mdx) diff --git a/docs/content/advanced/storefront/use-sales-channels.mdx b/docs/content/advanced/storefront/use-sales-channels.mdx index 2473bf5455..712b53898f 100644 --- a/docs/content/advanced/storefront/use-sales-channels.mdx +++ b/docs/content/advanced/storefront/use-sales-channels.mdx @@ -11,13 +11,15 @@ In your storefront, you can filter products by sales channels. You can also asso This guide explains how to perform these operations using the Storefront APIs. +--- + ## Prerequisites ### Medusa Components -It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.md) to get started. +It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../../quickstart/quick-start.mdx) to get started. -It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.md) or [Gatsby](../../starters/gatsby-medusa-starter.md) storefronts. +It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../../starters/nextjs-medusa-starter.mdx) or [Gatsby](../../starters/gatsby-medusa-starter.mdx) storefronts. ### JS Client @@ -25,6 +27,8 @@ This guide includes code snippets to send requests to your Medusa server using M If you follow the JS Client code blocks, it’s assumed you already have [Medusa’s JS Client installed](../../js-client/overview.md) and have [created an instance of the client](../../js-client/overview.md#configuration). +--- + ## Filter Products by Sales Channel To filter products by a specific sales channel, pass the `sales_channel_id` query parameter to the List Products endpoint: @@ -35,12 +39,12 @@ To filter products by a specific sales channel, pass the `sales_channel_id` quer ```jsx medusa.products.list({ sales_channel_id: [ - salesChannelId - ] + salesChannelId, + ], }) .then(({ products, limit, offset, count }) => { - console.log(products.length); -}); + console.log(products.length) +}) ``` @@ -51,7 +55,7 @@ fetch(`/store/products?sales_channel_id[0]=${salesChannelId}`) .then((response) => response.json()) .then(({ products, limit, offset, count }) => { console.log(products.length) -}); +}) ``` @@ -61,6 +65,8 @@ The `sales_channel_id` query parameter is an array of sales channel IDs. You can The request returns an array of products. These are the products that are available in the sales channel. +--- + ## Associate a Cart with a Sales Channel ### When Creating a Cart @@ -73,11 +79,11 @@ To associate a sales channel with a cart while creating it, you can pass the `sa ```jsx medusa.carts.create({ - sales_channel_id: salesChannelId + sales_channel_id: salesChannelId, +}) +.then(({ cart }) => { + console.log(cart.id) }) -.then(({cart}) => { - console.log(cart.id); -}); ``` @@ -85,18 +91,18 @@ medusa.carts.create({ ```jsx fetch(`/store/carts`, { - method: 'POST', + method: "POST", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - sales_channel_id: salesChannelId - }) + sales_channel_id: salesChannelId, + }), }) .then((response) => response.json()) -.then(({cart}) => { - console.log(cart.id); -}); +.then(({ cart }) => { + console.log(cart.id) +}) ``` @@ -113,11 +119,11 @@ You can update the sales channel of an existing cart by passing the `sales_chann ```jsx medusa.carts.update(cartId, { - sales_channel_id: salesChannelId + sales_channel_id: salesChannelId, +}) +.then(({ cart }) => { + console.log(cart.id) }) -.then(({cart}) => { - console.log(cart.id); -}); ``` @@ -125,16 +131,16 @@ medusa.carts.update(cartId, { ```jsx fetch(`/store/carts/${cartId}`, { - method: 'POST', + method: "POST", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - sales_channel_id: salesChannelId - }) + sales_channel_id: salesChannelId, + }), }) .then((response) => response.json()) -.then(({cart}) => console.log(cart.id)); +.then(({ cart }) => console.log(cart.id)) ``` @@ -142,7 +148,9 @@ fetch(`/store/carts/${cartId}`, { The request returns the updated cart. -## What’s Next 🚀 +--- -- Learn how to [Implement the Cart functionality in a storefront](../../guides/carts-in-medusa.mdx). -- Learn how to [Implement the Checkout functionality in a storefront](./how-to-implement-checkout-flow.mdx). \ No newline at end of file +## See Also + +- [Implement the Cart functionality in a storefront](../../guides/carts-in-medusa.mdx) +- [Implement the Checkout functionality in a storefront](./how-to-implement-checkout-flow.mdx) diff --git a/docs/content/cli/reference.md b/docs/content/cli/reference.md index 24adca335c..be638b79e3 100644 --- a/docs/content/cli/reference.md +++ b/docs/content/cli/reference.md @@ -8,6 +8,8 @@ The Medusa CLI serves as a tool that allows you to perform important commands wh To use Medusa, it is required to install the CLI tool as it is used to create a new Medusa server. +--- + ## How to Install CLI Tool To install the CLI tool, run the following command in your terminal: @@ -28,6 +30,8 @@ The CLI tool is then available under the `medusa` command. You can see all comma medusa --help ``` +--- + ## Common Options The following options can be used with all available commands. @@ -84,6 +88,8 @@ If used inside a Medusa project, the version of the Medusa CLI and Medusa projec medusa --version ``` +--- + ## Available Commands ### new @@ -206,7 +212,9 @@ medusa telemetry | `--enable` | Enable telemetry (default) | | `--disable` | Disable telemetry | -## What’s Next +--- -- Learn more about [anonymous usage data collection](../usage.md). -- Learn how to [configure your Medusa server](../usage/configurations.md). +## See Also + +- [Configure your Medusa server](../usage/configurations.md) +- [Set up your development environment](../tutorial/0-set-up-your-development-environment.mdx) diff --git a/docs/content/contribution-guidelines.md b/docs/content/contribution-guidelines.md index 644a48550c..30d3fda391 100644 --- a/docs/content/contribution-guidelines.md +++ b/docs/content/contribution-guidelines.md @@ -14,27 +14,37 @@ The documentation website is built with [Docusaurus](https://docusaurus.io/), a The documentation codebase is hosted as part of the [medusa repository](https://github.com/medusajs/medusa) on GitHub. You’ll find the code that runs the docusaurus website under the [www/docs](https://github.com/medusajs/medusa/tree/master/www/docs) directory. +--- + ## Documentation Content The documentation content is written in Markdown format and is located in the [docs/content](https://github.com/medusajs/medusa/tree/master/docs/content) directory of the same repository. If you’re not familiar with Markdown, check out [this cheat sheet](https://www.markdownguide.org/cheat-sheet/) for a quick start. You’ll also find MDX files. MDX files combine the power of Markdown with React. So, the content of the file can contain JSX components and import statements, among other features. You can learn more about [MDX in docusaurus’s guide.](https://docusaurus.io/docs/markdown-features/react) +--- + ## What You Can Contribute To - You can contribute to the Docusaurus codebase to add a new feature or fix a bug in the documentation website. - You can contribute to the documentation content either by fixing errors you find or by adding documentation pages. +--- + ## What You Can’t Contribute To The [Services Reference](/references/services/classes/AuthService) is an automatically generated API reference using Typedoc. So, you can’t contribute to it by making changes to its markdown files. You can, however, contribute to the script generating it if you find any issues in it. +--- + ## Style Guide When you contribute to the documentation content, make sure to follow the [documentation style guide](https://www.notion.so/Style-Guide-Docs-fad86dd1c5f84b48b145e959f36628e0). +--- + ## How to Contribute If you’re fixing errors in an existing documentation page, you can scroll down to the end of the page and click on the “Edit this page” link. You’ll be redirected to the GitHub edit form of that page and you can make edits directly and submit a pull request (PR). @@ -63,6 +73,8 @@ In the body of the PR, explain clearly what the PR does. If the PR solves an iss +--- + ## Sidebar When you add a new page to the documentation, you must add the new page in `www/docs/sidebars.js` under the `docsSidebar`. You can learn more about the syntax used [here](https://docusaurus.io/docs/sidebar/items). @@ -77,6 +89,8 @@ When the documentation page is tutorial documentation, the label in the sidebar The character count of the sidebar item's label must be at most twenty-seven characters. For the API Reference, the sidebar item's label must be at most twenty-five characters. +--- + ## Notes and Additional Information When displaying notes and additional information on a documentation page, use [Admonitions](https://docusaurus.io/docs/markdown-features/admonitions). Make sure the type of admonition used matches the note’s importance to the current document. @@ -89,10 +103,14 @@ If the note displays helpful information and tips use the `tip` admonition. If the admonition does not match any of the mentioned criteria, always default to the `note` admonition. +--- + ## Images If you are adding images to a documentation page, you can host the image on [Imgur](https://imgur.com) for free. +--- + ## Code Blocks ### Use Tabs with Code Blocks @@ -112,10 +130,10 @@ import TabItem from '@theme/TabItem'; ```jsx -medusa.admin.uploads.create(file) //file is an instance of File +medusa.admin.uploads.create(file) // file is an instance of File .then(({ uploads }) => { - const key = uploads[0].key; -}); + const key = uploads[0].key +}) ``` @@ -139,7 +157,10 @@ If you want to add a title to a code block with tabs, add the `codeTitle` prop t For example: ```md - + ``` ### Add Title to Code Block without Tabs @@ -176,6 +197,8 @@ medusa new my-medusa-store --seed ``` ~~~ +--- + ## NPM and Yarn Code Blocks If you’re adding code blocks that use NPM and Yarn, you must use the [npm2yarn syntax](https://docusaurus.io/docs/markdown-features/code-blocks#npm2yarn-remark-plugin). @@ -216,11 +239,13 @@ When a command uses the global option `-g`, add it at the end of the NPM command npm install @medusajs/medusa-cli -g ``` +--- + ## Linting with Vale Medusa uses Vale to lint documentation pages and perform checks on incoming PRs into the repository. -### Result of PR Checks +### Result of Vale PR Checks You can check the result of running the "lint" action on your PR by clicking the Details link next to it. You can find there all errors that you need to fix. @@ -269,6 +294,66 @@ Medusa supports Node versions 14 and 16. If you use this in your PR, you must justify its usage. +--- + +## Linting with ESLint + +Medusa uses Eslint to lint code blocks in the documentation and perform checks on incoming PRs into the repository. + +### Result of ESLint PR Checks + +You can check the result of running the "eslint" action on your PR by clicking the Details link next to it. You can find there all errors that you need to fix. + +### Running ESLint locally + +If you want to check your work locally, you can do that by: + +1. Installing the dependencies in the root directory: + +```bash +yarn install +``` + +2\. Run the lint command: + +```bash +yarn lint:docs +``` + +You can also pass the `--fix` option to automatically fix errors. + +### ESLint Exceptions + +If some code blocks have errors that can't or shouldn't be fixed, you can add the following command before the code block: + +~~~md + + +```js +console.log("This block isn't linted") +``` + +```js +console.log("This block is linted") +``` +~~~ + +You can also disable specific rules. For example: + +~~~md + + +```js +console.log("This block can use semicolons"); +``` + +```js +console.log("This block can't use semi colons") +``` +~~~ + +--- + ## Need Additional Help If you need any additional help while contributing, you can join Medusa's [Discord server](https://discord.gg/medusajs) and ask Medusa’s core team as well as the community any questions. diff --git a/docs/content/deployments/admin/deploying-on-netlify.md b/docs/content/deployments/admin/deploying-on-netlify.md index 29b5a0185e..975c442e3f 100644 --- a/docs/content/deployments/admin/deploying-on-netlify.md +++ b/docs/content/deployments/admin/deploying-on-netlify.md @@ -16,7 +16,7 @@ Alternatively, you can use this button to deploy the Medusa Admin to Netlify dir ### Medusa Components -Before proceeding with this documentation, it is assumed you already have a Medusa Admin installed locally. If not, please go through the [quickstart guide](../../admin/quickstart.md) first. +Before proceeding with this documentation, it is assumed you already have a Medusa Admin installed locally. If not, please go through the [quickstart guide](../../admin/quickstart.mdx) first. Additionally, this documentation does not cover how to deploy the Medusa server. If you want to deploy the Medusa server, check out one of the [deployment documentation related to the Medusa server](../server/index.mdx). @@ -35,6 +35,8 @@ If you want to use another Git Provider, it’s possible to follow along with th - Git’s CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git). +--- + ## Create GitHub Repository Before you can deploy your Medusa Admin you need to create a GitHub repository and push the code base to it. @@ -74,6 +76,8 @@ git push origin master After pushing the changes, you can find the files in your GitHub repository. +--- + ## Deploy to Netlify This section covers how to deploy Netlify either through the Netlify website or using Netlify’s CLI tool. @@ -236,7 +240,6 @@ For the rest of the steps, you can keep most of the default values provided by N ? Directory to deploy (blank for current dir): public ``` - #### Set Environment Variables After the previous command has finished running, your Netlify website will be created. The next step is to add an environment variable that points to your Medusa server. @@ -285,6 +288,8 @@ The Medusa Admin will then open in your browser. Before you can use Medusa Admin, you must add the URL as an environment variable on your deployed Medusa server. +--- + ## Configure CORS Variable on the Medusa Server To send requests to the Medusa server from the Medusa Admin, you must set the `ADMIN_CORS` environment variable on your server to the Medusa Admin’s URL. @@ -305,7 +310,9 @@ Where `` is the URL of your Medusa Admin that you just deployed. Then, restart your Medusa server. Once the server is running again, you can log in to the Medusa Admin and use it. -## What’s Next +--- -- Learn how to [deploy your storefront](../storefront/index.mdx). -- Learn more about [how you can configure Medusa](../../usage/configurations.md). +## See Also + +- [Deploy your storefront](../storefront/index.mdx) +- [Configure your Medusa server](../../usage/configurations.md) diff --git a/docs/content/deployments/server/deploying-on-digital-ocean.md b/docs/content/deployments/server/deploying-on-digital-ocean.md index 617449359f..dffef96150 100644 --- a/docs/content/deployments/server/deploying-on-digital-ocean.md +++ b/docs/content/deployments/server/deploying-on-digital-ocean.md @@ -12,7 +12,7 @@ DigitalOcean is a reliable hosting provider that provides different ways to host ### Medusa Server -It is assumed that you already have a Medusa server installed locally. If you don’t, please follow the [quickstart guide](../../quickstart/quick-start.md). +It is assumed that you already have a Medusa server installed locally. If you don’t, please follow the [quickstart guide](../../quickstart/quick-start.mdx). Furthermore, your Medusa server should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Server documentation](../../usage/configurations.md) to learn how to do that. @@ -31,6 +31,8 @@ If you want to use another Git Provider supported by DigitalOcean, it’s possib - Git’s CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git). +--- + ## Changes to package.json Change the `start` script in `package.json` to the following: @@ -41,6 +43,8 @@ Change the `start` script in `package.json` to the following: This ensures that Migrations are run everytime the Medusa server is restarted. +--- + ## Changes to medusa-config.js In `medusa-config.js`, the `DATABASE_URL` variable is set to the environment variable `DATABASE_URL`. This needs to be changed as DigitalOcean provides the different details of the database connection separately. @@ -48,13 +52,15 @@ In `medusa-config.js`, the `DATABASE_URL` variable is set to the environment var Replace the previous declaration of `DATABASE_URL` in `medusa-config.js` with the following: ```js -const DB_USERNAME = process.env.DB_USERNAME; -const DB_PASSWORD = process.env.DB_PASSWORD; -const DB_HOST = process.env.DB_HOST; -const DB_PORT = process.env.DB_PORT; -const DB_DATABASE = process.env.DB_DATABASE; +const DB_USERNAME = process.env.DB_USERNAME +const DB_PASSWORD = process.env.DB_PASSWORD +const DB_HOST = process.env.DB_HOST +const DB_PORT = process.env.DB_PORT +const DB_DATABASE = process.env.DB_DATABASE -const DATABASE_URL = `postgres://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_DATABASE}`; +const DATABASE_URL = + `postgres://${DB_USERNAME}:${DB_PASSWORD}` + + `@${DB_HOST}:${DB_PORT}/${DB_DATABASE}` ``` In addition, you must add to `projectConfig` in the exported object a new property `database_extra`: @@ -62,12 +68,14 @@ In addition, you must add to `projectConfig` in the exported object a new proper ```js module.exports = { projectConfig: { - //... - database_extra: { ssl: { rejectUnauthorized: false } } + // ... + database_extra: { ssl: { rejectUnauthorized: false } }, }, -}; +} ``` +--- + ## Create GitHub Repository Before you can deploy your Medusa server you need to create a GitHub repository and push the code base to it. @@ -107,6 +115,8 @@ git push origin master After pushing the changes, you can find the files in your GitHub repository. +--- + ## Deploy to DigitalOcean App After logging into your account, click on the Create button at the top right, then choose App. @@ -240,6 +250,8 @@ In the new page, click on the Previously Created DigitalOcean Database radio but Once you’re done click Attach Database. This will add the Redis database to the list of resources of your App and will trigger a redeploy of the App. +--- + ## Test your Server Once the redeployment is complete, copy the URL of the App which can be found under the App’s name. @@ -250,6 +262,8 @@ Then, go to `/store/products`. If the deployment was successful, y ![JSON response with list of products](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002196/Medusa%20Docs/Digital%20Ocean/5xTdMbY_pqwyzy.png) +--- + ## Run Commands on Your Server To run commands on your server, you can access the console on the App’s page by choosing the Console tab. This opens a console in your browser where you can run commands on your server. @@ -265,6 +279,8 @@ Make sure to replace `` and `` with the credentials you want to ![Console in the DigitalOcean App](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002204/Medusa%20Docs/Digital%20Ocean/9RMfD4C_u0mdqs.png) +--- + ## Add Environment Variables You’ll likely need to add environment variables later such as Admin Cross-Origin Resource Sharing (CORS) and Store CORS variables. @@ -279,7 +295,9 @@ Then, scroll down and find Environment Variables. You can expand the environment Once you click Save, the environment variables will be saved and a redeployment will be triggered. -## What’s Next +--- -- Learn [how to deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md). -- Learn [how to deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md). +## See Also + +- [Deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md). +- [Deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md). diff --git a/docs/content/deployments/server/deploying-on-heroku.mdx b/docs/content/deployments/server/deploying-on-heroku.mdx index 9e2faad99d..57df2d8de9 100644 --- a/docs/content/deployments/server/deploying-on-heroku.mdx +++ b/docs/content/deployments/server/deploying-on-heroku.mdx @@ -26,7 +26,7 @@ Alternatively, you can use this button to deploy the Medusa server to Heroku dir ### Medusa Server -It is assumed that you already have a Medusa server installed locally. If you don’t, please follow the [quickstart guide](../../quickstart/quick-start.md). +It is assumed that you already have a Medusa server installed locally. If you don’t, please follow the [quickstart guide](../../quickstart/quick-start.mdx). Furthermore, your Medusa server should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Server documentation](../../usage/configurations.md) to learn how to do that. @@ -39,6 +39,8 @@ Furthermore, your Medusa server should be configured to work with PostgreSQL and - Git’s CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git). - Heroku's CLI tool. You can follow [Heroku's documentation to learn how to install it for your operating system](https://devcenter.heroku.com/articles/heroku-cli). +--- + ## Deploy to Heroku ### 1. Login to Heroku from your CLI @@ -185,7 +187,7 @@ module.exports = { : {}, }, plugins, -}; +} ``` #### package.json @@ -238,6 +240,8 @@ heroku logs -n 500000 --remote heroku --tail -a Where `` is the name of the app. +--- + ## Run Commands on Your Server To run commands on your server, you can use the following command: @@ -256,6 +260,8 @@ heroku run -a -- medusa user -e "" -p "" Where `` is the name of your Heroku app, and `` and `` are the credentials you want to use to log in to the Medusa admin dashboard. +--- + ## Add Environment Variables You’ll likely need to add environment variables later such as Admin Cross-Origin Resource Sharing (CORS) and Store CORS variables. @@ -268,7 +274,9 @@ heroku config:set = -a Where `` is the name of your Heroku app, `` is the name of the environment variable, and `` is the value. -## What's Next +--- -- Learn how to [deploy your Medusa admin](../admin/index.mdx). -- Learn how to [deploy your storefront](../storefront/index.mdx). +## See Also + +- [Deploy your Medusa admin](../admin/index.mdx) +- [Deploy your storefront](../storefront/index.mdx) diff --git a/docs/content/deployments/server/deploying-on-qovery.md b/docs/content/deployments/server/deploying-on-qovery.md index 1f2147459e..20e094a7fc 100644 --- a/docs/content/deployments/server/deploying-on-qovery.md +++ b/docs/content/deployments/server/deploying-on-qovery.md @@ -20,7 +20,7 @@ This tutorial explains how to deploy Medusa to a Qovery organization with an AWS ### Medusa Server -It is assumed that you already have a Medusa server installed locally. If you don’t, please follow the [quickstart guide](../../quickstart/quick-start.md). +It is assumed that you already have a Medusa server installed locally. If you don’t, please follow the [quickstart guide](../../quickstart/quick-start.mdx). Furthermore, your Medusa server should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Server documentation](../../usage/configurations.md) to learn how to do that. @@ -42,6 +42,8 @@ If you want to use another [Git Provider supported by Qovery](https://hub.qovery - Terraform’s CLI tool. You can follow [this guide to install it based on your operating system](https://www.terraform.io/downloads). - Qovery’s CLI tool. You can follow [this guide to install it based on your operating system](https://hub.qovery.com/docs/using-qovery/interface/cli/#install). +--- + ## Create GitHub Repository Before you can deploy your Medusa server you need to create a GitHub repository and push the code base to it. @@ -81,6 +83,8 @@ git push origin master After pushing the changes, you can find the files in your GitHub repository. +--- + ## Deploy to Qovery In this section, you’ll learn how to deploy your Medusa server to Qovery with the help of Terraform. @@ -473,6 +477,8 @@ If you run into any errors while running this command, you can just re-run it af ::: +--- + ## Test your Server Once the command finishes and the deployment is successful, you can access your server in the [Qovery Console](https://console.qovery.com/). Go to the project, environment, then the app that you created using Terraform and Qovery. In the app, click the Open button at the top right to open your website in a new tab. @@ -481,6 +487,8 @@ Once the command finishes and the deployment is successful, you can access your You can access any of the endpoints on your server using the server URL. For example, you can get the list of products using the endpoint `/store/products`. +--- + ## Run Commands on Your Server To run commands on your server, run the following command: @@ -498,6 +506,8 @@ npm install @medusajs/medusa-cli -g medusa user --email --password ``` +--- + ## Add Environment Variables You’ll likely need to add environment variables later such as Admin Cross-Origin Resource Sharing (CORS) and Store CORS variables. @@ -506,7 +516,9 @@ To add environment variables, in your [Qovery Console](https://console.qovery.co ![Environment Variables in the sidebar](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002258/Medusa%20Docs/Qovery/aQl7zdz_tjs0eb.png) -## What’s Next +--- -- Learn how to [deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md). -- Learn how to [deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md). +## See Also + +- [Deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md) +- [Deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md) diff --git a/docs/content/deployments/server/deploying-on-railway.md b/docs/content/deployments/server/deploying-on-railway.md index 7cc16cd2a6..65305be3e4 100644 --- a/docs/content/deployments/server/deploying-on-railway.md +++ b/docs/content/deployments/server/deploying-on-railway.md @@ -12,11 +12,13 @@ In this document, you’ll learn how to deploy your Medusa server to Railway. Railway provides a free plan that allows you to deploy your Medusa server along with PostgreSQL and Redis databases. This is useful mainly for development and demo purposes. +--- + ## Prerequisites ### Medusa Server -It is assumed that you already have a Medusa server installed locally. If you don’t, please follow the [quickstart guide](../../quickstart/quick-start.md). +It is assumed that you already have a Medusa server installed locally. If you don’t, please follow the [quickstart guide](../../quickstart/quick-start.mdx). Furthermore, your Medusa server should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Server documentation](./../../usage/configurations.md) to learn how to do that. @@ -29,12 +31,16 @@ Furthermore, your Medusa server should be configured to work with PostgreSQL and - Git’s CLI tool. You can follow [this documentation to learn how to install it for your operating system](./../../tutorial/0-set-up-your-development-environment.mdx#git). +--- + ## Changes to Medusa Server Codebase By default, Railway looks for a Dockerfile in the root of the codebase. If there is one, it will try to deploy your server using it. As this guide doesn't use Docker, make sure to delete `Dockerfile` from the root of your Medusa server. +--- + ## Create GitHub Repository Before you can deploy your Medusa server you need to create a GitHub repository and push the code base to it. @@ -74,6 +80,8 @@ git push origin master After pushing the changes, you can find the files in your GitHub repository. +--- + ## Deploy to Railway In this section, you’ll create the PostgreSQL and Redis databases first, then deploy the server from the GitHub repository. @@ -172,6 +180,8 @@ The last step is to add a domain name to your Medusa server. To do that: 2. Click on the Settings tab and scroll down to the Domains section. 3. Either click on the Custom Domain button to enter your own domain or the Generate Domain button to generate a random domain. +--- + ## Test your Server Every change you make to the settings redeploys the server. You can check the Deployments of the server by clicking on the GitHub repository’s card and choosing the Deployments tab. @@ -184,6 +194,8 @@ If you generated a random domain, you can find it by clicking on the GitHub repo ::: +--- + ## Troubleshooting If you run into any issues or a problem with your deployed server, you can check the logs in your Railway container instance by: @@ -192,13 +204,17 @@ If you run into any issues or a problem with your deployed server, you can check 2. Click on the Deployments tab. 3. Click on the View Logs button. +--- + ## Run Commands on Server To run commands on your server, you can use [Railway’s CLI tool to run a local shell and execute commands](https://docs.railway.app/develop/cli#local-shell). For example, you can run commands on the server to seed the database or create a new user using [Medusa’s CLI tool](../../cli/reference.md). -## What’s Next +--- -- Learn [how to deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md). -- Learn [how to deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md). +## See Also + +- [Deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md) +- [Deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md) diff --git a/docs/content/deployments/storefront/deploying-gatsby-on-netlify.md b/docs/content/deployments/storefront/deploying-gatsby-on-netlify.md index d8863caf04..4c2905868e 100644 --- a/docs/content/deployments/storefront/deploying-gatsby-on-netlify.md +++ b/docs/content/deployments/storefront/deploying-gatsby-on-netlify.md @@ -12,11 +12,13 @@ Alternatively, you can use this button to deploy the Gatsby Storefront to Netlif Deploy to Netlify +--- + ## Prerequisites ### Medusa Components -Before proceeding with this documentation, it is assumed you already have the Gatsby storefront installed locally. If not, please go through the [quickstart guide](../../starters/gatsby-medusa-starter.md) first. +Before proceeding with this documentation, it is assumed you already have the Gatsby storefront installed locally. If not, please go through the [quickstart guide](../../starters/gatsby-medusa-starter.mdx) first. Additionally, this documentation does not cover how to deploy the Medusa server. If you want to deploy the Medusa server, [check out one of the deployment documentation related to the Medusa server](../server/index.mdx). @@ -35,6 +37,8 @@ If you want to use another Git Provider, it’s possible to follow along with th - Git’s CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git). +--- + ## Create GitHub Repository Before you can deploy your Gatsby storefront you need to create a GitHub repository and push the code base to it. @@ -74,6 +78,8 @@ git push origin master After pushing the changes, you can find the files in your GitHub repository. +--- + ## Deploy to Netlify This section covers how to deploy Netlify either through the Netlify website or using Netlify’s CLI tool. @@ -291,6 +297,8 @@ The Gatsby storefront will then open in your browser. Before you can use the Gatsby storefront, you must add the URL as an environment variable on your deployed Medusa server. +--- + ## Configure CORS Variable on the Medusa Server To send requests to the Medusa server from the Gatsby storefront, you must set the `STORE_CORS` environment variable on your server to the Gatsby storefront’s URL. @@ -311,7 +319,9 @@ Where `` is the URL of your Gatsby storefront that you just depl Then, restart your Medusa server. Once the server is running again, you can use your Gatsby storefront. -## What’s Next +--- -- Learn how to [deploy the Medusa Admin](../admin/index.mdx). -- Learn more about [Medusa’s configurations](../../usage/configurations.md). +## See Also + +- [Deploy the Medusa Admin](../admin/index.mdx) +- [Configure your Medusa server](../../usage/configurations.md) diff --git a/docs/content/guides/carts-in-medusa.mdx b/docs/content/guides/carts-in-medusa.mdx index 3edf44438e..979a74e2c9 100644 --- a/docs/content/guides/carts-in-medusa.mdx +++ b/docs/content/guides/carts-in-medusa.mdx @@ -21,13 +21,15 @@ This document does not cover implementing the checkout flow. You can refer to [t - **Line Item**: When products are added to the cart in Medusa, they are referred to as line items. Line items have, by default, the same properties and attributes as a product. However, you can customize line items specifically for a cart if necessary. +--- + ## Prerequisites ### Medusa Components -It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../quickstart/quick-start.md) to get started. +It's assumed that you already have a Medusa server installed and set up. If not, you can follow our [quickstart guide](../quickstart/quick-start.mdx) to get started. -It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../starters/nextjs-medusa-starter.md) or [Gatsby](../starters/gatsby-medusa-starter.md) storefronts. +It is also assumed you already have a storefront set up. It can be a custom storefront or one of Medusa’s storefronts. If you don’t have a storefront set up, you can install either the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefronts. ### JS Client @@ -35,6 +37,8 @@ This guide includes code snippets to send requests to your Medusa server using M If you follow the JS Client code blocks, it’s assumed you already have [Medusa’s JS Client installed](../js-client/overview.md) and have [created an instance of the client](../js-client/overview.md#configuration). +--- + ## Create a Cart You can create a cart with the following code snippet: @@ -45,10 +49,10 @@ You can create a cart with the following code snippet: ```jsx medusa.carts.create() .then(({ cart }) => { - localStorage.setItem('cart_id', cart.id); - //assuming you have a state variable to store the cart - setCart(cart); -}); + localStorage.setItem("cart_id", cart.id) + // assuming you have a state variable to store the cart + setCart(cart) +}) ``` @@ -56,15 +60,15 @@ medusa.carts.create() ```jsx fetch(`/store/carts`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", }) .then((response) => response.json()) .then(({ cart }) => { - localStorage.setItem('cart_id', cart.id); - //assuming you have a state variable to store the cart + localStorage.setItem("cart_id", cart.id) + // assuming you have a state variable to store the cart setCart(cart) -}); +}) ``` @@ -81,13 +85,13 @@ Otherwise, you can assign it a specific region during creation: ```jsx medusa.carts.create({ - region_id + region_id, }) .then(({ cart }) => { - localStorage.setItem('cart_id', cart.id); - //assuming you have a state variable to store the cart - setCart(cart); -}); + localStorage.setItem("cart_id", cart.id) + // assuming you have a state variable to store the cart + setCart(cart) +}) ``` @@ -95,21 +99,21 @@ medusa.carts.create({ ```jsx fetch(`/store/carts`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - region_id - }) + region_id, + }), }) .then((response) => response.json()) .then(({ cart }) => { - localStorage.setItem('cart_id', cart.id); - //assuming you have a state variable to store the cart + localStorage.setItem("cart_id", cart.id) + // assuming you have a state variable to store the cart setCart(cart) -}); +}) ``` @@ -123,6 +127,8 @@ The region a cart is associated with determines the currency the cart uses, the ::: +--- + ## Retrieve a Cart Notice that in the previous code snippets, you set the cart’s ID in the local storage. This is helpful to persist the customer’s cart even when they leave the website and come back later. @@ -133,11 +139,11 @@ You can retrieve the cart at any given point using its ID with the following cod ```jsx -const id = localStorage.getItem('cart_id'); +const id = localStorage.getItem("cart_id") if (id) { medusa.carts.retrieve(id) - .then(({ cart }) => setCart(cart)); + .then(({ cart }) => setCart(cart)) } ``` @@ -145,14 +151,14 @@ if (id) { ```jsx -const id = localStorage.getItem('cart_id'); +const id = localStorage.getItem("cart_id") if (id) { fetch(`/store/carts/${id}`, { - credentials: 'include', + credentials: "include", }) .then((response) => response.json()) - .then(({ cart }) => setCart(cart)); + .then(({ cart }) => setCart(cart)) } ``` @@ -169,6 +175,8 @@ Make sure to remove the ID from the local storage after the customer places an o ::: +--- + ## Update a Cart A cart has different data associated with it including the region, email, address, customer, and more. @@ -180,9 +188,9 @@ You can use the following snippet to update any of the cart’s data: ```jsx medusa.carts.update(cartId, { - region_id + region_id, }) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` @@ -190,17 +198,17 @@ medusa.carts.update(cartId, { ```jsx fetch(`/store/carts/${cartId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - region_id - }) + region_id, + }), }) .then((response) => response.json()) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` @@ -223,9 +231,9 @@ You can do that using the same update operation: ```jsx medusa.carts.update(cartId, { - customer_id + customer_id, }) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` @@ -233,17 +241,17 @@ medusa.carts.update(cartId, { ```jsx fetch(`/store/carts/${cartId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - customer_id - }) + customer_id, + }), }) .then((response) => response.json()) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` @@ -262,9 +270,9 @@ You can do that using the same update operation: ```jsx medusa.carts.update(cartId, { - email: 'user@example.com' + email: "user@example.com", }) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` @@ -272,22 +280,24 @@ medusa.carts.update(cartId, { ```jsx fetch(`/store/carts/${cartId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - email: 'user@example.com' - }) + email: "user@example.com", + }), }) .then((response) => response.json()) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` +--- + ## Add Line Item to the Cart To create a line item of a product and add it to a cart, you can use the following code snippet: @@ -298,9 +308,9 @@ To create a line item of a product and add it to a cart, you can use the followi ```jsx medusa.carts.lineItems.create(cartId, { variant_id, - quantity: 1 + quantity: 1, }) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` @@ -308,18 +318,18 @@ medusa.carts.lineItems.create(cartId, { ```jsx fetch(`/store/carts/${cartId}/line-items`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ variant_id, - quantity: 1 - }) + quantity: 1, + }), }) .then((response) => response.json()) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` @@ -337,6 +347,8 @@ If you’re using Sales Channels, make sure that the cart and the product belong ::: +--- + ## Update Line Item in the Cart To update a line item's quantity in the cart, you can use the following code snippet: @@ -346,7 +358,7 @@ To update a line item's quantity in the cart, you can use the following code sni ```jsx medusa.carts.lineItems.update(cartId, lineItemId, { - quantity: 3 + quantity: 3, }) .then(({ cart }) => setCart(cart)) ``` @@ -356,17 +368,17 @@ medusa.carts.lineItems.update(cartId, lineItemId, { ```jsx fetch(`/store/carts/${cartId}/line-items/${lineItemId}`, { - method: 'POST', - credentials: 'include', + method: "POST", + credentials: "include", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify({ - quantity: 3 - }) + quantity: 3, + }), }) .then((response) => response.json()) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` @@ -376,6 +388,8 @@ This request accepts the ID of the cart and the ID of the line item as path para It returns the updated cart. +--- + ## Delete a Line Item from the Cart To delete a line item from the cart, you can use the following code snippet: @@ -393,11 +407,11 @@ medusa.carts.lineItems.delete(cartId, lineItemId) ```jsx fetch(`/store/carts/${cartId}/line-items/${lineItemId}`, { - method: 'DELETE', - credentials: 'include', + method: "DELETE", + credentials: "include", }) .then((response) => response.json()) -.then(({ cart }) => setCart(cart)); +.then(({ cart }) => setCart(cart)) ``` @@ -407,7 +421,9 @@ This request accepts the ID of the cart and the ID of the line item as path para It returns the updated cart. -## What’s Next +--- -- Learn [how to implement the checkout flow in your storefront](../advanced/storefront/how-to-implement-checkout-flow.mdx). -- Learn more about the [JS Client and how to use it](../js-client/overview.md). +## See Also + +- [Implement the checkout flow in your storefront](../advanced/storefront/how-to-implement-checkout-flow.mdx) +- [Medusa JS Client Overview](../js-client/overview.md) diff --git a/docs/content/js-client/overview.md b/docs/content/js-client/overview.md index c2c96d617c..4b5e254cdc 100644 --- a/docs/content/js-client/overview.md +++ b/docs/content/js-client/overview.md @@ -12,6 +12,8 @@ To install the Medusa JS Client run the following command: npm install @medusajs/medusa-js ``` +--- + ## Usage Import Medusa as a default import and initiate it: @@ -22,6 +24,8 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa() ``` +--- + ## How to Use this Reference You'll find in the sidebar of this reference names of different resources. These resources are properties in the medusa instance you initialize and you can access them directly using the instance. Then, you'll be able to access the methods or nested resources within those resources. @@ -33,9 +37,9 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa() -//use method +// use method medusa.customers.create({ - //data + // data }) ``` @@ -43,10 +47,12 @@ The `customers` resource also has another resource `addresses` nested inside it ```js medusa.customers.addresses.addAddress({ - //data + // data }) ``` +--- + ## Authentication Authentication can be achieved in two ways using the `medusa-js` client: either by utilizing API keys or by using cookie based authentication. Each method has its own unique use case. @@ -59,6 +65,8 @@ API keys can only be used for admin functionality in Medusa since only users of Authentication using cookies is done automatically by Axios when authenticating using the [auth](/references/js-client/classes/AuthResource) endpoints. After authentication, all subsequent calls will be authenticated. +--- + ## Configuration ### Initialize with config object diff --git a/docs/content/nav.yml b/docs/content/nav.yml deleted file mode 100644 index 9a16383e66..0000000000 --- a/docs/content/nav.yml +++ /dev/null @@ -1,41 +0,0 @@ -- title: Tutorials - id: tutorials - items: - - id: overview - title: Overview - - id: getting-started - title: Getting started - - id: adding-plugins - title: Adding plugins - - id: creating-a-custom-endpoint - title: Creating a custom endpoint - - id: linking-medusa-cloud - title: Linking Medusa Cloud -- title: Guides - id: guides - items: - - id: overview - title: Overview - - id: local-development - title: Local development - items: - - id: overview - title: Overview - - id: create-project-from-starter - title: Create project from starter - items: - - id: medusa-starter - title: Medusa starter - - id: gatsby-starter-medusa - title: Gatsby starter - - id: environment-variables - title: Environment variables -- title: Reference - id: reference - items: - - id: admin - title: admin - - id: store - title: store -- title: Contributing - id: contributing diff --git a/docs/content/quickstart/quick-start-docker.md b/docs/content/quickstart/quick-start-docker.mdx similarity index 82% rename from docs/content/quickstart/quick-start-docker.md rename to docs/content/quickstart/quick-start-docker.mdx index 37c147a72f..c245445e51 100644 --- a/docs/content/quickstart/quick-start-docker.md +++ b/docs/content/quickstart/quick-start-docker.mdx @@ -1,3 +1,5 @@ +import Feedback from '@site/src/components/Feedback'; + # Quickstart using Docker In this document, you will learn how to make a container of Medusa's app on Docker. Docker is an open source platform for building, deploying, and managing containerized applications. @@ -17,6 +19,8 @@ You can install Node from the [official website](https://nodejs.org/en/). It is assumed that you have Docker installed on your system. You can install it from [Docker's website](https://docs.docker.com/get-docker/). +--- + ## Create Medusa Server with Docker ### 1. Clone Medusa's starter project from GitHub @@ -61,6 +65,14 @@ Running the above command does the following: 1. Build images for your Medusa project, a PostgreSQL database, and a Redis server 2. Run migrations for your newly created database + + +--- ## Test Your Server @@ -82,6 +94,8 @@ curl localhost:9000/store/products ::: +--- + ## Additional steps ### File Service Plugin @@ -98,9 +112,11 @@ It's important to configure your Medusa server properly and learn how environmen You can learn more about configuring your server and loading environment variables in the [Configure your Server documentation](../usage/configurations.md). -## What's Next +--- -- Install the [Next.js](../starters/nextjs-medusa-starter.md) or [Gatsby](../starters/gatsby-medusa-starter.md) storefronts to set up your ecommerce storefront quickly. -- Install the [Medusa Admin](../admin/quickstart.md) to supercharge your ecommerce experience with easy access to configurations and features. +## See Also + +- Install the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefronts to set up your ecommerce storefront quickly. +- Install the [Medusa Admin](../admin/quickstart.mdx) to supercharge your ecommerce experience with easy access to configurations and features. - Check out the [API reference](https://docs.medusajs.com/api/store) to learn more about available endpoints available on your Medusa server. - Install [plugins](https://github.com/medusajs/medusa/tree/master/packages) for features like Payment, CMS, and Notifications, among other features. diff --git a/docs/content/quickstart/quick-start.md b/docs/content/quickstart/quick-start.mdx similarity index 77% rename from docs/content/quickstart/quick-start.md rename to docs/content/quickstart/quick-start.mdx index 2b08d692c5..f3dc1c6ba4 100644 --- a/docs/content/quickstart/quick-start.md +++ b/docs/content/quickstart/quick-start.mdx @@ -1,9 +1,13 @@ +import Feedback from '@site/src/components/Feedback'; + # Quickstart This document will guide you through setting up your Medusa server in a few minutes. ## Prerequisites +### Node.js + Medusa supports Node versions 14 and 16. You can check which version of Node you have by running the following command: ```bash noReport @@ -12,6 +16,12 @@ node -v You can install Node from the [official website](https://nodejs.org/en/). +### Git + +Git is required for this setup. You can find instructions on how to install it from the [Set up your dev environment documentation](../tutorial/0-set-up-your-development-environment.mdx#git). + +--- + ## Create a Medusa Server :::tip @@ -45,6 +55,13 @@ If you run into any errors while installing the CLI tool, check out the [trouble medusa develop ``` + + ### Test Your Server After these three steps and in only a couple of minutes, you now have a complete commerce engine running locally. You can test it out by sending a request using a tool like Postman or through the command line: @@ -63,6 +80,8 @@ curl localhost:9000/store/products ::: +--- + ## Additional Steps ### Set Up Development Environment @@ -85,9 +104,11 @@ To upload product images to your Medusa server, you must install and configure o - [S3](../add-plugins/s3.md) - [DigitalOcean Spaces](../add-plugins/spaces.md) -## What's Next +--- -- Install the [Next.js](../starters/nextjs-medusa-starter.md) or [Gatsby](../starters/gatsby-medusa-starter.md) storefronts to set up your ecommerce storefront. -- Install the [Medusa Admin](../admin/quickstart.md) to supercharge your ecommerce experience with easy access to configurations and features. +## See Also + +- Install the [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](../starters/gatsby-medusa-starter.mdx) storefronts to set up your ecommerce storefront. +- Install the [Medusa Admin](../admin/quickstart.mdx) to supercharge your ecommerce experience with easy access to configurations and features. - Check out the [API reference](https://docs.medusajs.com/api/store) to learn more about available endpoints available on your Medusa server. - Install [plugins](https://github.com/medusajs/medusa/tree/master/packages) for features like Payment, CMS, Notifications, among other features. diff --git a/docs/content/references/services/classes/AnalyticsConfigService.md b/docs/content/references/services/classes/AnalyticsConfigService.md index 86be6f2e59..e076237e40 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/105c68929/packages/medusa/src/services/analytics-config.ts#L24) +[packages/medusa/src/services/analytics-config.ts:24](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/analytics-config.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/analytics-config.ts#L21) +[packages/medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/analytics-config.ts#L21) ___ @@ -76,7 +76,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/analytics-config.ts#L18) +[packages/medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/analytics-config.ts#L18) ___ @@ -90,7 +90,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/analytics-config.ts#L19) +[packages/medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/analytics-config.ts#L19) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/analytics-config.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/analytics-config.ts#L22) +[packages/medusa/src/services/analytics-config.ts:22](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/analytics-config.ts#L22) ## Methods @@ -139,7 +139,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -162,7 +162,7 @@ Creates an analytics config. #### Defined in -[packages/medusa/src/services/analytics-config.ts:56](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/analytics-config.ts#L56) +[packages/medusa/src/services/analytics-config.ts:56](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/analytics-config.ts#L56) ___ @@ -184,7 +184,7 @@ Deletes an analytics config. #### Defined in -[packages/medusa/src/services/analytics-config.ts:103](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/analytics-config.ts#L103) +[packages/medusa/src/services/analytics-config.ts:103](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/analytics-config.ts#L103) ___ @@ -204,7 +204,7 @@ ___ #### Defined in -[packages/medusa/src/services/analytics-config.ts:32](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/analytics-config.ts#L32) +[packages/medusa/src/services/analytics-config.ts:32](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/analytics-config.ts#L32) ___ @@ -228,7 +228,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -251,7 +251,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/105c68929/packages/medusa/src/services/analytics-config.ts#L72) +[packages/medusa/src/services/analytics-config.ts:72](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/analytics-config.ts#L72) ___ @@ -275,4 +275,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/AuthService.md b/docs/content/references/services/classes/AuthService.md index b256a023d0..637d34859b 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/105c68929/packages/medusa/src/services/auth.ts#L24) +[packages/medusa/src/services/auth.ts:24](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/auth.ts#L24) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/auth.ts#L22) +[packages/medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/auth.ts#L22) ___ @@ -78,7 +78,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/auth.ts#L19) +[packages/medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/auth.ts#L19) ___ @@ -92,7 +92,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/auth.ts#L20) +[packages/medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/auth.ts#L20) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/auth.ts:21](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/auth.ts#L21) +[packages/medusa/src/services/auth.ts:21](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/auth.ts#L21) ## Methods @@ -141,7 +141,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -169,7 +169,7 @@ success: whether authentication succeeded #### Defined in -[packages/medusa/src/services/auth.ts:97](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/auth.ts#L97) +[packages/medusa/src/services/auth.ts:97](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/auth.ts#L97) ___ @@ -195,7 +195,7 @@ success: whether authentication succeeded #### Defined in -[packages/medusa/src/services/auth.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/auth.ts#L54) +[packages/medusa/src/services/auth.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/auth.ts#L54) ___ @@ -223,7 +223,7 @@ success: whether authentication succeeded #### Defined in -[packages/medusa/src/services/auth.ts:146](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/auth.ts#L146) +[packages/medusa/src/services/auth.ts:146](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/auth.ts#L146) ___ @@ -248,7 +248,7 @@ the result of the comparison #### Defined in -[packages/medusa/src/services/auth.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/auth.ts#L38) +[packages/medusa/src/services/auth.ts:38](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/auth.ts#L38) ___ @@ -272,7 +272,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -296,4 +296,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/BatchJobService.md b/docs/content/references/services/classes/BatchJobService.md index 318895800a..ba05e118b2 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/105c68929/packages/medusa/src/services/batch-job.ts#L93) +[packages/medusa/src/services/batch-job.ts:93](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L93) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L41) +[packages/medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L41) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L45) +[packages/medusa/src/services/batch-job.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L45) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L42) +[packages/medusa/src/services/batch-job.ts:42](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L42) ___ @@ -96,7 +96,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/batch-job.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L38) +[packages/medusa/src/services/batch-job.ts:38](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L38) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L43) +[packages/medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L43) ___ @@ -120,7 +120,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L39) +[packages/medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L39) ___ @@ -143,7 +143,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L27) +[packages/medusa/src/services/batch-job.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L27) ## Methods @@ -182,7 +182,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -202,7 +202,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:269](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L269) +[packages/medusa/src/services/batch-job.ts:277](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L277) ___ @@ -222,7 +222,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:251](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L251) +[packages/medusa/src/services/batch-job.ts:259](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L259) ___ @@ -242,7 +242,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:233](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L233) +[packages/medusa/src/services/batch-job.ts:241](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L241) ___ @@ -262,7 +262,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:138](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L138) +[packages/medusa/src/services/batch-job.ts:146](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L146) ___ @@ -283,7 +283,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:127](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L127) +[packages/medusa/src/services/batch-job.ts:135](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L135) ___ @@ -304,7 +304,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:366](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L366) +[packages/medusa/src/services/batch-job.ts:374](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L374) ___ @@ -325,7 +325,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:107](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L107) +[packages/medusa/src/services/batch-job.ts:108](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L108) ___ @@ -338,7 +338,7 @@ ___ | Name | Type | | :------ | :------ | | `batchJobOrId` | `string` \| `BatchJob` | -| `error?` | `BatchJobResultError` | +| `error?` | `string` \| `BatchJobResultError` | #### Returns @@ -346,7 +346,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:340](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L340) +[packages/medusa/src/services/batch-job.ts:348](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L348) ___ @@ -366,7 +366,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:287](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L287) +[packages/medusa/src/services/batch-job.ts:295](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L295) ___ @@ -386,7 +386,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:320](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L320) +[packages/medusa/src/services/batch-job.ts:328](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L328) ___ @@ -410,7 +410,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -431,7 +431,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:157](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L157) +[packages/medusa/src/services/batch-job.ts:165](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L165) ___ @@ -452,7 +452,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:198](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/batch-job.ts#L198) +[packages/medusa/src/services/batch-job.ts:206](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/batch-job.ts#L206) ___ @@ -476,4 +476,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/CacheService.md b/docs/content/references/services/classes/CacheService.md new file mode 100644 index 0000000000..b5a62ec82c --- /dev/null +++ b/docs/content/references/services/classes/CacheService.md @@ -0,0 +1,119 @@ +# 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/d843bc102/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/d843bc102/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/d843bc102/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/d843bc102/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/d843bc102/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 711dd8bb39..f20613cc38 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:129](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L129) +[packages/medusa/src/services/cart.ts:131](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L131) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:105](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L105) +[packages/medusa/src/services/cart.ts:107](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L107) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:104](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L104) +[packages/medusa/src/services/cart.ts:106](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L106) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:124](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L124) +[packages/medusa/src/services/cart.ts:126](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L126) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:116](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L116) +[packages/medusa/src/services/cart.ts:118](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L118) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:118](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L118) +[packages/medusa/src/services/cart.ts:120](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L120) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:108](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L108) +[packages/medusa/src/services/cart.ts:110](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L110) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:127](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L127) +[packages/medusa/src/services/cart.ts:129](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L129) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:119](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L119) +[packages/medusa/src/services/cart.ts:121](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L121) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:123](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L123) +[packages/medusa/src/services/cart.ts:125](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L125) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:126](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L126) +[packages/medusa/src/services/cart.ts:128](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L128) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:107](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L107) +[packages/medusa/src/services/cart.ts:109](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L109) ___ @@ -172,7 +172,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:114](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L114) +[packages/medusa/src/services/cart.ts:116](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L116) ___ @@ -186,7 +186,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/cart.ts:100](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L100) +[packages/medusa/src/services/cart.ts:102](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L102) ___ @@ -196,7 +196,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:122](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L122) +[packages/medusa/src/services/cart.ts:124](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L124) ___ @@ -206,7 +206,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:115](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L115) +[packages/medusa/src/services/cart.ts:117](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L117) ___ @@ -216,7 +216,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:106](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L106) +[packages/medusa/src/services/cart.ts:108](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L108) ___ @@ -226,7 +226,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:125](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L125) +[packages/medusa/src/services/cart.ts:127](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L127) ___ @@ -236,7 +236,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:110](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L110) +[packages/medusa/src/services/cart.ts:112](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L112) ___ @@ -246,7 +246,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:109](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L109) +[packages/medusa/src/services/cart.ts:111](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L111) ___ @@ -256,7 +256,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:113](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L113) +[packages/medusa/src/services/cart.ts:115](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L115) ___ @@ -266,7 +266,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:112](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L112) +[packages/medusa/src/services/cart.ts:114](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L114) ___ @@ -276,7 +276,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:103](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L103) +[packages/medusa/src/services/cart.ts:105](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L105) ___ @@ -286,7 +286,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:117](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L117) +[packages/medusa/src/services/cart.ts:119](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L119) ___ @@ -296,7 +296,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:111](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L111) +[packages/medusa/src/services/cart.ts:113](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L113) ___ @@ -306,7 +306,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:120](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L120) +[packages/medusa/src/services/cart.ts:122](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L122) ___ @@ -316,7 +316,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:121](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L121) +[packages/medusa/src/services/cart.ts:123](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L123) ___ @@ -330,7 +330,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/cart.ts:101](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L101) +[packages/medusa/src/services/cart.ts:103](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L103) ___ @@ -348,7 +348,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:94](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L94) +[packages/medusa/src/services/cart.ts:96](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L96) ## Methods @@ -358,6 +358,10 @@ ___ Adds a line item to the cart. +**`Deprecated`** + +Use [addOrUpdateLineItems](CartService.md#addorupdatelineitems) instead. + #### Parameters | Name | Type | Default value | Description | @@ -375,7 +379,35 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:587](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L587) +[packages/medusa/src/services/cart.ts:613](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L613) + +___ + +### addOrUpdateLineItems + +▸ **addOrUpdateLineItems**(`cartId`, `lineItems`, `config?`): `Promise`<`void`\> + +Adds or update one or multiple line items to the cart. It also update all existing items in the cart +to have has_shipping to false. Finally, the adjustments will be updated. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `cartId` | `string` | `undefined` | the id of the cart that we will add to | +| `lineItems` | `LineItem` \| `LineItem`[] | `undefined` | the line items to add. | +| `config` | `Object` | `undefined` | validateSalesChannels - should check if product belongs to the same sales chanel as cart (if cart has associated sales channel) | +| `config.validateSalesChannels` | `boolean` | `true` | - | + +#### Returns + +`Promise`<`void`\> + +the result of the update operation + +#### Defined in + +[packages/medusa/src/services/cart.ts:719](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L719) ___ @@ -405,7 +437,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1642](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1642) +[packages/medusa/src/services/cart.ts:1862](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1862) ___ @@ -433,7 +465,7 @@ void #### Defined in -[packages/medusa/src/services/cart.ts:749](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L749) +[packages/medusa/src/services/cart.ts:934](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L934) ___ @@ -461,7 +493,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1170](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1170) +[packages/medusa/src/services/cart.ts:1358](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1358) ___ @@ -482,7 +514,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:1134](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1134) +[packages/medusa/src/services/cart.ts:1322](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1322) ___ @@ -521,7 +553,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -550,7 +582,7 @@ the resulting cart #### Defined in -[packages/medusa/src/services/cart.ts:1316](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1316) +[packages/medusa/src/services/cart.ts:1508](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1508) ___ @@ -574,13 +606,13 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/cart.ts:305](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L305) +[packages/medusa/src/services/cart.ts:314](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L314) ___ -### createOrFetchUserFromEmail\_ +### createOrFetchGuestCustomerFromEmail\_ -▸ `Protected` **createOrFetchUserFromEmail_**(`email`): `Promise`<`Customer`\> +▸ `Protected` **createOrFetchGuestCustomerFromEmail_**(`email`): `Promise`<`Customer`\> Creates or fetches a user based on an email. @@ -598,7 +630,7 @@ the resultign customer object #### Defined in -[packages/medusa/src/services/cart.ts:1019](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1019) +[packages/medusa/src/services/cart.ts:1209](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1209) ___ @@ -618,7 +650,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2049](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L2049) +[packages/medusa/src/services/cart.ts:2269](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2269) ___ @@ -639,7 +671,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2099](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L2099) +[packages/medusa/src/services/cart.ts:2319](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2319) ___ @@ -665,7 +697,7 @@ Use decorateTotals instead #### Defined in -[packages/medusa/src/services/cart.ts:2271](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L2271) +[packages/medusa/src/services/cart.ts:2491](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2491) ___ @@ -689,7 +721,7 @@ the deleted cart or undefined if the cart was not found. #### Defined in -[packages/medusa/src/services/cart.ts:1964](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1964) +[packages/medusa/src/services/cart.ts:2184](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2184) ___ @@ -714,7 +746,7 @@ the resulting cart. #### Defined in -[packages/medusa/src/services/cart.ts:1550](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1550) +[packages/medusa/src/services/cart.ts:1764](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1764) ___ @@ -734,7 +766,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2080](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L2080) +[packages/medusa/src/services/cart.ts:2300](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2300) ___ @@ -760,7 +792,7 @@ custom shipping option #### Defined in -[packages/medusa/src/services/cart.ts:1750](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1750) +[packages/medusa/src/services/cart.ts:1970](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1970) ___ @@ -780,7 +812,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2322](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L2322) +[packages/medusa/src/services/cart.ts:2542](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2542) ___ @@ -800,7 +832,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:427](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L427) +[packages/medusa/src/services/cart.ts:450](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L450) ___ @@ -823,7 +855,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/cart.ts:193](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L193) +[packages/medusa/src/services/cart.ts:195](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L195) ___ @@ -848,7 +880,7 @@ void #### Defined in -[packages/medusa/src/services/cart.ts:965](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L965) +[packages/medusa/src/services/cart.ts:1155](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1155) ___ @@ -868,7 +900,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2193](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L2193) +[packages/medusa/src/services/cart.ts:2413](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2413) ___ @@ -893,7 +925,7 @@ the resulting cart. #### Defined in -[packages/medusa/src/services/cart.ts:1598](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1598) +[packages/medusa/src/services/cart.ts:1812](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1812) ___ @@ -918,7 +950,7 @@ the resulting cart #### Defined in -[packages/medusa/src/services/cart.ts:1230](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1230) +[packages/medusa/src/services/cart.ts:1418](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1418) ___ @@ -943,7 +975,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:459](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L459) +[packages/medusa/src/services/cart.ts:482](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L482) ___ @@ -969,7 +1001,7 @@ the cart document. #### Defined in -[packages/medusa/src/services/cart.ts:211](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L211) +[packages/medusa/src/services/cart.ts:213](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L213) ___ @@ -993,7 +1025,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:253](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L253) +[packages/medusa/src/services/cart.ts:262](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L262) ___ @@ -1015,7 +1047,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:285](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L285) +[packages/medusa/src/services/cart.ts:294](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L294) ___ @@ -1043,7 +1075,7 @@ resolves to the updated result. #### Defined in -[packages/medusa/src/services/cart.ts:2007](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L2007) +[packages/medusa/src/services/cart.ts:2227](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2227) ___ @@ -1068,7 +1100,7 @@ result of update operation #### Defined in -[packages/medusa/src/services/cart.ts:1391](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1391) +[packages/medusa/src/services/cart.ts:1583](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1583) ___ @@ -1096,7 +1128,7 @@ the result of the update operation. #### Defined in -[packages/medusa/src/services/cart.ts:1457](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1457) +[packages/medusa/src/services/cart.ts:1649](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1649) ___ @@ -1122,7 +1154,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1830](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1830) +[packages/medusa/src/services/cart.ts:2050](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2050) ___ @@ -1146,7 +1178,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -1166,7 +1198,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2213](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L2213) +[packages/medusa/src/services/cart.ts:2433](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L2433) ___ @@ -1187,7 +1219,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:792](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L792) +[packages/medusa/src/services/cart.ts:977](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L977) ___ @@ -1213,7 +1245,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1045](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1045) +[packages/medusa/src/services/cart.ts:1235](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1235) ___ @@ -1238,7 +1270,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1001](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1001) +[packages/medusa/src/services/cart.ts:1191](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1191) ___ @@ -1264,7 +1296,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:684](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L684) +[packages/medusa/src/services/cart.ts:869](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L869) ___ @@ -1289,7 +1321,7 @@ the resulting cart #### Defined in -[packages/medusa/src/services/cart.ts:1278](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1278) +[packages/medusa/src/services/cart.ts:1470](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1470) ___ @@ -1315,7 +1347,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1085](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1085) +[packages/medusa/src/services/cart.ts:1273](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1273) ___ @@ -1337,7 +1369,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:1769](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L1769) +[packages/medusa/src/services/cart.ts:1989](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L1989) ___ @@ -1353,7 +1385,7 @@ Check if line item's variant belongs to the cart's sales channel. | :------ | :------ | :------ | | `sales_channel_id` | `Object` | the cart for the line item | | `sales_channel_id.sales_channel_id` | ``null`` \| `string` | - | -| `lineItem` | `LineItem` | the line item being added | +| `lineItem` | `LineItemValidateData` | the line item being added | #### Returns @@ -1363,7 +1395,7 @@ a boolean indicating validation result #### Defined in -[packages/medusa/src/services/cart.ts:556](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L556) +[packages/medusa/src/services/cart.ts:579](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L579) ___ @@ -1390,7 +1422,7 @@ boolean representing whether shipping method is validated #### Defined in -[packages/medusa/src/services/cart.ts:525](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/cart.ts#L525) +[packages/medusa/src/services/cart.ts:548](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/cart.ts#L548) ___ @@ -1414,4 +1446,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ClaimItemService.md b/docs/content/references/services/classes/ClaimItemService.md index cc7c9c503e..6662d5e191 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/105c68929/packages/medusa/src/services/claim-item.ts#L30) +[packages/medusa/src/services/claim-item.ts:30](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L30) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:25](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L25) +[packages/medusa/src/services/claim-item.ts:25](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L25) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L23) +[packages/medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L23) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L24) +[packages/medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L24) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L22) +[packages/medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L22) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L21) +[packages/medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L21) ___ @@ -116,7 +116,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/claim-item.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L27) +[packages/medusa/src/services/claim-item.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L27) ___ @@ -130,7 +130,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/claim-item.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L28) +[packages/medusa/src/services/claim-item.ts:28](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L28) ___ @@ -148,7 +148,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:15](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L15) +[packages/medusa/src/services/claim-item.ts:15](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L15) ## Methods @@ -187,7 +187,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -207,7 +207,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L49) +[packages/medusa/src/services/claim-item.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L49) ___ @@ -230,13 +230,13 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/claim-item.ts:214](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L214) +[packages/medusa/src/services/claim-item.ts:214](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L214) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`ClaimItem`\> +▸ **retrieve**(`claimItemId`, `config?`): `Promise`<`ClaimItem`\> Gets a claim item by id. @@ -244,7 +244,7 @@ Gets a claim item by id. | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `string` | id of ClaimItem to retrieve | +| `claimItemId` | `string` | id of ClaimItem to retrieve | | `config` | `FindConfig`<`ClaimItem`\> | configuration for the find operation | #### Returns @@ -255,7 +255,7 @@ the ClaimItem #### Defined in -[packages/medusa/src/services/claim-item.ts:233](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L233) +[packages/medusa/src/services/claim-item.ts:233](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L233) ___ @@ -279,7 +279,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -300,7 +300,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:132](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim-item.ts#L132) +[packages/medusa/src/services/claim-item.ts:132](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim-item.ts#L132) ___ @@ -324,4 +324,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ClaimService.md b/docs/content/references/services/classes/ClaimService.md index 71abde1728..fe9e58042f 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:83](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L83) +[packages/medusa/src/services/claim.ts:83](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L83) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:66](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L66) +[packages/medusa/src/services/claim.ts:66](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L66) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:70](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L70) +[packages/medusa/src/services/claim.ts:70](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L70) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:67](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L67) +[packages/medusa/src/services/claim.ts:67](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L67) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L71) +[packages/medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L71) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L72) +[packages/medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L72) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L73) +[packages/medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L73) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L74) +[packages/medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L74) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L69) +[packages/medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L69) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L75) +[packages/medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L75) ___ @@ -156,7 +156,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/claim.ts:63](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L63) +[packages/medusa/src/services/claim.ts:63](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L63) ___ @@ -166,7 +166,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L76) +[packages/medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L76) ___ @@ -176,7 +176,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L77) +[packages/medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L77) ___ @@ -186,7 +186,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L78) +[packages/medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L78) ___ @@ -196,7 +196,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L68) +[packages/medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L68) ___ @@ -206,7 +206,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L79) +[packages/medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L79) ___ @@ -216,7 +216,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L80) +[packages/medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L80) ___ @@ -226,7 +226,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:81](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L81) +[packages/medusa/src/services/claim.ts:81](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L81) ___ @@ -240,7 +240,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/claim.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L64) +[packages/medusa/src/services/claim.ts:64](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L64) ___ @@ -261,7 +261,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L54) +[packages/medusa/src/services/claim.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L54) ## Methods @@ -300,7 +300,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -320,7 +320,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:761](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L761) +[packages/medusa/src/services/claim.ts:761](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L761) ___ @@ -340,7 +340,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:609](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L609) +[packages/medusa/src/services/claim.ts:609](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L609) ___ @@ -366,7 +366,7 @@ created claim #### Defined in -[packages/medusa/src/services/claim.ts:213](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L213) +[packages/medusa/src/services/claim.ts:213](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L213) ___ @@ -391,7 +391,7 @@ created claim #### Defined in -[packages/medusa/src/services/claim.ts:463](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L463) +[packages/medusa/src/services/claim.ts:463](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L463) ___ @@ -416,7 +416,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:681](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L681) +[packages/medusa/src/services/claim.ts:681](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L681) ___ @@ -439,7 +439,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/claim.ts:817](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L817) +[packages/medusa/src/services/claim.ts:817](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L817) ___ @@ -459,13 +459,13 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:635](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L635) +[packages/medusa/src/services/claim.ts:635](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L635) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`ClaimOrder`\> +▸ **retrieve**(`claimId`, `config?`): `Promise`<`ClaimOrder`\> Gets an order by id. @@ -473,7 +473,7 @@ Gets an order by id. | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `string` | id of the claim order to retrieve | +| `claimId` | `string` | id of the claim order to retrieve | | `config` | `FindConfig`<`ClaimOrder`\> | the config object containing query settings | #### Returns @@ -484,7 +484,7 @@ the order document #### Defined in -[packages/medusa/src/services/claim.ts:837](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L837) +[packages/medusa/src/services/claim.ts:837](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L837) ___ @@ -508,7 +508,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -529,7 +529,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:125](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/claim.ts#L125) +[packages/medusa/src/services/claim.ts:125](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/claim.ts#L125) ___ @@ -553,4 +553,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/CurrencyService.md b/docs/content/references/services/classes/CurrencyService.md index d4affdc54a..8a954acd1a 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/105c68929/packages/medusa/src/services/currency.ts#L32) +[packages/medusa/src/services/currency.ts:32](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L32) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/currency.ts#L28) +[packages/medusa/src/services/currency.ts:28](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L28) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/currency.ts#L29) +[packages/medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L29) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/currency.ts#L30) +[packages/medusa/src/services/currency.ts:30](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L30) ___ @@ -96,7 +96,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/currency.ts#L25) +[packages/medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L25) ___ @@ -110,7 +110,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/currency.ts#L26) +[packages/medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L26) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/currency.ts#L21) +[packages/medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L21) ## Methods @@ -165,7 +165,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -193,7 +193,7 @@ an array containing the currencies as #### Defined in -[packages/medusa/src/services/currency.ts:81](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/currency.ts#L81) +[packages/medusa/src/services/currency.ts:81](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L81) ___ @@ -217,7 +217,7 @@ The currency #### Defined in -[packages/medusa/src/services/currency.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/currency.ts#L50) +[packages/medusa/src/services/currency.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L50) ___ @@ -241,7 +241,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -266,7 +266,7 @@ The updated currency #### Defined in -[packages/medusa/src/services/currency.ts:103](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/currency.ts#L103) +[packages/medusa/src/services/currency.ts:103](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/currency.ts#L103) ___ @@ -290,4 +290,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/CustomShippingOptionService.md b/docs/content/references/services/classes/CustomShippingOptionService.md index 157af0011d..f2c7cf3100 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/105c68929/packages/medusa/src/services/custom-shipping-option.ts#L20) +[packages/medusa/src/services/custom-shipping-option.ts:20](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/custom-shipping-option.ts#L20) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/custom-shipping-option.ts#L18) +[packages/medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/custom-shipping-option.ts#L18) ___ @@ -76,7 +76,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:15](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/custom-shipping-option.ts#L15) +[packages/medusa/src/services/custom-shipping-option.ts:15](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/custom-shipping-option.ts#L15) ___ @@ -90,7 +90,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/custom-shipping-option.ts#L16) +[packages/medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/custom-shipping-option.ts#L16) ## Methods @@ -129,7 +129,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -153,7 +153,7 @@ resolves to the creation result #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:89](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/custom-shipping-option.ts#L89) +[packages/medusa/src/services/custom-shipping-option.ts:89](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/custom-shipping-option.ts#L89) ___ @@ -178,7 +178,7 @@ custom shipping options matching the query #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:65](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/custom-shipping-option.ts#L65) +[packages/medusa/src/services/custom-shipping-option.ts:65](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/custom-shipping-option.ts#L65) ___ @@ -203,7 +203,7 @@ the requested custom shipping option. #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/custom-shipping-option.ts#L37) +[packages/medusa/src/services/custom-shipping-option.ts:37](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/custom-shipping-option.ts#L37) ___ @@ -227,7 +227,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -251,4 +251,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/CustomerGroupService.md b/docs/content/references/services/classes/CustomerGroupService.md index d124eade90..e6f65bb8f2 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:33](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L33) +[packages/medusa/src/services/customer-group.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L30) +[packages/medusa/src/services/customer-group.ts:24](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L24) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L31) +[packages/medusa/src/services/customer-group.ts:25](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L25) ___ @@ -86,7 +86,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/customer-group.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L27) +[packages/medusa/src/services/customer-group.ts:21](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L21) ___ @@ -100,7 +100,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/customer-group.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L28) +[packages/medusa/src/services/customer-group.ts:22](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L22) ## Methods @@ -125,7 +125,7 @@ the customer group after insertion #### Defined in -[packages/medusa/src/services/customer-group.ts:92](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L92) +[packages/medusa/src/services/customer-group.ts:94](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L94) ___ @@ -164,7 +164,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -196,7 +196,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/customer-group.ts:68](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L68) +[packages/medusa/src/services/customer-group.ts:70](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L70) ___ @@ -220,7 +220,7 @@ a promise #### Defined in -[packages/medusa/src/services/customer-group.ts:156](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L156) +[packages/medusa/src/services/customer-group.ts:158](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L158) ___ @@ -242,7 +242,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:259](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L259) +[packages/medusa/src/services/customer-group.ts:261](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L261) ___ @@ -267,7 +267,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer-group.ts:179](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L179) +[packages/medusa/src/services/customer-group.ts:181](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L181) ___ @@ -292,7 +292,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer-group.ts:197](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L197) +[packages/medusa/src/services/customer-group.ts:199](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L199) ___ @@ -317,19 +317,19 @@ the customergroup with the provided id #### Defined in -[packages/medusa/src/services/customer-group.ts:238](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L238) +[packages/medusa/src/services/customer-group.ts:240](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L240) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`CustomerGroup`\> +▸ **retrieve**(`customerGroupId`, `config?`): `Promise`<`CustomerGroup`\> #### Parameters | Name | Type | | :------ | :------ | -| `id` | `string` | +| `customerGroupId` | `string` | | `config` | `Object` | #### Returns @@ -338,7 +338,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L45) +[packages/medusa/src/services/customer-group.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L40) ___ @@ -362,7 +362,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -387,7 +387,7 @@ resulting customer group #### Defined in -[packages/medusa/src/services/customer-group.ts:123](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer-group.ts#L123) +[packages/medusa/src/services/customer-group.ts:125](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer-group.ts#L125) ___ @@ -411,4 +411,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/CustomerService.md b/docs/content/references/services/classes/CustomerService.md index 7f203eb6a9..5a7e57bc94 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/105c68929/packages/medusa/src/services/customer.ts#L39) +[packages/medusa/src/services/customer.ts:39](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L27) +[packages/medusa/src/services/customer.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L27) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L26) +[packages/medusa/src/services/customer.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L26) ___ @@ -84,7 +84,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L28) +[packages/medusa/src/services/customer.ts:28](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L28) ___ @@ -98,7 +98,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/customer.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L30) +[packages/medusa/src/services/customer.ts:30](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L30) ___ @@ -112,7 +112,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/customer.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L31) +[packages/medusa/src/services/customer.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L31) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:33](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L33) +[packages/medusa/src/services/customer.ts:33](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L33) ## Methods @@ -151,7 +151,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:457](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L457) +[packages/medusa/src/services/customer.ts:498](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L498) ___ @@ -190,7 +190,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -208,7 +208,7 @@ the result of the count operation #### Defined in -[packages/medusa/src/services/customer.ts:158](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L158) +[packages/medusa/src/services/customer.ts:158](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L158) ___ @@ -235,7 +235,7 @@ the result of create #### Defined in -[packages/medusa/src/services/customer.ts:245](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L245) +[packages/medusa/src/services/customer.ts:285](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L285) ___ @@ -259,7 +259,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/customer.ts:505](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L505) +[packages/medusa/src/services/customer.ts:546](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L546) ___ @@ -287,7 +287,7 @@ the generated JSON web token #### Defined in -[packages/medusa/src/services/customer.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L64) +[packages/medusa/src/services/customer.ts:64](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L64) ___ @@ -311,7 +311,7 @@ hashed password #### Defined in -[packages/medusa/src/services/customer.ts:232](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L232) +[packages/medusa/src/services/customer.ts:272](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L272) ___ @@ -334,7 +334,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer.ts:107](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L107) +[packages/medusa/src/services/customer.ts:107](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L107) ___ @@ -357,7 +357,28 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer.ts:131](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L131) +[packages/medusa/src/services/customer.ts:131](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L131) + +___ + +### listByEmail + +▸ **listByEmail**(`email`, `config?`): `Promise`<`Customer`[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `email` | `string` | +| `config` | `FindConfig`<`Customer`\> | + +#### Returns + +`Promise`<`Customer`[]\> + +#### Defined in + +[packages/medusa/src/services/customer.ts:228](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L228) ___ @@ -378,7 +399,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:440](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L440) +[packages/medusa/src/services/customer.ts:481](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L481) ___ @@ -403,7 +424,7 @@ the customer document. #### Defined in -[packages/medusa/src/services/customer.ts:220](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L220) +[packages/medusa/src/services/customer.ts:253](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L253) ___ @@ -411,7 +432,9 @@ ___ ▸ **retrieveByEmail**(`email`, `config?`): `Promise`<`Customer`\> -Gets a customer by email. +Gets a registered customer by email. + +**`Deprecated`** #### Parameters @@ -428,7 +451,7 @@ the customer document. #### Defined in -[packages/medusa/src/services/customer.ts:194](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L194) +[packages/medusa/src/services/customer.ts:195](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L195) ___ @@ -453,7 +476,49 @@ the customer document. #### Defined in -[packages/medusa/src/services/customer.ts:207](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L207) +[packages/medusa/src/services/customer.ts:240](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L240) + +___ + +### retrieveRegisteredByEmail + +▸ **retrieveRegisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `email` | `string` | +| `config` | `FindConfig`<`Customer`\> | + +#### Returns + +`Promise`<`Customer`\> + +#### Defined in + +[packages/medusa/src/services/customer.ts:218](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L218) + +___ + +### retrieveUnregisteredByEmail + +▸ **retrieveUnregisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `email` | `string` | +| `config` | `FindConfig`<`Customer`\> | + +#### Returns + +`Promise`<`Customer`\> + +#### Defined in + +[packages/medusa/src/services/customer.ts:209](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L209) ___ @@ -474,7 +539,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:164](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L164) +[packages/medusa/src/services/customer.ts:164](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L164) ___ @@ -498,7 +563,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -523,7 +588,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/customer.ts:300](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L300) +[packages/medusa/src/services/customer.ts:341](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L341) ___ @@ -545,7 +610,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:412](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L412) +[packages/medusa/src/services/customer.ts:453](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L453) ___ @@ -570,7 +635,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/customer.ts:360](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/customer.ts#L360) +[packages/medusa/src/services/customer.ts:401](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/customer.ts#L401) ___ @@ -594,4 +659,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/DiscountConditionService.md b/docs/content/references/services/classes/DiscountConditionService.md index e07ee6b025..c4649c39f3 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/105c68929/packages/medusa/src/services/discount-condition.ts#L37) +[packages/medusa/src/services/discount-condition.ts:37](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L37) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount-condition.ts#L31) +[packages/medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L31) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount-condition.ts#L32) +[packages/medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L32) ___ @@ -90,7 +90,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount-condition.ts#L34) +[packages/medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L34) ___ @@ -104,7 +104,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/discount-condition.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount-condition.ts#L35) +[packages/medusa/src/services/discount-condition.ts:35](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L35) ## Methods @@ -143,7 +143,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -163,7 +163,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:213](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount-condition.ts#L213) +[packages/medusa/src/services/discount-condition.ts:220](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L220) ___ @@ -183,7 +183,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:181](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount-condition.ts#L181) +[packages/medusa/src/services/discount-condition.ts:188](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L188) ___ @@ -204,7 +204,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount-condition.ts#L49) +[packages/medusa/src/services/discount-condition.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L49) ___ @@ -228,7 +228,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -249,7 +249,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:109](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount-condition.ts#L109) +[packages/medusa/src/services/discount-condition.ts:116](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L116) ___ @@ -273,7 +273,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -293,4 +293,4 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:72](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount-condition.ts#L72) +[packages/medusa/src/services/discount-condition.ts:79](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount-condition.ts#L79) diff --git a/docs/content/references/services/classes/DiscountService.md b/docs/content/references/services/classes/DiscountService.md index b2bd0435b5..699c4ed1b8 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:67](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L67) +[packages/medusa/src/services/discount.ts:68](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L68) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L54) +[packages/medusa/src/services/discount.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L55) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:58](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L58) +[packages/medusa/src/services/discount.ts:59](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L59) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:59](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L59) +[packages/medusa/src/services/discount.ts:60](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L60) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L53) +[packages/medusa/src/services/discount.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L54) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L55) +[packages/medusa/src/services/discount.ts:56](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L56) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L64) +[packages/medusa/src/services/discount.ts:65](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L65) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:65](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L65) +[packages/medusa/src/services/discount.ts:66](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L66) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:56](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L56) +[packages/medusa/src/services/discount.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L57) ___ @@ -150,7 +150,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/discount.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L50) +[packages/medusa/src/services/discount.ts:51](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L51) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:61](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L61) +[packages/medusa/src/services/discount.ts:62](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L62) ___ @@ -170,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L62) +[packages/medusa/src/services/discount.ts:63](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L63) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:63](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L63) +[packages/medusa/src/services/discount.ts:64](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L64) ___ @@ -190,7 +190,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:60](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L60) +[packages/medusa/src/services/discount.ts:61](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L61) ___ @@ -204,7 +204,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/discount.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L51) +[packages/medusa/src/services/discount.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L52) ## Methods @@ -229,7 +229,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/discount.ts:472](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L472) +[packages/medusa/src/services/discount.ts:487](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L487) ___ @@ -268,13 +268,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ ### calculateDiscountForLineItem -▸ **calculateDiscountForLineItem**(`discountId`, `lineItem`, `cart`): `Promise`<`number`\> +▸ **calculateDiscountForLineItem**(`discountId`, `lineItem`, `calculationContextData`): `Promise`<`number`\> #### Parameters @@ -282,7 +282,7 @@ ___ | :------ | :------ | | `discountId` | `string` | | `lineItem` | `LineItem` | -| `cart` | `Cart` | +| `calculationContextData` | `CalculationContextData` | #### Returns @@ -290,7 +290,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:573](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L573) +[packages/medusa/src/services/discount.ts:588](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L588) ___ @@ -311,7 +311,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:735](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L735) +[packages/medusa/src/services/discount.ts:762](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L762) ___ @@ -336,7 +336,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/discount.ts:185](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L185) +[packages/medusa/src/services/discount.ts:186](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L186) ___ @@ -361,7 +361,7 @@ the newly created dynamic code #### Defined in -[packages/medusa/src/services/discount.ts:400](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L400) +[packages/medusa/src/services/discount.ts:415](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L415) ___ @@ -385,7 +385,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/discount.ts:532](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L532) +[packages/medusa/src/services/discount.ts:547](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L547) ___ @@ -410,7 +410,7 @@ the newly created dynamic code #### Defined in -[packages/medusa/src/services/discount.ts:451](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L451) +[packages/medusa/src/services/discount.ts:466](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L466) ___ @@ -430,7 +430,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:704](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L704) +[packages/medusa/src/services/discount.ts:731](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L731) ___ @@ -450,7 +450,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:700](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L700) +[packages/medusa/src/services/discount.ts:727](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L727) ___ @@ -470,7 +470,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:694](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L694) +[packages/medusa/src/services/discount.ts:721](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L721) ___ @@ -490,7 +490,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:712](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L712) +[packages/medusa/src/services/discount.ts:739](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L739) ___ @@ -511,7 +511,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:716](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L716) +[packages/medusa/src/services/discount.ts:743](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L743) ___ @@ -534,7 +534,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/discount.ts:123](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L123) +[packages/medusa/src/services/discount.ts:124](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L124) ___ @@ -557,7 +557,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/discount.ts:139](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L139) +[packages/medusa/src/services/discount.ts:140](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L140) ___ @@ -582,7 +582,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/discount.ts:507](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L507) +[packages/medusa/src/services/discount.ts:522](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L522) ___ @@ -607,7 +607,7 @@ the discount #### Defined in -[packages/medusa/src/services/discount.ts:244](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L244) +[packages/medusa/src/services/discount.ts:252](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L252) ___ @@ -632,7 +632,7 @@ the discount document #### Defined in -[packages/medusa/src/services/discount.ts:270](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L270) +[packages/medusa/src/services/discount.ts:285](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L285) ___ @@ -656,7 +656,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -681,7 +681,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/discount.ts:303](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L303) +[packages/medusa/src/services/discount.ts:318](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L318) ___ @@ -702,7 +702,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:634](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L634) +[packages/medusa/src/services/discount.ts:661](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L661) ___ @@ -723,7 +723,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:546](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L546) +[packages/medusa/src/services/discount.ts:561](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L561) ___ @@ -753,7 +753,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/discount.ts:105](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/discount.ts#L105) +[packages/medusa/src/services/discount.ts:106](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/discount.ts#L106) ___ @@ -777,4 +777,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/DraftOrderService.md b/docs/content/references/services/classes/DraftOrderService.md index 8169eaafb2..4066259b3a 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:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L54) +[packages/medusa/src/services/draft-order.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L54) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L48) +[packages/medusa/src/services/draft-order.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L48) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L52) +[packages/medusa/src/services/draft-order.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L52) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L44) +[packages/medusa/src/services/draft-order.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L44) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L47) +[packages/medusa/src/services/draft-order.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L47) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L49) +[packages/medusa/src/services/draft-order.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L49) ___ @@ -120,7 +120,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/draft-order.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L41) +[packages/medusa/src/services/draft-order.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L41) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L46) +[packages/medusa/src/services/draft-order.ts:46](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L46) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L45) +[packages/medusa/src/services/draft-order.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L45) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L50) +[packages/medusa/src/services/draft-order.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L50) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L51) +[packages/medusa/src/services/draft-order.ts:51](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L51) ___ @@ -174,7 +174,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/draft-order.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L42) +[packages/medusa/src/services/draft-order.ts:42](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L42) ___ @@ -191,7 +191,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L36) +[packages/medusa/src/services/draft-order.ts:36](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L36) ## Methods @@ -230,7 +230,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -254,7 +254,7 @@ the created draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:241](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L241) +[packages/medusa/src/services/draft-order.ts:248](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L248) ___ @@ -278,7 +278,7 @@ empty promise #### Defined in -[packages/medusa/src/services/draft-order.ts:140](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L140) +[packages/medusa/src/services/draft-order.ts:147](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L147) ___ @@ -303,7 +303,7 @@ list of draft orders #### Defined in -[packages/medusa/src/services/draft-order.ts:218](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L218) +[packages/medusa/src/services/draft-order.ts:225](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L225) ___ @@ -328,7 +328,7 @@ draft orders #### Defined in -[packages/medusa/src/services/draft-order.ts:164](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L164) +[packages/medusa/src/services/draft-order.ts:171](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L171) ___ @@ -353,13 +353,13 @@ the created order #### Defined in -[packages/medusa/src/services/draft-order.ts:366](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L366) +[packages/medusa/src/services/draft-order.ts:372](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L372) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`DraftOrder`\> +▸ **retrieve**(`draftOrderId`, `config?`): `Promise`<`DraftOrder`\> Retrieves a draft order with the given id. @@ -367,7 +367,7 @@ Retrieves a draft order with the given id. | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `string` | id of the draft order to retrieve | +| `draftOrderId` | `string` | id of the draft order to retrieve | | `config` | `FindConfig`<`DraftOrder`\> | query object for findOne | #### Returns @@ -378,7 +378,7 @@ the draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:87](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L87) +[packages/medusa/src/services/draft-order.ts:87](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L87) ___ @@ -403,7 +403,7 @@ the draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:114](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L114) +[packages/medusa/src/services/draft-order.ts:121](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L121) ___ @@ -427,7 +427,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -453,7 +453,7 @@ the updated draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:395](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/draft-order.ts#L395) +[packages/medusa/src/services/draft-order.ts:401](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/draft-order.ts#L401) ___ @@ -477,4 +477,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/EventBusService.md b/docs/content/references/services/classes/EventBusService.md index e16bf008a5..964dfe3e6a 100644 --- a/docs/content/references/services/classes/EventBusService.md +++ b/docs/content/references/services/classes/EventBusService.md @@ -19,7 +19,7 @@ subscribers when events happen. Events will run asynchronously. #### Defined in -[packages/medusa/src/services/event-bus.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L47) +[packages/medusa/src/services/event-bus.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L48) ## Properties @@ -29,27 +29,7 @@ subscribers when events happen. Events will run asynchronously. #### Defined in -[packages/medusa/src/services/event-bus.ts:33](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L33) - -___ - -### cronHandlers\_ - -• `Protected` `Readonly` **cronHandlers\_**: `Map`<`string` \| `symbol`, `Subscriber`<`unknown`\>[]\> - -#### Defined in - -[packages/medusa/src/services/event-bus.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L38) - -___ - -### cronQueue\_ - -• `Protected` `Readonly` **cronQueue\_**: `Bull` - -#### Defined in - -[packages/medusa/src/services/event-bus.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L41) +[packages/medusa/src/services/event-bus.ts:35](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L35) ___ @@ -59,7 +39,17 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L45) +[packages/medusa/src/services/event-bus.ts:46](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L46) + +___ + +### jobSchedulerService\_ + +• `Protected` `Readonly` **jobSchedulerService\_**: `default` + +#### Defined in + +[packages/medusa/src/services/event-bus.ts:39](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L39) ___ @@ -69,7 +59,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L35) +[packages/medusa/src/services/event-bus.ts:37](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L37) ___ @@ -79,7 +69,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L34) +[packages/medusa/src/services/event-bus.ts:36](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L36) ___ @@ -89,7 +79,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L37) +[packages/medusa/src/services/event-bus.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L40) ___ @@ -99,7 +89,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L42) +[packages/medusa/src/services/event-bus.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L43) ___ @@ -109,7 +99,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L39) +[packages/medusa/src/services/event-bus.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L41) ___ @@ -119,7 +109,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L40) +[packages/medusa/src/services/event-bus.ts:42](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L42) ___ @@ -129,7 +119,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L43) +[packages/medusa/src/services/event-bus.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L44) ___ @@ -139,7 +129,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L36) +[packages/medusa/src/services/event-bus.ts:38](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L38) ___ @@ -149,7 +139,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L44) +[packages/medusa/src/services/event-bus.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L45) ## Methods @@ -159,6 +149,10 @@ ___ Registers a cron job. +**`Deprecated`** + +All cron job logic has been refactored to the `JobSchedulerService`. This method will be removed in a future release. + #### Type parameters | Name | @@ -182,40 +176,7 @@ void #### Defined in -[packages/medusa/src/services/event-bus.ts:323](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L323) - -___ - -### cronWorker\_ - -▸ **cronWorker_**<`T`\>(`job`): `Promise`<`unknown`[]\> - -Handles incoming jobs. - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `job` | `Object` | The job object | -| `job.data` | `Object` | - | -| `job.data.data` | `T` | - | -| `job.data.eventName` | `string` | - | - -#### Returns - -`Promise`<`unknown`[]\> - -resolves to the results of the subscriber calls. - -#### Defined in - -[packages/medusa/src/services/event-bus.ts:296](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L296) +[packages/medusa/src/services/event-bus.ts:279](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L279) ___ @@ -247,7 +208,7 @@ the job from our queue #### Defined in -[packages/medusa/src/services/event-bus.ts:188](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L188) +[packages/medusa/src/services/event-bus.ts:167](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L167) ___ @@ -261,32 +222,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:230](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L230) - -___ - -### registerCronHandler\_ - -▸ `Protected` **registerCronHandler_**(`event`, `subscriber`): [`EventBusService`](EventBusService.md) - -Adds a function to a 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. | - -#### Returns - -[`EventBusService`](EventBusService.md) - -this - -#### Defined in - -[packages/medusa/src/services/event-bus.ts:167](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L167) +[packages/medusa/src/services/event-bus.ts:209](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L209) ___ @@ -300,7 +236,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:220](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L220) +[packages/medusa/src/services/event-bus.ts:199](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L199) ___ @@ -314,7 +250,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:225](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L225) +[packages/medusa/src/services/event-bus.ts:204](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L204) ___ @@ -339,7 +275,7 @@ this #### Defined in -[packages/medusa/src/services/event-bus.ts:127](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L127) +[packages/medusa/src/services/event-bus.ts:127](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L127) ___ @@ -364,7 +300,7 @@ this #### Defined in -[packages/medusa/src/services/event-bus.ts:145](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L145) +[packages/medusa/src/services/event-bus.ts:145](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L145) ___ @@ -384,7 +320,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:97](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L97) +[packages/medusa/src/services/event-bus.ts:96](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L96) ___ @@ -417,4 +353,4 @@ resolves to the results of the subscriber calls. #### Defined in -[packages/medusa/src/services/event-bus.ts:265](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/event-bus.ts#L265) +[packages/medusa/src/services/event-bus.ts:244](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/event-bus.ts#L244) diff --git a/docs/content/references/services/classes/FulfillmentProviderService.md b/docs/content/references/services/classes/FulfillmentProviderService.md index 99c13cd44e..2ab5fd7132 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:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L42) +[packages/medusa/src/services/fulfillment-provider.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L38) +[packages/medusa/src/services/fulfillment-provider.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L43) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L40) +[packages/medusa/src/services/fulfillment-provider.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L45) ___ @@ -88,7 +88,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L35) +[packages/medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L40) ___ @@ -102,7 +102,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L36) +[packages/medusa/src/services/fulfillment-provider.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L41) ## Methods @@ -141,7 +141,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -163,7 +163,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:146](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L146) +[packages/medusa/src/services/fulfillment-provider.ts:151](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L151) ___ @@ -175,7 +175,7 @@ ___ | Name | Type | | :------ | :------ | -| `option` | `ShippingOption` | +| `option` | `CalculateOptionPriceInput` | #### Returns @@ -183,7 +183,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:121](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L121) +[packages/medusa/src/services/fulfillment-provider.ts:126](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L126) ___ @@ -203,7 +203,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:139](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L139) +[packages/medusa/src/services/fulfillment-provider.ts:144](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L144) ___ @@ -226,7 +226,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:106](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L106) +[packages/medusa/src/services/fulfillment-provider.ts:111](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L111) ___ @@ -246,7 +246,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:164](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L164) +[packages/medusa/src/services/fulfillment-provider.ts:169](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L169) ___ @@ -260,7 +260,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:66](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L66) +[packages/medusa/src/services/fulfillment-provider.ts:71](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L71) ___ @@ -280,7 +280,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:74](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L74) +[packages/medusa/src/services/fulfillment-provider.ts:79](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L79) ___ @@ -300,7 +300,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L52) +[packages/medusa/src/services/fulfillment-provider.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L57) ___ @@ -326,7 +326,7 @@ document to fetch #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:183](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L183) +[packages/medusa/src/services/fulfillment-provider.ts:188](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L188) ___ @@ -348,7 +348,7 @@ the payment fulfillment provider #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:95](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L95) +[packages/medusa/src/services/fulfillment-provider.ts:100](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L100) ___ @@ -372,7 +372,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -394,7 +394,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:126](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L126) +[packages/medusa/src/services/fulfillment-provider.ts:131](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L131) ___ @@ -414,7 +414,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:159](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment-provider.ts#L159) +[packages/medusa/src/services/fulfillment-provider.ts:164](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment-provider.ts#L164) ___ @@ -438,4 +438,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/FulfillmentService.md b/docs/content/references/services/classes/FulfillmentService.md index f17097e452..166bb05f1d 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:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L47) +[packages/medusa/src/services/fulfillment.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L42) +[packages/medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L42) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L43) +[packages/medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L43) ___ @@ -84,7 +84,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L45) +[packages/medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L45) ___ @@ -94,7 +94,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L40) +[packages/medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L40) ___ @@ -108,7 +108,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/fulfillment.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L36) +[packages/medusa/src/services/fulfillment.ts:36](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L36) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L41) +[packages/medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L41) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L39) +[packages/medusa/src/services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L39) ___ @@ -138,7 +138,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L44) +[packages/medusa/src/services/fulfillment.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L44) ___ @@ -152,7 +152,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L37) +[packages/medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L37) ## Methods @@ -191,7 +191,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -217,7 +217,7 @@ the result of the save operation #### Defined in -[packages/medusa/src/services/fulfillment.ts:253](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L253) +[packages/medusa/src/services/fulfillment.ts:260](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L260) ___ @@ -246,7 +246,7 @@ the created fulfillments #### Defined in -[packages/medusa/src/services/fulfillment.ts:198](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L198) +[packages/medusa/src/services/fulfillment.ts:205](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L205) ___ @@ -273,7 +273,7 @@ the shipped fulfillment #### Defined in -[packages/medusa/src/services/fulfillment.ts:303](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L303) +[packages/medusa/src/services/fulfillment.ts:310](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L310) ___ @@ -298,7 +298,7 @@ the line items generated by the transformer. #### Defined in -[packages/medusa/src/services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L109) +[packages/medusa/src/services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L109) ___ @@ -319,13 +319,13 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:71](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L71) +[packages/medusa/src/services/fulfillment.ts:71](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L71) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`Fulfillment`\> +▸ **retrieve**(`fulfillmentId`, `config?`): `Promise`<`Fulfillment`\> Retrieves a fulfillment by its id. @@ -333,7 +333,7 @@ Retrieves a fulfillment by its id. | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `string` | the id of the fulfillment to retrieve | +| `fulfillmentId` | `string` | the id of the fulfillment to retrieve | | `config` | `FindConfig`<`Fulfillment`\> | optional values to include with fulfillmentRepository query | #### Returns @@ -344,7 +344,7 @@ the fulfillment #### Defined in -[packages/medusa/src/services/fulfillment.ts:166](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L166) +[packages/medusa/src/services/fulfillment.ts:166](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L166) ___ @@ -368,7 +368,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -397,7 +397,7 @@ a line item that has the requested fulfillment quantity #### Defined in -[packages/medusa/src/services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/fulfillment.ts#L134) +[packages/medusa/src/services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/fulfillment.ts#L134) ___ @@ -421,4 +421,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/GiftCardService.md b/docs/content/references/services/classes/GiftCardService.md index 4ecdde2ab9..a052ba1702 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/105c68929/packages/medusa/src/services/gift-card.ts#L47) +[packages/medusa/src/services/gift-card.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L38) +[packages/medusa/src/services/gift-card.ts:38](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L38) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L34) +[packages/medusa/src/services/gift-card.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L34) ___ @@ -84,7 +84,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L36) +[packages/medusa/src/services/gift-card.ts:36](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L36) ___ @@ -98,7 +98,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/gift-card.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L40) +[packages/medusa/src/services/gift-card.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L40) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L37) +[packages/medusa/src/services/gift-card.ts:37](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L37) ___ @@ -122,7 +122,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/gift-card.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L41) +[packages/medusa/src/services/gift-card.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L41) ___ @@ -138,7 +138,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L43) +[packages/medusa/src/services/gift-card.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L43) ## Methods @@ -177,7 +177,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -201,7 +201,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/gift-card.ts:153](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L153) +[packages/medusa/src/services/gift-card.ts:153](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L153) ___ @@ -221,7 +221,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:138](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L138) +[packages/medusa/src/services/gift-card.ts:138](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L138) ___ @@ -245,7 +245,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/gift-card.ts:283](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L283) +[packages/medusa/src/services/gift-card.ts:322](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L322) ___ @@ -268,7 +268,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/gift-card.ts:114](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L114) +[packages/medusa/src/services/gift-card.ts:114](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L114) ___ @@ -291,7 +291,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/gift-card.ts:85](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L85) +[packages/medusa/src/services/gift-card.ts:85](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L85) ___ @@ -316,7 +316,7 @@ the gift card #### Defined in -[packages/medusa/src/services/gift-card.ts:217](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L217) +[packages/medusa/src/services/gift-card.ts:242](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L242) ___ @@ -337,7 +337,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:224](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L224) +[packages/medusa/src/services/gift-card.ts:256](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L256) ___ @@ -358,7 +358,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:183](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L183) +[packages/medusa/src/services/gift-card.ts:208](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L208) ___ @@ -382,7 +382,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -407,7 +407,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/gift-card.ts:237](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L237) +[packages/medusa/src/services/gift-card.ts:276](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L276) ___ @@ -431,7 +431,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -449,4 +449,30 @@ the generated gift card code #### Defined in -[packages/medusa/src/services/gift-card.ts:69](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/gift-card.ts#L69) +[packages/medusa/src/services/gift-card.ts:69](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L69) + +___ + +### resolveTaxRate + +▸ `Static` `Protected` **resolveTaxRate**(`giftCardTaxRate`, `region`): ``null`` \| `number` + +The tax_rate of the giftcard can depend on whether regions tax gift cards, an input +provided by the user or the tax rate. Based on these conditions, tax_rate changes. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `giftCardTaxRate` | ``null`` \| `number` | +| `region` | `Region` | + +#### Returns + +``null`` \| `number` + +the tax rate for the gift card + +#### Defined in + +[packages/medusa/src/services/gift-card.ts:189](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/gift-card.ts#L189) diff --git a/docs/content/references/services/classes/IdempotencyKeyService.md b/docs/content/references/services/classes/IdempotencyKeyService.md index 228eb35cb9..228080f829 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/105c68929/packages/medusa/src/services/idempotency-key.ts#L25) +[packages/medusa/src/services/idempotency-key.ts:25](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/idempotency-key.ts#L23) +[packages/medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/idempotency-key.ts#L23) ___ @@ -76,7 +76,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/idempotency-key.ts:20](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/idempotency-key.ts#L20) +[packages/medusa/src/services/idempotency-key.ts:20](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/idempotency-key.ts#L20) ___ @@ -90,7 +90,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/idempotency-key.ts:21](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/idempotency-key.ts#L21) +[packages/medusa/src/services/idempotency-key.ts:21](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/idempotency-key.ts#L21) ## Methods @@ -129,7 +129,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -155,7 +155,7 @@ the created idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:67](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/idempotency-key.ts#L67) +[packages/medusa/src/services/idempotency-key.ts:67](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/idempotency-key.ts#L67) ___ @@ -182,7 +182,7 @@ the existing or created idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/idempotency-key.ts#L41) +[packages/medusa/src/services/idempotency-key.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/idempotency-key.ts#L41) ___ @@ -206,7 +206,7 @@ result of the update operation #### Defined in -[packages/medusa/src/services/idempotency-key.ts:109](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/idempotency-key.ts#L109) +[packages/medusa/src/services/idempotency-key.ts:116](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/idempotency-key.ts#L116) ___ @@ -230,7 +230,7 @@ idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:85](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/idempotency-key.ts#L85) +[packages/medusa/src/services/idempotency-key.ts:85](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/idempotency-key.ts#L85) ___ @@ -254,7 +254,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -289,7 +289,7 @@ result of the update operation #### Defined in -[packages/medusa/src/services/idempotency-key.ts:138](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/idempotency-key.ts#L138) +[packages/medusa/src/services/idempotency-key.ts:145](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/idempotency-key.ts#L145) ___ @@ -313,7 +313,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -342,4 +342,4 @@ new updated idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:167](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/idempotency-key.ts#L167) +[packages/medusa/src/services/idempotency-key.ts:174](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/idempotency-key.ts#L174) diff --git a/docs/content/references/services/classes/InventoryService.md b/docs/content/references/services/classes/InventoryService.md index 26cec8c97f..b75693dd2b 100644 --- a/docs/content/references/services/classes/InventoryService.md +++ b/docs/content/references/services/classes/InventoryService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/inventory.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/inventory.ts#L18) +[packages/medusa/src/services/inventory.ts:18](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/inventory.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/inventory.ts:15](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/inventory.ts#L15) +[packages/medusa/src/services/inventory.ts:15](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/inventory.ts#L15) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/inventory.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/inventory.ts#L13) +[packages/medusa/src/services/inventory.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/inventory.ts#L13) ___ @@ -90,7 +90,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/inventory.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/inventory.ts#L16) +[packages/medusa/src/services/inventory.ts:16](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/inventory.ts#L16) ## Methods @@ -115,7 +115,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/inventory.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/inventory.ts#L31) +[packages/medusa/src/services/inventory.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/inventory.ts#L31) ___ @@ -154,7 +154,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -181,7 +181,7 @@ true if the inventory covers the quantity #### Defined in -[packages/medusa/src/services/inventory.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/inventory.ts#L64) +[packages/medusa/src/services/inventory.ts:64](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/inventory.ts#L64) ___ @@ -205,7 +205,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -229,4 +229,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/LineItemAdjustmentService.md b/docs/content/references/services/classes/LineItemAdjustmentService.md index 6f956098e5..6455df92a0 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:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L44) +[packages/medusa/src/services/line-item-adjustment.ts:39](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L42) +[packages/medusa/src/services/line-item-adjustment.ts:37](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L37) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L41) +[packages/medusa/src/services/line-item-adjustment.ts:36](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L36) ___ @@ -88,7 +88,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L38) +[packages/medusa/src/services/line-item-adjustment.ts:33](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L33) ___ @@ -102,7 +102,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L39) +[packages/medusa/src/services/line-item-adjustment.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L34) ## Methods @@ -141,7 +141,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -165,7 +165,7 @@ line item adjustment #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:88](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L88) +[packages/medusa/src/services/line-item-adjustment.ts:90](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L90) ___ @@ -190,7 +190,7 @@ a line item adjustment or undefined if no adjustment was created #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:255](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L255) +[packages/medusa/src/services/line-item-adjustment.ts:255](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L255) ___ @@ -216,7 +216,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:283](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L283) +[packages/medusa/src/services/line-item-adjustment.ts:283](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L283) ___ @@ -240,13 +240,13 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:153](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L153) +[packages/medusa/src/services/line-item-adjustment.ts:155](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L155) ___ ### generateAdjustments -▸ **generateAdjustments**(`cart`, `generatedLineItem`, `context`): `Promise`<`GeneratedAdjustment`[]\> +▸ **generateAdjustments**(`calculationContextData`, `generatedLineItem`, `context`): `Promise`<`GeneratedAdjustment`[]\> Creates adjustment for a line item @@ -254,7 +254,7 @@ Creates adjustment for a line item | Name | Type | Description | | :------ | :------ | :------ | -| `cart` | `Cart` | the cart object holding discounts | +| `calculationContextData` | `CalculationContextData` | the calculationContextData object holding discounts | | `generatedLineItem` | `LineItem` | the line item for which a line item adjustment might be created | | `context` | `AdjustmentContext` | the line item for which a line item adjustment might be created | @@ -266,7 +266,7 @@ a line item adjustment or undefined if no adjustment was created #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:182](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L182) +[packages/medusa/src/services/line-item-adjustment.ts:184](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L184) ___ @@ -291,13 +291,13 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:136](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L136) +[packages/medusa/src/services/line-item-adjustment.ts:138](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L138) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`LineItemAdjustment`\> +▸ **retrieve**(`lineItemAdjustmentId`, `config?`): `Promise`<`LineItemAdjustment`\> Retrieves a line item adjustment by id. @@ -305,7 +305,7 @@ Retrieves a line item adjustment by id. | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `string` | the id of the line item adjustment to retrieve | +| `lineItemAdjustmentId` | `string` | the id of the line item adjustment to retrieve | | `config` | `FindConfig`<`LineItemAdjustment`\> | the config to retrieve the line item adjustment by | #### Returns @@ -316,7 +316,7 @@ the line item adjustment. #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:63](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L63) +[packages/medusa/src/services/line-item-adjustment.ts:58](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L58) ___ @@ -340,7 +340,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -365,7 +365,7 @@ line item adjustment #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:105](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item-adjustment.ts#L105) +[packages/medusa/src/services/line-item-adjustment.ts:107](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item-adjustment.ts#L107) ___ @@ -389,4 +389,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/LineItemService.md b/docs/content/references/services/classes/LineItemService.md index 5a27ebb5a6..d46d429616 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:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L53) +[packages/medusa/src/services/line-item.ts:60](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L60) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L44) +[packages/medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L51) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L49) +[packages/medusa/src/services/line-item.ts:56](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L56) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L43) +[packages/medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L50) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L50) +[packages/medusa/src/services/line-item.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L57) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L42) +[packages/medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L49) ___ @@ -116,7 +116,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/line-item.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L39) +[packages/medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L46) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L47) +[packages/medusa/src/services/line-item.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L54) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L46) +[packages/medusa/src/services/line-item.ts:53](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L53) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L45) +[packages/medusa/src/services/line-item.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L52) ___ @@ -156,7 +156,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L48) +[packages/medusa/src/services/line-item.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L55) ___ @@ -166,7 +166,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L51) +[packages/medusa/src/services/line-item.ts:58](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L58) ___ @@ -180,7 +180,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/line-item.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L40) +[packages/medusa/src/services/line-item.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L47) ## Methods @@ -219,7 +219,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -283,31 +283,38 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:397](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L397) +[packages/medusa/src/services/line-item.ts:488](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L488) ___ ### create -▸ **create**(`data`): `Promise`<`LineItem`\> +▸ **create**<`T`, `TResult`\>(`data`): `Promise`<`TResult`\> Create a line item +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `LineItem` \| `LineItem`[] | +| `TResult` | `T` extends `LineItem` ? `LineItem` : `LineItem`[] | + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `data` | `Partial`<`LineItem`\> | the line item object to create | +| `data` | `T` | the line item object to create | #### Returns -`Promise`<`LineItem`\> +`Promise`<`TResult`\> the created line item #### Defined in -[packages/medusa/src/services/line-item.ts:281](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L281) +[packages/medusa/src/services/line-item.ts:369](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L369) ___ @@ -333,7 +340,7 @@ the created line items #### Defined in -[packages/medusa/src/services/line-item.ts:128](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L128) +[packages/medusa/src/services/line-item.ts:135](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L135) ___ @@ -366,7 +373,7 @@ a new line item tax line #### Defined in -[packages/medusa/src/services/line-item.ts:389](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L389) +[packages/medusa/src/services/line-item.ts:480](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L480) ___ @@ -390,7 +397,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/line-item.ts:349](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L349) +[packages/medusa/src/services/line-item.ts:440](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L440) ___ @@ -414,28 +421,61 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/line-item.ts:368](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L368) +[packages/medusa/src/services/line-item.ts:459](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L459) ___ ### generate -▸ **generate**(`variantId`, `regionId`, `quantity`, `context?`): `Promise`<`LineItem`\> +▸ **generate**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`, `context?`): `Promise`<`TResult`\> + +Generate a single or multiple line item without persisting the data into the db + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `string` \| `GenerateInputData` \| `GenerateInputData`[] | +| `TResult` | `T` extends `string` ? `LineItem` : `T` extends `LineItem` ? `LineItem` : `LineItem`[] | #### Parameters | Name | Type | | :------ | :------ | -| `variantId` | `string` | -| `regionId` | `string` | +| `variantIdOrData` | `string` \| `T` | +| `regionIdOrContext` | `T` extends `string` ? `string` : `GenerateLineItemContext` | +| `quantity?` | `number` | +| `context` | `GenerateLineItemContext` | + +#### Returns + +`Promise`<`TResult`\> + +#### Defined in + +[packages/medusa/src/services/line-item.ts:195](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L195) + +___ + +### generateLineItem + +▸ `Protected` **generateLineItem**(`variant`, `quantity`, `context`): `Promise`<`LineItem`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `variant` | `Object` | +| `variant.id` | `string` | +| `variant.product` | `Object` | +| `variant.product.discountable` | `boolean` | +| `variant.product.is_giftcard` | `boolean` | +| `variant.product.thumbnail` | ``null`` \| `string` | +| `variant.product.title` | `string` | +| `variant.product_id` | `string` | +| `variant.title` | `string` | | `quantity` | `number` | -| `context` | `Object` | -| `context.cart?` | `Cart` | -| `context.customer_id?` | `string` | -| `context.includes_tax?` | `boolean` | -| `context.metadata?` | `Record`<`string`, `unknown`\> | -| `context.order_edit_id?` | `string` | -| `context.unit_price?` | `number` | +| `context` | `GenerateLineItemContext` & { `variantPricing`: `ProductVariantPricing` } | #### Returns @@ -443,7 +483,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:181](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L181) +[packages/medusa/src/services/line-item.ts:298](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L298) ___ @@ -464,7 +504,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:81](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L81) +[packages/medusa/src/services/line-item.ts:88](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L88) ___ @@ -489,7 +529,7 @@ the line item #### Defined in -[packages/medusa/src/services/line-item.ts:101](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L101) +[packages/medusa/src/services/line-item.ts:108](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L108) ___ @@ -513,7 +553,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -538,7 +578,36 @@ the updated line item(s) #### Defined in -[packages/medusa/src/services/line-item.ts:300](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/line-item.ts#L300) +[packages/medusa/src/services/line-item.ts:397](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L397) + +___ + +### validateGenerateArguments + +▸ `Protected` **validateGenerateArguments**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`): `void` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `string` \| `GenerateInputData` \| `GenerateInputData`[] | +| `TResult` | `T` extends `string` ? `LineItem` : `T` extends `LineItem` ? `LineItem` : `LineItem`[] | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `variantIdOrData` | `string` \| `T` | +| `regionIdOrContext` | `T` extends `string` ? `string` : `GenerateLineItemContext` | +| `quantity?` | `number` | + +#### Returns + +`void` + +#### Defined in + +[packages/medusa/src/services/line-item.ts:559](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/line-item.ts#L559) ___ @@ -562,4 +631,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/MiddlewareService.md b/docs/content/references/services/classes/MiddlewareService.md index bc79bf6539..01b85e1715 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/105c68929/packages/medusa/src/services/middleware.ts#L22) +[packages/medusa/src/services/middleware.ts:22](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L17) +[packages/medusa/src/services/middleware.ts:17](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L18) +[packages/medusa/src/services/middleware.ts:18](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L19) +[packages/medusa/src/services/middleware.ts:19](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L20) +[packages/medusa/src/services/middleware.ts:20](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L60) +[packages/medusa/src/services/middleware.ts:60](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L79) +[packages/medusa/src/services/middleware.ts:79](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L96) +[packages/medusa/src/services/middleware.ts:96](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L29) +[packages/medusa/src/services/middleware.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L34) +[packages/medusa/src/services/middleware.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L106) +[packages/medusa/src/services/middleware.ts:106](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L117) +[packages/medusa/src/services/middleware.ts:117](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L123) +[packages/medusa/src/services/middleware.ts:123](https://github.com/medusajs/medusa/blob/d843bc102/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/105c68929/packages/medusa/src/services/middleware.ts#L43) +[packages/medusa/src/services/middleware.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/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 65df09d705..d07737c4e2 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:61](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L61) +[packages/medusa/src/services/new-totals.ts:68](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L68) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:58](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L58) +[packages/medusa/src/services/new-totals.ts:65](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L65) ___ @@ -76,7 +76,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/new-totals.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L54) +[packages/medusa/src/services/new-totals.ts:61](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L61) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:59](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L59) +[packages/medusa/src/services/new-totals.ts:66](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L66) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:57](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L57) +[packages/medusa/src/services/new-totals.ts:64](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L64) ___ @@ -110,7 +110,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/new-totals.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L55) +[packages/medusa/src/services/new-totals.ts:62](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L62) ## Methods @@ -149,7 +149,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -165,7 +165,7 @@ Calculate and return the gift cards totals | :------ | :------ | | `giftCardableAmount` | `number` | | `__namedParameters` | `Object` | -| `__namedParameters.giftCardTransactions?` | { `amount`: `number` ; `is_taxable`: ``null`` \| `boolean` ; `tax_rate`: ``null`` \| `number` }[] | +| `__namedParameters.giftCardTransactions?` | `GiftCardTransaction`[] | | `__namedParameters.giftCards?` | `GiftCard`[] | | `__namedParameters.region` | `Region` | @@ -175,7 +175,7 @@ Calculate and return the gift cards totals #### Defined in -[packages/medusa/src/services/new-totals.ts:446](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L446) +[packages/medusa/src/services/new-totals.ts:455](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L455) ___ @@ -190,7 +190,7 @@ Calculate and return the gift cards totals based on their transactions | Name | Type | | :------ | :------ | | `__namedParameters` | `Object` | -| `__namedParameters.giftCardTransactions` | { `amount`: `number` ; `is_taxable`: ``null`` \| `boolean` ; `tax_rate`: ``null`` \| `number` }[] | +| `__namedParameters.giftCardTransactions` | `GiftCardTransaction`[] | | `__namedParameters.region` | `Object` | | `__namedParameters.region.gift_cards_taxable` | `boolean` | | `__namedParameters.region.tax_rate` | `number` | @@ -206,7 +206,7 @@ Calculate and return the gift cards totals based on their transactions #### Defined in -[packages/medusa/src/services/new-totals.ts:504](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L504) +[packages/medusa/src/services/new-totals.ts:534](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L534) ___ @@ -236,7 +236,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/105c68929/packages/medusa/src/services/new-totals.ts#L331) +[packages/medusa/src/services/new-totals.ts:340](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L340) ___ @@ -263,7 +263,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:401](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L401) +[packages/medusa/src/services/new-totals.ts:410](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L410) ___ @@ -289,7 +289,7 @@ Calculate and return the items totals for either the legacy calculation or the n #### Defined in -[packages/medusa/src/services/new-totals.ts:82](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L82) +[packages/medusa/src/services/new-totals.ts:90](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L90) ___ @@ -317,7 +317,7 @@ Calculate and return the legacy calculated totals using the tax rate #### Defined in -[packages/medusa/src/services/new-totals.ts:254](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L254) +[packages/medusa/src/services/new-totals.ts:263](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L263) ___ @@ -346,7 +346,7 @@ Calculate and return the totals for an item #### Defined in -[packages/medusa/src/services/new-totals.ts:150](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L150) +[packages/medusa/src/services/new-totals.ts:158](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L158) ___ @@ -373,7 +373,7 @@ Calculate and return the shipping methods totals for either the legacy calculati #### Defined in -[packages/medusa/src/services/new-totals.ts:549](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L549) +[packages/medusa/src/services/new-totals.ts:580](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L580) ___ @@ -399,7 +399,7 @@ Calculate and return the shipping method totals legacy using teh tax rate #### Defined in -[packages/medusa/src/services/new-totals.ts:707](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L707) +[packages/medusa/src/services/new-totals.ts:738](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L738) ___ @@ -426,7 +426,7 @@ Calculate and return the shipping method totals #### Defined in -[packages/medusa/src/services/new-totals.ts:624](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/new-totals.ts#L624) +[packages/medusa/src/services/new-totals.ts:655](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/new-totals.ts#L655) ___ @@ -450,7 +450,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -474,4 +474,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/NoteService.md b/docs/content/references/services/classes/NoteService.md index 6b790e6d9f..f7cd991079 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/105c68929/packages/medusa/src/services/note.ts#L29) +[packages/medusa/src/services/note.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/note.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L27) +[packages/medusa/src/services/note.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L27) ___ @@ -76,7 +76,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/note.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L24) +[packages/medusa/src/services/note.ts:24](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L24) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/note.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L26) +[packages/medusa/src/services/note.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L26) ___ @@ -100,7 +100,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L25) +[packages/medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L25) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/note.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L18) +[packages/medusa/src/services/note.ts:18](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L18) ## Methods @@ -157,7 +157,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -183,7 +183,7 @@ resolves to the creation result #### Defined in -[packages/medusa/src/services/note.ts:96](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L96) +[packages/medusa/src/services/note.ts:103](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L103) ___ @@ -205,7 +205,7 @@ Deletes a given note #### Defined in -[packages/medusa/src/services/note.ts:154](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L154) +[packages/medusa/src/services/note.ts:161](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L161) ___ @@ -230,13 +230,13 @@ notes related to the given search. #### Defined in -[packages/medusa/src/services/note.ts:75](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L75) +[packages/medusa/src/services/note.ts:82](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L82) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`Note`\> +▸ **retrieve**(`noteId`, `config?`): `Promise`<`Note`\> Retrieves a specific note. @@ -244,7 +244,7 @@ Retrieves a specific note. | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `string` | the id of the note to retrieve. | +| `noteId` | `string` | the id of the note to retrieve. | | `config` | `FindConfig`<`Note`\> | any options needed to query for the result. | #### Returns @@ -255,7 +255,7 @@ which resolves to the requested note. #### Defined in -[packages/medusa/src/services/note.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L47) +[packages/medusa/src/services/note.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L47) ___ @@ -279,7 +279,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -304,7 +304,7 @@ resolves to the updated element #### Defined in -[packages/medusa/src/services/note.ts:132](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/note.ts#L132) +[packages/medusa/src/services/note.ts:139](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/note.ts#L139) ___ @@ -328,4 +328,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/NotificationService.md b/docs/content/references/services/classes/NotificationService.md index 1bcaa1d396..c98d55bf1c 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/105c68929/packages/medusa/src/services/notification.ts#L36) +[packages/medusa/src/services/notification.ts:36](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L27) +[packages/medusa/src/services/notification.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L27) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L28) +[packages/medusa/src/services/notification.ts:28](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L28) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L31) +[packages/medusa/src/services/notification.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L31) ___ @@ -96,7 +96,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/notification.ts:23](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L23) +[packages/medusa/src/services/notification.ts:23](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L23) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L34) +[packages/medusa/src/services/notification.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L34) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:32](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L32) +[packages/medusa/src/services/notification.ts:32](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L32) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L26) +[packages/medusa/src/services/notification.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L26) ___ @@ -140,7 +140,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L24) +[packages/medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L24) ## Methods @@ -179,7 +179,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -206,7 +206,7 @@ the result of notification subscribed #### Defined in -[packages/medusa/src/services/notification.ts:174](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L174) +[packages/medusa/src/services/notification.ts:174](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L174) ___ @@ -231,7 +231,7 @@ the notifications that satisfy the query. #### Defined in -[packages/medusa/src/services/notification.ts:86](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L86) +[packages/medusa/src/services/notification.ts:86](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L86) ___ @@ -254,7 +254,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/105c68929/packages/medusa/src/services/notification.ts#L62) +[packages/medusa/src/services/notification.ts:62](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L62) ___ @@ -276,7 +276,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/105c68929/packages/medusa/src/services/notification.ts#L70) +[packages/medusa/src/services/notification.ts:70](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L70) ___ @@ -302,7 +302,7 @@ the newly created notification #### Defined in -[packages/medusa/src/services/notification.ts:254](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L254) +[packages/medusa/src/services/notification.ts:254](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L254) ___ @@ -327,7 +327,7 @@ the notification #### Defined in -[packages/medusa/src/services/notification.ts:107](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L107) +[packages/medusa/src/services/notification.ts:107](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L107) ___ @@ -352,7 +352,7 @@ the notification provider #### Defined in -[packages/medusa/src/services/notification.ts:155](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L155) +[packages/medusa/src/services/notification.ts:155](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L155) ___ @@ -379,7 +379,7 @@ the created notification #### Defined in -[packages/medusa/src/services/notification.ts:206](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L206) +[packages/medusa/src/services/notification.ts:206](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L206) ___ @@ -403,7 +403,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -426,7 +426,7 @@ Subscribes a given provider to an event. #### Defined in -[packages/medusa/src/services/notification.ts:134](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/notification.ts#L134) +[packages/medusa/src/services/notification.ts:134](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/notification.ts#L134) ___ @@ -450,4 +450,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/OauthService.md b/docs/content/references/services/classes/OauthService.md index f8fc3d1d89..a0d0701586 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/105c68929/packages/medusa/src/services/oauth.ts#L31) +[packages/medusa/src/services/oauth.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L31) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L27) +[packages/medusa/src/services/oauth.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L27) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L29) +[packages/medusa/src/services/oauth.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L29) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L26) +[packages/medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L26) ___ @@ -96,7 +96,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L19) +[packages/medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L19) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L28) +[packages/medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L28) ___ @@ -120,7 +120,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/oauth.ts:20](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L20) +[packages/medusa/src/services/oauth.ts:20](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L20) ___ @@ -137,7 +137,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:21](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L21) +[packages/medusa/src/services/oauth.ts:21](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L21) ## Methods @@ -176,7 +176,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -196,7 +196,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:81](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L81) +[packages/medusa/src/services/oauth.ts:88](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L88) ___ @@ -218,7 +218,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:115](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L115) +[packages/medusa/src/services/oauth.ts:122](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L122) ___ @@ -238,7 +238,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:73](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L73) +[packages/medusa/src/services/oauth.ts:80](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L80) ___ @@ -258,7 +258,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:149](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L149) +[packages/medusa/src/services/oauth.ts:156](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L156) ___ @@ -278,7 +278,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:105](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L105) +[packages/medusa/src/services/oauth.ts:112](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L112) ___ @@ -298,7 +298,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:57](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L57) +[packages/medusa/src/services/oauth.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L57) ___ @@ -318,7 +318,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L41) +[packages/medusa/src/services/oauth.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L41) ___ @@ -342,7 +342,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -363,7 +363,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:94](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/oauth.ts#L94) +[packages/medusa/src/services/oauth.ts:101](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/oauth.ts#L101) ___ @@ -387,4 +387,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/OrderEditItemChangeService.md b/docs/content/references/services/classes/OrderEditItemChangeService.md index 4c6deb6199..ff8d24ac2b 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/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L34) +[packages/medusa/src/services/order-edit-item-change.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L30) +[packages/medusa/src/services/order-edit-item-change.ts:30](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L30) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L31) +[packages/medusa/src/services/order-edit-item-change.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L31) ___ @@ -86,7 +86,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L26) +[packages/medusa/src/services/order-edit-item-change.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L26) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L29) +[packages/medusa/src/services/order-edit-item-change.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L29) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:32](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L32) +[packages/medusa/src/services/order-edit-item-change.ts:32](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L32) ___ @@ -120,7 +120,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L27) +[packages/medusa/src/services/order-edit-item-change.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L27) ___ @@ -137,7 +137,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:21](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L21) +[packages/medusa/src/services/order-edit-item-change.ts:21](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L21) ## Methods @@ -176,7 +176,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -196,7 +196,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:86](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L86) +[packages/medusa/src/services/order-edit-item-change.ts:86](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L86) ___ @@ -216,7 +216,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:102](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L102) +[packages/medusa/src/services/order-edit-item-change.ts:102](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L102) ___ @@ -237,7 +237,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:73](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L73) +[packages/medusa/src/services/order-edit-item-change.ts:73](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L73) ___ @@ -258,7 +258,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit-item-change.ts#L51) +[packages/medusa/src/services/order-edit-item-change.ts:51](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit-item-change.ts#L51) ___ @@ -282,7 +282,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -306,4 +306,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/OrderEditService.md b/docs/content/references/services/classes/OrderEditService.md index 9014750dab..c09049848d 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:65](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L65) +[packages/medusa/src/services/order-edit.ts:65](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L65) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:60](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L60) +[packages/medusa/src/services/order-edit.ts:60](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L60) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L62) +[packages/medusa/src/services/order-edit.ts:62](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L62) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:59](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L59) +[packages/medusa/src/services/order-edit.ts:59](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L59) ___ @@ -96,7 +96,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/order-edit.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L52) +[packages/medusa/src/services/order-edit.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L52) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L63) +[packages/medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L63) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L55) +[packages/medusa/src/services/order-edit.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L55) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:57](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L57) +[packages/medusa/src/services/order-edit.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L57) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:61](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L61) +[packages/medusa/src/services/order-edit.ts:61](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L61) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:58](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L58) +[packages/medusa/src/services/order-edit.ts:58](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L58) ___ @@ -160,7 +160,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/order-edit.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L53) +[packages/medusa/src/services/order-edit.ts:53](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L53) ___ @@ -181,7 +181,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L43) +[packages/medusa/src/services/order-edit.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L43) ## Methods @@ -202,7 +202,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:547](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L547) +[packages/medusa/src/services/order-edit.ts:554](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L554) ___ @@ -241,7 +241,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -263,7 +263,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:691](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L691) +[packages/medusa/src/services/order-edit.ts:698](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L698) ___ @@ -285,7 +285,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:730](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L730) +[packages/medusa/src/services/order-edit.ts:737](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L737) ___ @@ -307,7 +307,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:207](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L207) +[packages/medusa/src/services/order-edit.ts:214](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L214) ___ @@ -330,7 +330,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:309](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L309) +[packages/medusa/src/services/order-edit.ts:316](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L316) ___ @@ -350,7 +350,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:533](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L533) +[packages/medusa/src/services/order-edit.ts:540](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L540) ___ @@ -370,7 +370,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:285](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L285) +[packages/medusa/src/services/order-edit.ts:292](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L292) ___ @@ -390,7 +390,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:803](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L803) +[packages/medusa/src/services/order-edit.ts:810](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L810) ___ @@ -411,7 +411,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:619](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L619) +[packages/medusa/src/services/order-edit.ts:626](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L626) ___ @@ -433,7 +433,7 @@ Compute and return the different totals from the order edit id #### Defined in -[packages/medusa/src/services/order-edit.ts:148](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L148) +[packages/medusa/src/services/order-edit.ts:155](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L155) ___ @@ -454,7 +454,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:136](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L136) +[packages/medusa/src/services/order-edit.ts:143](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L143) ___ @@ -475,7 +475,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:112](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L112) +[packages/medusa/src/services/order-edit.ts:119](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L119) ___ @@ -495,7 +495,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:490](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L490) +[packages/medusa/src/services/order-edit.ts:497](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L497) ___ @@ -516,7 +516,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:433](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L433) +[packages/medusa/src/services/order-edit.ts:440](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L440) ___ @@ -538,7 +538,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:651](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L651) +[packages/medusa/src/services/order-edit.ts:658](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L658) ___ @@ -559,7 +559,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:90](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L90) +[packages/medusa/src/services/order-edit.ts:90](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L90) ___ @@ -580,7 +580,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:782](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L782) +[packages/medusa/src/services/order-edit.ts:789](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L789) ___ @@ -604,7 +604,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -655,7 +655,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:256](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L256) +[packages/medusa/src/services/order-edit.ts:263](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L263) ___ @@ -682,7 +682,7 @@ Create or update order edit item change line item and apply the quantity #### Defined in -[packages/medusa/src/services/order-edit.ts:360](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L360) +[packages/medusa/src/services/order-edit.ts:367](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L367) ___ @@ -706,7 +706,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ @@ -726,4 +726,4 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:849](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order-edit.ts#L849) +[packages/medusa/src/services/order-edit.ts:856](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order-edit.ts#L856) diff --git a/docs/content/references/services/classes/OrderService.md b/docs/content/references/services/classes/OrderService.md index 9bf91fe5f3..b0ada02e3a 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:123](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L123) +[packages/medusa/src/services/order.ts:124](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L124) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:116](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L116) +[packages/medusa/src/services/order.ts:117](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L117) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:115](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L115) +[packages/medusa/src/services/order.ts:116](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L116) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:103](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L103) +[packages/medusa/src/services/order.ts:104](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L104) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:107](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L107) +[packages/medusa/src/services/order.ts:108](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L108) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:118](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L118) +[packages/medusa/src/services/order.ts:119](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L119) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:120](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L120) +[packages/medusa/src/services/order.ts:121](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L121) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:121](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L121) +[packages/medusa/src/services/order.ts:122](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L122) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:108](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L108) +[packages/medusa/src/services/order.ts:109](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L109) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:109](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L109) +[packages/medusa/src/services/order.ts:110](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L110) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:117](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L117) +[packages/medusa/src/services/order.ts:118](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L118) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:119](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L119) +[packages/medusa/src/services/order.ts:120](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L120) ___ @@ -172,7 +172,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:110](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L110) +[packages/medusa/src/services/order.ts:111](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L111) ___ @@ -186,7 +186,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/order.ts:99](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L99) +[packages/medusa/src/services/order.ts:100](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L100) ___ @@ -196,7 +196,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:112](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L112) +[packages/medusa/src/services/order.ts:113](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L113) ___ @@ -206,7 +206,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:102](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L102) +[packages/medusa/src/services/order.ts:103](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L103) ___ @@ -216,7 +216,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:104](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L104) +[packages/medusa/src/services/order.ts:105](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L105) ___ @@ -226,7 +226,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:114](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L114) +[packages/medusa/src/services/order.ts:115](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L115) ___ @@ -236,7 +236,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:105](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L105) +[packages/medusa/src/services/order.ts:106](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L106) ___ @@ -246,7 +246,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:106](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L106) +[packages/medusa/src/services/order.ts:107](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L107) ___ @@ -256,7 +256,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:113](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L113) +[packages/medusa/src/services/order.ts:114](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L114) ___ @@ -266,7 +266,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:111](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L111) +[packages/medusa/src/services/order.ts:112](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L112) ___ @@ -280,7 +280,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/order.ts:100](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L100) +[packages/medusa/src/services/order.ts:101](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L101) ___ @@ -311,7 +311,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:80](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L80) +[packages/medusa/src/services/order.ts:81](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L81) ## Methods @@ -334,7 +334,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:897](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L897) +[packages/medusa/src/services/order.ts:962](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L962) ___ @@ -359,7 +359,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:1422](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1422) +[packages/medusa/src/services/order.ts:1487](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1487) ___ @@ -398,7 +398,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -424,7 +424,7 @@ result of the update operation. #### Defined in -[packages/medusa/src/services/order.ts:1049](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1049) +[packages/medusa/src/services/order.ts:1114](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1114) ___ @@ -448,7 +448,7 @@ updated order #### Defined in -[packages/medusa/src/services/order.ts:1359](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1359) +[packages/medusa/src/services/order.ts:1424](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1424) ___ @@ -472,7 +472,7 @@ result of the update operation. #### Defined in -[packages/medusa/src/services/order.ts:1127](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1127) +[packages/medusa/src/services/order.ts:1192](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1192) ___ @@ -494,7 +494,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/order.ts:499](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L499) +[packages/medusa/src/services/order.ts:508](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L508) ___ @@ -518,7 +518,7 @@ resolves to the creation result. #### Defined in -[packages/medusa/src/services/order.ts:527](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L527) +[packages/medusa/src/services/order.ts:536](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L536) ___ @@ -549,7 +549,29 @@ result of the update operation. #### Defined in -[packages/medusa/src/services/order.ts:1232](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1232) +[packages/medusa/src/services/order.ts:1297](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1297) + +___ + +### createGiftCardsFromLineItem\_ + +▸ `Protected` **createGiftCardsFromLineItem_**(`order`, `lineItem`, `manager`): `Promise`<`GiftCard`\>[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `order` | `Order` | +| `lineItem` | `LineItem` | +| `manager` | `EntityManager` | + +#### Returns + +`Promise`<`GiftCard`\>[] + +#### Defined in + +[packages/medusa/src/services/order.ts:748](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L748) ___ @@ -578,7 +600,7 @@ the result of the refund operation. #### Defined in -[packages/medusa/src/services/order.ts:1448](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1448) +[packages/medusa/src/services/order.ts:1513](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1513) ___ @@ -609,13 +631,15 @@ the resulting order following the update. #### Defined in -[packages/medusa/src/services/order.ts:737](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L737) +[packages/medusa/src/services/order.ts:802](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L802) ___ ### decorateTotals -▸ `Protected` **decorateTotals**(`order`, `totalsFieldsOrConfig?`): `Promise`<`Order`\> +▸ **decorateTotals**(`order`, `totalsFieldsOrConfig?`): `Promise`<`Order`\> + +Calculate and attach the different total fields on the object #### Parameters @@ -630,7 +654,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:1610](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1610) +[packages/medusa/src/services/order.ts:1713](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1713) ___ @@ -651,7 +675,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:1497](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1497) +[packages/medusa/src/services/order.ts:1579](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1579) ___ @@ -677,7 +701,7 @@ the line items generated by the transformer. #### Defined in -[packages/medusa/src/services/order.ts:1401](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1401) +[packages/medusa/src/services/order.ts:1466](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1466) ___ @@ -697,7 +721,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:1836](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1836) +[packages/medusa/src/services/order.ts:1939](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1939) ___ @@ -720,7 +744,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/order.ts:177](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L177) +[packages/medusa/src/services/order.ts:178](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L178) ___ @@ -743,7 +767,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/order.ts:194](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L194) +[packages/medusa/src/services/order.ts:195](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L195) ___ @@ -775,7 +799,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:1761](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1761) +[packages/medusa/src/services/order.ts:1864](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1864) ___ @@ -800,7 +824,7 @@ the order document #### Defined in -[packages/medusa/src/services/order.ts:332](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L332) +[packages/medusa/src/services/order.ts:334](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L334) ___ @@ -825,7 +849,7 @@ the order document #### Defined in -[packages/medusa/src/services/order.ts:421](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L421) +[packages/medusa/src/services/order.ts:430](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L430) ___ @@ -850,7 +874,7 @@ the order document #### Defined in -[packages/medusa/src/services/order.ts:462](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L462) +[packages/medusa/src/services/order.ts:471](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L471) ___ @@ -871,7 +895,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:366](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L366) +[packages/medusa/src/services/order.ts:375](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L375) ___ @@ -893,7 +917,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:404](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L404) +[packages/medusa/src/services/order.ts:413](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L413) ___ @@ -917,7 +941,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -943,7 +967,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:257](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L257) +[packages/medusa/src/services/order.ts:258](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L258) ___ @@ -970,7 +994,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/order.ts:960](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L960) +[packages/medusa/src/services/order.ts:1025](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1025) ___ @@ -995,7 +1019,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:825](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L825) +[packages/medusa/src/services/order.ts:890](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L890) ___ @@ -1020,7 +1044,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:865](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L865) +[packages/medusa/src/services/order.ts:930](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L930) ___ @@ -1049,7 +1073,7 @@ a line item that has the requested fulfillment quantity #### Defined in -[packages/medusa/src/services/order.ts:1199](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/order.ts#L1199) +[packages/medusa/src/services/order.ts:1264](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/order.ts#L1264) ___ @@ -1073,4 +1097,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/PaymentCollectionService.md b/docs/content/references/services/classes/PaymentCollectionService.md index 6dee7d9ec9..55a70ed89f 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:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L52) +[packages/medusa/src/services/payment-collection.ts:51](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L51) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L48) +[packages/medusa/src/services/payment-collection.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L47) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L46) +[packages/medusa/src/services/payment-collection.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L45) ___ @@ -86,7 +86,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L44) +[packages/medusa/src/services/payment-collection.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L43) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L50) +[packages/medusa/src/services/payment-collection.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L49) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L47) +[packages/medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L46) ___ @@ -120,7 +120,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/payment-collection.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L45) +[packages/medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L44) ___ @@ -139,7 +139,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L37) +[packages/medusa/src/services/payment-collection.ts:36](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L36) ## Methods @@ -178,28 +178,33 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ -### authorize +### authorizePaymentSessions -▸ **authorize**(`paymentCollectionId`, `context?`): `Promise`<`PaymentCollection`\> +▸ **authorizePaymentSessions**(`paymentCollectionId`, `sessionIds`, `context?`): `Promise`<`PaymentCollection`\> + +Authorizes the payment sessions of a payment collection. #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentCollectionId` | `string` | -| `context` | `Record`<`string`, `unknown`\> | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentCollectionId` | `string` | the id of the payment collection | +| `sessionIds` | `string`[] | array of payment session ids to be authorized | +| `context` | `Record`<`string`, `unknown`\> | additional data required by payment providers | #### Returns `Promise`<`PaymentCollection`\> +the payment collection and its payment session. + #### Defined in -[packages/medusa/src/services/payment-collection.ts:390](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L390) +[packages/medusa/src/services/payment-collection.ts:587](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L587) ___ @@ -207,19 +212,23 @@ ___ ▸ **create**(`data`): `Promise`<`PaymentCollection`\> +Creates a new payment collection. + #### Parameters -| Name | Type | -| :------ | :------ | -| `data` | `CreatePaymentCollectionInput` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `CreatePaymentCollectionInput` | info to create the payment collection | #### Returns `Promise`<`PaymentCollection`\> +the payment collection created. + #### Defined in -[packages/medusa/src/services/payment-collection.ts:92](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L92) +[packages/medusa/src/services/payment-collection.ts:111](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L111) ___ @@ -227,19 +236,23 @@ ___ ▸ **delete**(`paymentCollectionId`): `Promise`<`undefined` \| `PaymentCollection`\> +Deletes a payment collection. + #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentCollectionId` | `string` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentCollectionId` | `string` | the id of the payment collection to be removed | #### Returns `Promise`<`undefined` \| `PaymentCollection`\> +the payment collection removed. + #### Defined in -[packages/medusa/src/services/payment-collection.ts:150](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L150) +[packages/medusa/src/services/payment-collection.ts:180](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L180) ___ @@ -252,7 +265,7 @@ ___ | Name | Type | | :------ | :------ | | `total` | `number` | -| `sessionsInput` | `PaymentCollectionSessionInput`[] | +| `sessionsInput` | `PaymentCollectionsSessionsBatchInput`[] | #### Returns @@ -260,7 +273,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:188](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L188) +[packages/medusa/src/services/payment-collection.ts:218](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L218) ___ @@ -268,41 +281,49 @@ ___ ▸ **markAsAuthorized**(`paymentCollectionId`): `Promise`<`PaymentCollection`\> +Marks a payment collection as authorized bypassing the payment flow. + #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentCollectionId` | `string` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentCollectionId` | `string` | the id of the payment collection | #### Returns `Promise`<`PaymentCollection`\> +the payment session authorized. + #### Defined in -[packages/medusa/src/services/payment-collection.ts:368](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L368) +[packages/medusa/src/services/payment-collection.ts:558](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L558) ___ ### refreshPaymentSession -▸ **refreshPaymentSession**(`paymentCollectionId`, `sessionId`, `sessionInput`): `Promise`<`PaymentSession`\> +▸ **refreshPaymentSession**(`paymentCollectionId`, `sessionId`, `customerId`): `Promise`<`PaymentSession`\> + +Removes and recreate a payment session of a payment collection. #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentCollectionId` | `string` | -| `sessionId` | `string` | -| `sessionInput` | `Omit`<`PaymentCollectionSessionInput`, ``"amount"``\> | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentCollectionId` | `string` | the id of the payment collection | +| `sessionId` | `string` | the id of the payment session to be replaced | +| `customerId` | `string` | the id of the customer | #### Returns `Promise`<`PaymentSession`\> +the new payment session created. + #### Defined in -[packages/medusa/src/services/payment-collection.ts:293](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L293) +[packages/medusa/src/services/payment-collection.ts:468](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L468) ___ @@ -310,41 +331,76 @@ ___ ▸ **retrieve**(`paymentCollectionId`, `config?`): `Promise`<`PaymentCollection`\> +Retrieves a payment collection by id. + #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentCollectionId` | `string` | -| `config` | `FindConfig`<`PaymentCollection`\> | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentCollectionId` | `string` | the id of the payment collection | +| `config` | `FindConfig`<`PaymentCollection`\> | the config to retrieve the payment collection | #### Returns `Promise`<`PaymentCollection`\> +the payment collection. + #### Defined in -[packages/medusa/src/services/payment-collection.ts:69](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L69) +[packages/medusa/src/services/payment-collection.ts:74](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L74) ___ -### setPaymentSessions +### setPaymentSession -▸ **setPaymentSessions**(`paymentCollectionId`, `sessions`): `Promise`<`PaymentCollection`\> +▸ **setPaymentSession**(`paymentCollectionId`, `sessionInput`, `customerId`): `Promise`<`PaymentCollection`\> + +Manages a single payment sessions of a payment collection. #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentCollectionId` | `string` | -| `sessions` | `PaymentCollectionSessionInput` \| `PaymentCollectionSessionInput`[] | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentCollectionId` | `string` | the id of the payment collection | +| `sessionInput` | `PaymentCollectionsSessionsInput` | object containing payment session info | +| `customerId` | `string` | the id of the customer | #### Returns `Promise`<`PaymentCollection`\> +the payment collection and its payment session. + #### Defined in -[packages/medusa/src/services/payment-collection.ts:196](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L196) +[packages/medusa/src/services/payment-collection.ts:360](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L360) + +___ + +### setPaymentSessionsBatch + +▸ **setPaymentSessionsBatch**(`paymentCollectionId`, `sessionsInput`, `customerId`): `Promise`<`PaymentCollection`\> + +Manages multiple payment sessions of a payment collection. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentCollectionId` | `string` | the id of the payment collection | +| `sessionsInput` | `PaymentCollectionsSessionsBatchInput`[] | array containing payment session info | +| `customerId` | `string` | the id of the customer | + +#### Returns + +`Promise`<`PaymentCollection`\> + +the payment collection and its payment sessions. + +#### Defined in + +[packages/medusa/src/services/payment-collection.ts:233](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L233) ___ @@ -368,7 +424,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -376,37 +432,41 @@ ___ ▸ **update**(`paymentCollectionId`, `data`): `Promise`<`PaymentCollection`\> +Updates a payment collection. + #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentCollectionId` | `string` | -| `data` | `Object` | -| `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 \| 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.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; } | +| 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; } | - | #### Returns `Promise`<`PaymentCollection`\> +the payment collection updated. + #### Defined in -[packages/medusa/src/services/payment-collection.ts:121](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-collection.ts#L121) +[packages/medusa/src/services/payment-collection.ts:146](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-collection.ts#L146) ___ @@ -430,4 +490,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/PaymentProviderService.md b/docs/content/references/services/classes/PaymentProviderService.md index 3da3cb6dc7..942bb1f40a 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:57](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L57) +[packages/medusa/src/services/payment-provider.ts:65](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,17 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L47) +[packages/medusa/src/services/payment-provider.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L54) + +___ + +### customerService\_ + +• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) + +#### Defined in + +[packages/medusa/src/services/payment-provider.ts:60](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L60) ___ @@ -74,7 +84,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L55) +[packages/medusa/src/services/payment-provider.ts:63](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L63) ___ @@ -84,7 +94,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L53) +[packages/medusa/src/services/payment-provider.ts:61](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L61) ___ @@ -98,7 +108,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/payment-provider.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L45) +[packages/medusa/src/services/payment-provider.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L52) ___ @@ -108,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L50) +[packages/medusa/src/services/payment-provider.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L57) ___ @@ -118,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L51) +[packages/medusa/src/services/payment-provider.ts:58](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L58) ___ @@ -128,7 +138,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L48) +[packages/medusa/src/services/payment-provider.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L55) ___ @@ -138,7 +148,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L52) +[packages/medusa/src/services/payment-provider.ts:59](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L59) ___ @@ -152,7 +162,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/payment-provider.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L46) +[packages/medusa/src/services/payment-provider.ts:53](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L53) ## Methods @@ -191,7 +201,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -212,7 +222,29 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:447](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L447) +[packages/medusa/src/services/payment-provider.ts:394](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L394) + +___ + +### buildPaymentContext + +▸ `Protected` **buildPaymentContext**(`cartOrData`): `Cart` & `PaymentContext` + +Build the create session context for both legacy and new API + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cartOrData` | `Cart` \| `PaymentSessionInput` | + +#### Returns + +`Cart` & `PaymentContext` + +#### Defined in + +[packages/medusa/src/services/payment-provider.ts:643](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L643) ___ @@ -232,7 +264,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:503](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L503) +[packages/medusa/src/services/payment-provider.ts:450](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L450) ___ @@ -252,7 +284,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:528](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L528) +[packages/medusa/src/services/payment-provider.ts:475](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L475) ___ @@ -264,11 +296,7 @@ ___ | Name | Type | | :------ | :------ | -| `data` | `Object` | -| `data.amount` | `number` | -| `data.cart_id` | `string` | -| `data.currency_code` | `string` | -| `data.payment_session` | `PaymentSession` | +| `data` | `CreatePaymentInput` | #### Returns @@ -276,42 +304,28 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:381](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L381) - -___ - -### createPaymentNew - -▸ **createPaymentNew**(`paymentInput`): `Promise`<`Payment`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `paymentInput` | `Omit`<`PaymentProviderDataInput`, ``"customer"``\> & { `payment_session`: `PaymentSession` } | - -#### Returns - -`Promise`<`Payment`\> - -#### Defined in - -[packages/medusa/src/services/payment-provider.ts:411](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L411) +[packages/medusa/src/services/payment-provider.ts:356](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L356) ___ ### createSession -▸ **createSession**(`providerId`, `cart`): `Promise`<`PaymentSession`\> +▸ **createSession**<`TInput`\>(`providerIdOrSessionInput`, ...`cart`): `Promise`<`PaymentSession`\> Creates a payment session with the given provider. +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TInput` | extends `string` \| `PaymentSessionInput` = `string` \| `PaymentSessionInput` | + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `providerId` | `string` | the id of the provider to create payment with | -| `cart` | `Cart` | a cart object used to calculate the amount, etc. from | +| `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 | #### Returns @@ -321,27 +335,7 @@ the payment session #### Defined in -[packages/medusa/src/services/payment-provider.ts:172](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L172) - -___ - -### createSessionNew - -▸ **createSessionNew**(`sessionInput`): `Promise`<`PaymentSession`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `sessionInput` | `PaymentProviderDataInput` | - -#### Returns - -`Promise`<`PaymentSession`\> - -#### Defined in - -[packages/medusa/src/services/payment-provider.ts:195](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L195) +[packages/medusa/src/services/payment-provider.ts:181](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L181) ___ @@ -361,7 +355,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:327](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L327) +[packages/medusa/src/services/payment-provider.ts:302](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L302) ___ @@ -381,7 +375,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:523](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L523) +[packages/medusa/src/services/payment-provider.ts:470](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L470) ___ @@ -395,7 +389,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:89](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L89) +[packages/medusa/src/services/payment-provider.ts:98](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L98) ___ @@ -416,13 +410,38 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:124](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L124) +[packages/medusa/src/services/payment-provider.ts:133](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L133) + +___ + +### processUpdateRequestsData + +▸ `Protected` **processUpdateRequestsData**(`data?`, `paymentResponse`): `Promise`<`void`\> + +Process the collected data. Can be used every time we need to process some collected data returned by the provider + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `Object` | +| `data.customer?` | `Object` | +| `data.customer.id?` | `string` | +| `paymentResponse` | `Record`<`string`, `unknown`\> \| `PaymentSessionResponse` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[packages/medusa/src/services/payment-provider.ts:736](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L736) ___ ### refreshSession -▸ **refreshSession**(`paymentSession`, `cart`): `Promise`<`PaymentSession`\> +▸ **refreshSession**(`paymentSession`, `sessionInput`): `Promise`<`PaymentSession`\> Refreshes a payment session with the given provider. This means, that we delete the current one and create a new. @@ -431,8 +450,11 @@ This means, that we delete the current one and create a new. | Name | Type | Description | | :------ | :------ | :------ | -| `paymentSession` | `PaymentSession` | the payment session object to update | -| `cart` | `Cart` | a cart object used to calculate the amount, etc. from | +| `paymentSession` | `Object` | the payment session object to update | +| `paymentSession.data` | `Record`<`string`, `unknown`\> | - | +| `paymentSession.id` | `string` | - | +| `paymentSession.provider_id` | `string` | - | +| `sessionInput` | `PaymentSessionInput` | | #### Returns @@ -442,28 +464,7 @@ the payment session #### Defined in -[packages/medusa/src/services/payment-provider.ts:228](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L228) - -___ - -### refreshSessionNew - -▸ **refreshSessionNew**(`paymentSession`, `sessionInput`): `Promise`<`PaymentSession`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `paymentSession` | `PaymentSession` | -| `sessionInput` | `PaymentProviderDataInput` | - -#### Returns - -`Promise`<`PaymentSession`\> - -#### Defined in - -[packages/medusa/src/services/payment-provider.ts:260](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L260) +[packages/medusa/src/services/payment-provider.ts:241](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L241) ___ @@ -486,7 +487,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:632](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L632) +[packages/medusa/src/services/payment-provider.ts:580](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L580) ___ @@ -509,7 +510,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:548](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L548) +[packages/medusa/src/services/payment-provider.ts:495](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L495) ___ @@ -529,7 +530,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:70](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L70) +[packages/medusa/src/services/payment-provider.ts:79](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L79) ___ @@ -550,7 +551,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:96](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L96) +[packages/medusa/src/services/payment-provider.ts:105](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L105) ___ @@ -580,7 +581,7 @@ the payment provider #### Defined in -[packages/medusa/src/services/payment-provider.ts:357](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L357) +[packages/medusa/src/services/payment-provider.ts:332](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L332) ___ @@ -601,7 +602,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:672](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L672) +[packages/medusa/src/services/payment-provider.ts:620](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L620) ___ @@ -622,7 +623,36 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:137](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L137) +[packages/medusa/src/services/payment-provider.ts:146](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L146) + +___ + +### saveSession + +▸ `Protected` **saveSession**(`providerId`, `data`): `Promise`<`PaymentSession`\> + +Create or update a Payment session data. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `providerId` | `string` | +| `data` | `Object` | +| `data.amount?` | `number` | +| `data.cartId?` | `string` | +| `data.isSelected?` | `boolean` | +| `data.payment_session_id?` | `string` | +| `data.sessionData` | `Record`<`string`, `unknown`\> | +| `data.status?` | `PaymentSessionStatus` | + +#### Returns + +`Promise`<`PaymentSession`\> + +#### Defined in + +[packages/medusa/src/services/payment-provider.ts:682](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L682) ___ @@ -646,7 +676,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -669,32 +699,35 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:435](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L435) +[packages/medusa/src/services/payment-provider.ts:382](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L382) ___ ### updateSession -▸ **updateSession**(`paymentSession`, `cart`): `Promise`<`PaymentSession`\> +▸ **updateSession**(`paymentSession`, `sessionInput`): `Promise`<`PaymentSession`\> -Updates an existing payment session. +Update a payment session with the given provider. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `paymentSession` | `PaymentSession` | the payment session object to update | -| `cart` | `Cart` | the cart object to update for | +| `paymentSession` | `Object` | The paymentSession to update | +| `paymentSession.data` | `Record`<`string`, `unknown`\> | - | +| `paymentSession.id` | `string` | - | +| `paymentSession.provider_id` | `string` | - | +| `sessionInput` | `Cart` \| `PaymentSessionInput` | | #### Returns `Promise`<`PaymentSession`\> -the updated payment session +the payment session #### Defined in -[packages/medusa/src/services/payment-provider.ts:287](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L287) +[packages/medusa/src/services/payment-provider.ts:271](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L271) ___ @@ -715,28 +748,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:482](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L482) - -___ - -### updateSessionNew - -▸ **updateSessionNew**(`paymentSession`, `sessionInput`): `Promise`<`PaymentSession`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `paymentSession` | `PaymentSession` | -| `sessionInput` | `PaymentProviderDataInput` | - -#### Returns - -`Promise`<`PaymentSession`\> - -#### Defined in - -[packages/medusa/src/services/payment-provider.ts:305](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment-provider.ts#L305) +[packages/medusa/src/services/payment-provider.ts:429](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment-provider.ts#L429) ___ @@ -760,4 +772,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/PaymentService.md b/docs/content/references/services/classes/PaymentService.md index 4a5ecfb578..efee5b7e12 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/105c68929/packages/medusa/src/services/payment.ts#L40) +[packages/medusa/src/services/payment.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L40) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L28) +[packages/medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L28) ___ @@ -76,7 +76,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/payment.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L26) +[packages/medusa/src/services/payment.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L26) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L29) +[packages/medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L29) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L30) +[packages/medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L30) ___ @@ -110,7 +110,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L27) +[packages/medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L27) ___ @@ -131,7 +131,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L31) +[packages/medusa/src/services/payment.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L31) ## Methods @@ -170,7 +170,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -178,19 +178,23 @@ ___ ▸ **capture**(`paymentOrId`): `Promise`<`Payment`\> +Captures a payment. + #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentOrId` | `string` \| `Payment` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentOrId` | `string` \| `Payment` | the id or the class instance of the payment | #### Returns `Promise`<`Payment`\> +the payment captured. + #### Defined in -[packages/medusa/src/services/payment.ts:132](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L132) +[packages/medusa/src/services/payment.ts:161](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L161) ___ @@ -198,19 +202,23 @@ ___ ▸ **create**(`paymentInput`): `Promise`<`Payment`\> +Created a new payment. + #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentInput` | `PaymentDataInput` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentInput` | `PaymentDataInput` | info to create the payment | #### Returns `Promise`<`Payment`\> +the payment created. + #### Defined in -[packages/medusa/src/services/payment.ts:78](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L78) +[packages/medusa/src/services/payment.ts:96](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L96) ___ @@ -218,22 +226,26 @@ ___ ▸ **refund**(`paymentOrId`, `amount`, `reason`, `note?`): `Promise`<`Refund`\> +refunds a payment. + #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentOrId` | `string` \| `Payment` | -| `amount` | `number` | -| `reason` | `string` | -| `note?` | `string` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentOrId` | `string` \| `Payment` | the id or the class instance of the payment | +| `amount` | `number` | the amount to be refunded from the payment | +| `reason` | `string` | the refund reason | +| `note?` | `string` | additional note of the refund | #### Returns `Promise`<`Refund`\> +the refund created. + #### Defined in -[packages/medusa/src/services/payment.ts:173](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L173) +[packages/medusa/src/services/payment.ts:210](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L210) ___ @@ -241,20 +253,24 @@ ___ ▸ **retrieve**(`paymentId`, `config?`): `Promise`<`Payment`\> +Retrieves a payment by id. + #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentId` | `string` | -| `config` | `FindConfig`<`Payment`\> | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentId` | `string` | the id of the payment | +| `config` | `FindConfig`<`Payment`\> | the config to retrieve the payment | #### Returns `Promise`<`Payment`\> +the payment. + #### Defined in -[packages/medusa/src/services/payment.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L55) +[packages/medusa/src/services/payment.ts:61](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L61) ___ @@ -278,7 +294,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -286,22 +302,26 @@ ___ ▸ **update**(`paymentId`, `data`): `Promise`<`Payment`\> +Updates a payment in order to link it to an order or a swap. + #### Parameters -| Name | Type | -| :------ | :------ | -| `paymentId` | `string` | -| `data` | `Object` | -| `data.order_id?` | `string` | -| `data.swap_id?` | `string` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `paymentId` | `string` | the id of the payment | +| `data` | `Object` | order_id or swap_id to link the payment | +| `data.order_id?` | `string` | - | +| `data.swap_id?` | `string` | - | #### Returns `Promise`<`Payment`\> +the payment updated. + #### Defined in -[packages/medusa/src/services/payment.ts:103](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/payment.ts#L103) +[packages/medusa/src/services/payment.ts:127](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/payment.ts#L127) ___ @@ -325,4 +345,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/PriceListService.md b/docs/content/references/services/classes/PriceListService.md index f147cbea4a..da3b528cc6 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/105c68929/packages/medusa/src/services/price-list.ts#L57) +[packages/medusa/src/services/price-list.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L57) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L48) +[packages/medusa/src/services/price-list.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L48) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L55) +[packages/medusa/src/services/price-list.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L55) ___ @@ -88,7 +88,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/price-list.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L45) +[packages/medusa/src/services/price-list.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L45) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L53) +[packages/medusa/src/services/price-list.ts:53](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L53) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L52) +[packages/medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L52) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L50) +[packages/medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L50) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L54) +[packages/medusa/src/services/price-list.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L54) ___ @@ -138,7 +138,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L49) +[packages/medusa/src/services/price-list.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L49) ___ @@ -152,7 +152,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/price-list.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L46) +[packages/medusa/src/services/price-list.ts:46](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L46) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L51) +[packages/medusa/src/services/price-list.ts:51](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L51) ## Methods @@ -176,7 +176,7 @@ Add `currency_code` to an MA record if `region_id`is passed. | Name | Type | | :------ | :------ | -| `T` | extends `PriceListPriceUpdateInput` \| `PriceListPriceCreateInput` | +| `T` | extends `PriceListPriceCreateInput` \| `PriceListPriceUpdateInput` | #### Parameters @@ -192,7 +192,7 @@ updated `prices` list #### Defined in -[packages/medusa/src/services/price-list.ts:512](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L512) +[packages/medusa/src/services/price-list.ts:519](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L519) ___ @@ -218,7 +218,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:211](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L211) +[packages/medusa/src/services/price-list.ts:218](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L218) ___ @@ -257,7 +257,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -281,7 +281,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:251](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L251) +[packages/medusa/src/services/price-list.ts:258](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L258) ___ @@ -305,7 +305,7 @@ created Price List #### Defined in -[packages/medusa/src/services/price-list.ts:112](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L112) +[packages/medusa/src/services/price-list.ts:119](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L119) ___ @@ -330,7 +330,7 @@ empty promise #### Defined in -[packages/medusa/src/services/price-list.ts:265](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L265) +[packages/medusa/src/services/price-list.ts:272](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L272) ___ @@ -355,7 +355,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:236](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L236) +[packages/medusa/src/services/price-list.ts:243](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L243) ___ @@ -376,7 +376,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:439](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L439) +[packages/medusa/src/services/price-list.ts:446](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L446) ___ @@ -397,7 +397,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:476](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L476) +[packages/medusa/src/services/price-list.ts:483](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L483) ___ @@ -422,7 +422,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/price-list.ts:285](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L285) +[packages/medusa/src/services/price-list.ts:292](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L292) ___ @@ -447,7 +447,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/price-list.ts:309](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L309) +[packages/medusa/src/services/price-list.ts:316](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L316) ___ @@ -470,7 +470,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:357](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L357) +[packages/medusa/src/services/price-list.ts:364](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L364) ___ @@ -493,7 +493,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:405](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L405) +[packages/medusa/src/services/price-list.ts:412](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L412) ___ @@ -518,7 +518,7 @@ the collection. #### Defined in -[packages/medusa/src/services/price-list.ts:88](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L88) +[packages/medusa/src/services/price-list.ts:88](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L88) ___ @@ -542,7 +542,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -567,7 +567,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:160](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L160) +[packages/medusa/src/services/price-list.ts:167](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L167) ___ @@ -588,7 +588,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:338](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/price-list.ts#L338) +[packages/medusa/src/services/price-list.ts:345](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/price-list.ts#L345) ___ @@ -612,4 +612,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/PricingService.md b/docs/content/references/services/classes/PricingService.md index 51dfb52b98..18de58dfb0 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/105c68929/packages/medusa/src/services/pricing.ts#L44) +[packages/medusa/src/services/pricing.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L42) +[packages/medusa/src/services/pricing.ts:42](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L42) ___ @@ -78,7 +78,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/pricing.ts:36](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L36) +[packages/medusa/src/services/pricing.ts:36](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L36) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L40) +[packages/medusa/src/services/pricing.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L40) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L41) +[packages/medusa/src/services/pricing.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L41) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L38) +[packages/medusa/src/services/pricing.ts:38](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L38) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L39) +[packages/medusa/src/services/pricing.ts:39](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L39) ___ @@ -132,7 +132,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/pricing.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L37) +[packages/medusa/src/services/pricing.ts:37](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L37) ## Methods @@ -171,7 +171,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -196,7 +196,7 @@ The tax related variant prices. #### Defined in -[packages/medusa/src/services/pricing.ts:104](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L104) +[packages/medusa/src/services/pricing.ts:105](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L105) ___ @@ -221,7 +221,7 @@ The pricing context #### Defined in -[packages/medusa/src/services/pricing.ts:69](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L69) +[packages/medusa/src/services/pricing.ts:69](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L69) ___ @@ -247,7 +247,7 @@ A map of variant ids to their corresponding prices #### Defined in -[packages/medusa/src/services/pricing.ts:323](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L323) +[packages/medusa/src/services/pricing.ts:389](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L389) ___ @@ -272,7 +272,7 @@ A map of variant ids to their corresponding prices #### Defined in -[packages/medusa/src/services/pricing.ts:341](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L341) +[packages/medusa/src/services/pricing.ts:407](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L407) ___ @@ -294,7 +294,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:285](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L285) +[packages/medusa/src/services/pricing.ts:351](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L351) ___ @@ -319,7 +319,7 @@ The product variant prices #### Defined in -[packages/medusa/src/services/pricing.ts:213](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L213) +[packages/medusa/src/services/pricing.ts:214](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L214) ___ @@ -329,6 +329,10 @@ ___ Gets the prices for a product variant by a variant id. +**`Deprecated`** + +Use [getProductVariantsPricing](PricingService.md#getproductvariantspricing) instead. + #### Parameters | Name | Type | Description | @@ -344,7 +348,7 @@ The product variant prices #### Defined in -[packages/medusa/src/services/pricing.ts:251](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L251) +[packages/medusa/src/services/pricing.ts:253](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L253) ___ @@ -366,7 +370,39 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:166](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L166) +[packages/medusa/src/services/pricing.ts:167](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L167) + +___ + +### getProductVariantsPricing + +▸ **getProductVariantsPricing**<`T`, `TOutput`\>(`variantIds`, `context`): `Promise`<`TOutput`\> + +Gets the prices for a collection of variants. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `string` \| `string`[] | +| `TOutput` | `T` extends `string` ? `ProductVariantPricing` : { `[variant_id: string]`: `ProductVariantPricing`; } | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `variantIds` | `T` | the id of the variants to get the prices for | +| `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use | + +#### Returns + +`Promise`<`TOutput`\> + +The product variant prices + +#### Defined in + +[packages/medusa/src/services/pricing.ts:294](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L294) ___ @@ -391,7 +427,7 @@ The shipping option prices #### Defined in -[packages/medusa/src/services/pricing.ts:427](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L427) +[packages/medusa/src/services/pricing.ts:493](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L493) ___ @@ -416,7 +452,7 @@ A list of products with variants decorated with prices #### Defined in -[packages/medusa/src/services/pricing.ts:384](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L384) +[packages/medusa/src/services/pricing.ts:450](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L450) ___ @@ -441,7 +477,7 @@ A list of shipping options with prices #### Defined in -[packages/medusa/src/services/pricing.ts:489](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L489) +[packages/medusa/src/services/pricing.ts:555](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L555) ___ @@ -466,7 +502,7 @@ A list of products with variants decorated with prices #### Defined in -[packages/medusa/src/services/pricing.ts:359](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/pricing.ts#L359) +[packages/medusa/src/services/pricing.ts:425](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/pricing.ts#L425) ___ @@ -490,7 +526,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -514,4 +550,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ProductCollectionService.md b/docs/content/references/services/classes/ProductCollectionService.md index daaa0b3f65..c3eee30edc 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/105c68929/packages/medusa/src/services/product-collection.ts#L34) +[packages/medusa/src/services/product-collection.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L34) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L29) +[packages/medusa/src/services/product-collection.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L29) ___ @@ -78,7 +78,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-collection.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L26) +[packages/medusa/src/services/product-collection.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L26) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L31) +[packages/medusa/src/services/product-collection.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L31) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:32](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L32) +[packages/medusa/src/services/product-collection.ts:32](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L32) ___ @@ -112,7 +112,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-collection.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L27) +[packages/medusa/src/services/product-collection.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L27) ## Methods @@ -133,7 +133,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-collection.ts:174](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L174) +[packages/medusa/src/services/product-collection.ts:181](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L181) ___ @@ -172,7 +172,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -196,7 +196,7 @@ created collection #### Defined in -[packages/medusa/src/services/product-collection.ts:107](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L107) +[packages/medusa/src/services/product-collection.ts:114](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L114) ___ @@ -220,7 +220,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-collection.ts:156](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L156) +[packages/medusa/src/services/product-collection.ts:163](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L163) ___ @@ -247,7 +247,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-collection.ts:212](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L212) +[packages/medusa/src/services/product-collection.ts:219](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L219) ___ @@ -272,7 +272,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-collection.ts:229](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L229) +[packages/medusa/src/services/product-collection.ts:236](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L236) ___ @@ -293,7 +293,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:191](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L191) +[packages/medusa/src/services/product-collection.ts:198](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L198) ___ @@ -318,7 +318,7 @@ the collection. #### Defined in -[packages/medusa/src/services/product-collection.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L54) +[packages/medusa/src/services/product-collection.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L54) ___ @@ -343,7 +343,7 @@ the collection. #### Defined in -[packages/medusa/src/services/product-collection.ts:81](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L81) +[packages/medusa/src/services/product-collection.ts:88](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L88) ___ @@ -367,7 +367,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -392,7 +392,7 @@ update collection #### Defined in -[packages/medusa/src/services/product-collection.ts:126](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-collection.ts#L126) +[packages/medusa/src/services/product-collection.ts:133](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-collection.ts#L133) ___ @@ -416,4 +416,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ProductService.md b/docs/content/references/services/classes/ProductService.md index 2e45cde90f..c55c95f8b0 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:73](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L73) +[packages/medusa/src/services/product.ts:73](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L73) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:63](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L63) +[packages/medusa/src/services/product.ts:63](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L63) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L64) +[packages/medusa/src/services/product.ts:64](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L64) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:60](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L60) +[packages/medusa/src/services/product.ts:60](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L60) ___ @@ -96,7 +96,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L52) +[packages/medusa/src/services/product.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L52) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L55) +[packages/medusa/src/services/product.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L55) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:56](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L56) +[packages/medusa/src/services/product.ts:56](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L56) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:59](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L59) +[packages/medusa/src/services/product.ts:59](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L59) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:58](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L58) +[packages/medusa/src/services/product.ts:58](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L58) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:57](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L57) +[packages/medusa/src/services/product.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L57) ___ @@ -156,7 +156,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:61](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L61) +[packages/medusa/src/services/product.ts:61](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L61) ___ @@ -166,7 +166,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L62) +[packages/medusa/src/services/product.ts:62](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L62) ___ @@ -180,7 +180,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L53) +[packages/medusa/src/services/product.ts:53](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L53) ___ @@ -198,7 +198,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:67](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L67) +[packages/medusa/src/services/product.ts:67](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L67) ___ @@ -208,7 +208,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:66](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L66) +[packages/medusa/src/services/product.ts:66](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L66) ## Methods @@ -235,7 +235,7 @@ the result of the model update operation #### Defined in -[packages/medusa/src/services/product.ts:619](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L619) +[packages/medusa/src/services/product.ts:663](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L663) ___ @@ -274,7 +274,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -298,7 +298,7 @@ the result of the count operation #### Defined in -[packages/medusa/src/services/product.ts:164](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L164) +[packages/medusa/src/services/product.ts:164](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L164) ___ @@ -322,7 +322,7 @@ resolves to the creation result. #### Defined in -[packages/medusa/src/services/product.ts:332](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L332) +[packages/medusa/src/services/product.ts:376](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L376) ___ @@ -347,7 +347,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product.ts:585](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L585) +[packages/medusa/src/services/product.ts:629](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L629) ___ @@ -372,7 +372,7 @@ the updated product #### Defined in -[packages/medusa/src/services/product.ts:784](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L784) +[packages/medusa/src/services/product.ts:828](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L828) ___ @@ -394,7 +394,30 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:278](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L278) +[packages/medusa/src/services/product.ts:299](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L299) + +___ + +### isProductInSalesChannels + +▸ **isProductInSalesChannels**(`id`, `salesChannelIds`): `Promise`<`boolean`\> + +Check if the product is assigned to at least one of the provided sales channels. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `id` | `string` | product id | +| `salesChannelIds` | `string`[] | an array of sales channel ids | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[packages/medusa/src/services/product.ts:354](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L354) ___ @@ -419,7 +442,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product.ts:110](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L110) +[packages/medusa/src/services/product.ts:110](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L110) ___ @@ -447,7 +470,7 @@ an array containing the products as #### Defined in -[packages/medusa/src/services/product.ts:134](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L134) +[packages/medusa/src/services/product.ts:134](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L134) ___ @@ -467,7 +490,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:318](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L318) +[packages/medusa/src/services/product.ts:339](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L339) ___ @@ -481,7 +504,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:309](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L309) +[packages/medusa/src/services/product.ts:330](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L330) ___ @@ -513,7 +536,7 @@ an object containing the query, relations and free-text #### Defined in -[packages/medusa/src/services/product.ts:856](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L856) +[packages/medusa/src/services/product.ts:900](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L900) ___ @@ -534,7 +557,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:662](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L662) +[packages/medusa/src/services/product.ts:706](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L706) ___ @@ -560,7 +583,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:179](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L179) +[packages/medusa/src/services/product.ts:179](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L179) ___ @@ -586,7 +609,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:209](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L209) +[packages/medusa/src/services/product.ts:223](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L223) ___ @@ -612,7 +635,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:195](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L195) +[packages/medusa/src/services/product.ts:202](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L202) ___ @@ -637,7 +660,7 @@ product option #### Defined in -[packages/medusa/src/services/product.ts:765](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L765) +[packages/medusa/src/services/product.ts:809](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L809) ___ @@ -662,7 +685,7 @@ an array of variants #### Defined in -[packages/medusa/src/services/product.ts:260](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L260) +[packages/medusa/src/services/product.ts:281](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L281) ___ @@ -688,7 +711,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:224](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L224) +[packages/medusa/src/services/product.ts:245](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L245) ___ @@ -712,7 +735,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -739,7 +762,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/product.ts:427](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L427) +[packages/medusa/src/services/product.ts:471](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L471) ___ @@ -766,7 +789,7 @@ the updated product #### Defined in -[packages/medusa/src/services/product.ts:708](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product.ts#L708) +[packages/medusa/src/services/product.ts:752](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product.ts#L752) ___ @@ -790,4 +813,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ProductTypeService.md b/docs/content/references/services/classes/ProductTypeService.md index 0860610e84..34b6b534cb 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/105c68929/packages/medusa/src/services/product-type.ts#L15) +[packages/medusa/src/services/product-type.ts:15](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-type.ts#L15) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-type.ts#L10) +[packages/medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-type.ts#L10) ___ @@ -80,7 +80,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-type.ts:11](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-type.ts#L11) +[packages/medusa/src/services/product-type.ts:11](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-type.ts#L11) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-type.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-type.ts#L13) +[packages/medusa/src/services/product-type.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-type.ts#L13) ## Methods @@ -129,7 +129,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -154,7 +154,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-type.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-type.ts#L55) +[packages/medusa/src/services/product-type.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-type.ts#L55) ___ @@ -179,7 +179,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-type.ts:72](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-type.ts#L72) +[packages/medusa/src/services/product-type.ts:72](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-type.ts#L72) ___ @@ -205,7 +205,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product-type.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-type.ts#L30) +[packages/medusa/src/services/product-type.ts:30](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-type.ts#L30) ___ @@ -229,7 +229,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -253,4 +253,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ProductVariantService.md b/docs/content/references/services/classes/ProductVariantService.md index d2eabcfced..e2336a3de7 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:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L53) +[packages/medusa/src/services/product-variant.ts:53](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L53) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L51) +[packages/medusa/src/services/product-variant.ts:51](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L51) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L46) +[packages/medusa/src/services/product-variant.ts:46](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L46) ___ @@ -86,7 +86,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-variant.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L41) +[packages/medusa/src/services/product-variant.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L41) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L49) +[packages/medusa/src/services/product-variant.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L49) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L48) +[packages/medusa/src/services/product-variant.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L48) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L50) +[packages/medusa/src/services/product-variant.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L50) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L45) +[packages/medusa/src/services/product-variant.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L45) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L44) +[packages/medusa/src/services/product-variant.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L44) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L47) +[packages/medusa/src/services/product-variant.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L47) ___ @@ -160,7 +160,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-variant.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L42) +[packages/medusa/src/services/product-variant.ts:42](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L42) ___ @@ -178,7 +178,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L35) +[packages/medusa/src/services/product-variant.ts:35](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L35) ## Methods @@ -208,7 +208,7 @@ the result of the update operation. #### Defined in -[packages/medusa/src/services/product-variant.ts:498](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L498) +[packages/medusa/src/services/product-variant.ts:498](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L498) ___ @@ -247,7 +247,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -273,7 +273,7 @@ resolves to the creation result. #### Defined in -[packages/medusa/src/services/product-variant.ts:147](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L147) +[packages/medusa/src/services/product-variant.ts:147](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L147) ___ @@ -298,7 +298,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:651](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L651) +[packages/medusa/src/services/product-variant.ts:651](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L651) ___ @@ -324,7 +324,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:525](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L525) +[packages/medusa/src/services/product-variant.ts:525](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L525) ___ @@ -352,7 +352,7 @@ an array containing the products as the first element and the total #### Defined in -[packages/medusa/src/services/product-variant.ts:724](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L724) +[packages/medusa/src/services/product-variant.ts:724](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L724) ___ @@ -379,7 +379,7 @@ the price specific to the region #### Defined in -[packages/medusa/src/services/product-variant.ts:374](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L374) +[packages/medusa/src/services/product-variant.ts:374](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L374) ___ @@ -402,7 +402,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-variant.ts:593](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L593) +[packages/medusa/src/services/product-variant.ts:593](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L593) ___ @@ -425,7 +425,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-variant.ts:552](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L552) +[packages/medusa/src/services/product-variant.ts:552](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L552) ___ @@ -457,7 +457,7 @@ an object containing the query, relations and free-text #### Defined in -[packages/medusa/src/services/product-variant.ts:685](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L685) +[packages/medusa/src/services/product-variant.ts:685](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L685) ___ @@ -482,7 +482,7 @@ the product document. #### Defined in -[packages/medusa/src/services/product-variant.ts:83](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L83) +[packages/medusa/src/services/product-variant.ts:83](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L83) ___ @@ -507,7 +507,7 @@ the product document. #### Defined in -[packages/medusa/src/services/product-variant.ts:111](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L111) +[packages/medusa/src/services/product-variant.ts:111](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L111) ___ @@ -532,7 +532,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/product-variant.ts:439](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L439) +[packages/medusa/src/services/product-variant.ts:439](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L439) ___ @@ -557,7 +557,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/product-variant.ts:403](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L403) +[packages/medusa/src/services/product-variant.ts:403](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L403) ___ @@ -581,7 +581,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -608,7 +608,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/product-variant.ts:255](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L255) +[packages/medusa/src/services/product-variant.ts:255](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L255) ___ @@ -635,7 +635,7 @@ the result of the update operation. #### Defined in -[packages/medusa/src/services/product-variant.ts:460](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L460) +[packages/medusa/src/services/product-variant.ts:460](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L460) ___ @@ -661,7 +661,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:333](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/product-variant.ts#L333) +[packages/medusa/src/services/product-variant.ts:333](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/product-variant.ts#L333) ___ @@ -685,4 +685,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/RegionService.md b/docs/content/references/services/classes/RegionService.md index 047ee55cd9..9ef8930719 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/105c68929/packages/medusa/src/services/region.ts#L67) +[packages/medusa/src/services/region.ts:67](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L67) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:59](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L59) +[packages/medusa/src/services/region.ts:59](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L59) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:60](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L60) +[packages/medusa/src/services/region.ts:60](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L60) ___ @@ -84,7 +84,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L54) +[packages/medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L54) ___ @@ -94,7 +94,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L52) +[packages/medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L52) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L64) +[packages/medusa/src/services/region.ts:64](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L64) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L57) +[packages/medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L57) ___ @@ -128,7 +128,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/region.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L50) +[packages/medusa/src/services/region.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L50) ___ @@ -138,7 +138,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L62) +[packages/medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L62) ___ @@ -148,7 +148,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L56) +[packages/medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L56) ___ @@ -158,7 +158,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:58](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L58) +[packages/medusa/src/services/region.ts:58](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L58) ___ @@ -168,7 +168,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L55) +[packages/medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L55) ___ @@ -178,7 +178,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:65](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L65) +[packages/medusa/src/services/region.ts:65](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L65) ___ @@ -192,7 +192,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/region.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L51) +[packages/medusa/src/services/region.ts:51](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L51) ___ @@ -210,7 +210,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L44) +[packages/medusa/src/services/region.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L44) ## Methods @@ -235,7 +235,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:573](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L573) +[packages/medusa/src/services/region.ts:580](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L580) ___ @@ -261,7 +261,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:703](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L703) +[packages/medusa/src/services/region.ts:710](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L710) ___ @@ -287,7 +287,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:652](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L652) +[packages/medusa/src/services/region.ts:659](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L659) ___ @@ -326,7 +326,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -350,7 +350,7 @@ the newly created region #### Defined in -[packages/medusa/src/services/region.ts:117](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L117) +[packages/medusa/src/services/region.ts:117](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L117) ___ @@ -374,7 +374,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/region.ts:542](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L542) +[packages/medusa/src/services/region.ts:549](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L549) ___ @@ -399,7 +399,7 @@ result of the find operation #### Defined in -[packages/medusa/src/services/region.ts:522](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L522) +[packages/medusa/src/services/region.ts:529](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L529) ___ @@ -424,7 +424,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:611](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L611) +[packages/medusa/src/services/region.ts:618](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L618) ___ @@ -449,7 +449,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:791](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L791) +[packages/medusa/src/services/region.ts:798](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L798) ___ @@ -474,7 +474,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:752](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L752) +[packages/medusa/src/services/region.ts:759](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L759) ___ @@ -499,7 +499,7 @@ the region #### Defined in -[packages/medusa/src/services/region.ts:494](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L494) +[packages/medusa/src/services/region.ts:494](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L494) ___ @@ -524,7 +524,7 @@ a Region with country code #### Defined in -[packages/medusa/src/services/region.ts:437](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L437) +[packages/medusa/src/services/region.ts:437](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L437) ___ @@ -548,7 +548,7 @@ region with the matching name #### Defined in -[packages/medusa/src/services/region.ts:474](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L474) +[packages/medusa/src/services/region.ts:474](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L474) ___ @@ -572,7 +572,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -597,7 +597,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/region.ts:190](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L190) +[packages/medusa/src/services/region.ts:190](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L190) ___ @@ -623,7 +623,7 @@ the validated Country #### Defined in -[packages/medusa/src/services/region.ts:388](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L388) +[packages/medusa/src/services/region.ts:388](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L388) ___ @@ -651,7 +651,7 @@ void #### Defined in -[packages/medusa/src/services/region.ts:363](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L363) +[packages/medusa/src/services/region.ts:363](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L363) ___ @@ -672,7 +672,7 @@ the id can be passed to check that country updates are allowed. | Name | Type | Description | | :------ | :------ | :------ | -| `regionData` | `Omit`<`T`, ``"currency_code"`` \| ``"metadata"``\> | the region data to validate | +| `regionData` | `Omit`<`T`, ``"metadata"`` \| ``"currency_code"``\> | the region data to validate | | `id?` | `T` extends `UpdateRegionInput` ? `string` : `undefined` | optional id of the region to check against | #### Returns @@ -683,7 +683,7 @@ the validated region data #### Defined in -[packages/medusa/src/services/region.ts:261](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L261) +[packages/medusa/src/services/region.ts:261](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L261) ___ @@ -711,7 +711,7 @@ void #### Defined in -[packages/medusa/src/services/region.ts:347](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/region.ts#L347) +[packages/medusa/src/services/region.ts:347](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/region.ts#L347) ___ @@ -735,4 +735,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ReturnReasonService.md b/docs/content/references/services/classes/ReturnReasonService.md index 337b0b668e..cfb5606c0b 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/105c68929/packages/medusa/src/services/return-reason.ts#L21) +[packages/medusa/src/services/return-reason.ts:21](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return-reason.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return-reason.ts#L18) +[packages/medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return-reason.ts#L18) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return-reason.ts#L16) +[packages/medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return-reason.ts#L16) ___ @@ -90,7 +90,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/return-reason.ts:19](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return-reason.ts#L19) +[packages/medusa/src/services/return-reason.ts:19](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return-reason.ts#L19) ## Methods @@ -129,7 +129,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -149,7 +149,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return-reason.ts#L29) +[packages/medusa/src/services/return-reason.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return-reason.ts#L29) ___ @@ -169,7 +169,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:110](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return-reason.ts#L110) +[packages/medusa/src/services/return-reason.ts:117](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return-reason.ts#L117) ___ @@ -192,13 +192,13 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/return-reason.ts:72](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return-reason.ts#L72) +[packages/medusa/src/services/return-reason.ts:72](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return-reason.ts#L72) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`ReturnReason`\> +▸ **retrieve**(`returnReasonId`, `config?`): `Promise`<`ReturnReason`\> Gets an order by id. @@ -206,7 +206,7 @@ Gets an order by id. | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `string` | id of order to retrieve | +| `returnReasonId` | `string` | id of order to retrieve | | `config` | `FindConfig`<`ReturnReason`\> | config object | #### Returns @@ -217,7 +217,7 @@ the order document #### Defined in -[packages/medusa/src/services/return-reason.ts:91](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return-reason.ts#L91) +[packages/medusa/src/services/return-reason.ts:91](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return-reason.ts#L91) ___ @@ -241,7 +241,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -262,7 +262,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return-reason.ts#L50) +[packages/medusa/src/services/return-reason.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return-reason.ts#L50) ___ @@ -286,4 +286,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ReturnService.md b/docs/content/references/services/classes/ReturnService.md index b535202652..93eb063ff5 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:64](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L64) +[packages/medusa/src/services/return.ts:63](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L63) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L59) +[packages/medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L58) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:61](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L61) +[packages/medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L60) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L56) +[packages/medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L55) ___ @@ -96,7 +96,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/return.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L50) +[packages/medusa/src/services/return.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L49) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:62](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L62) +[packages/medusa/src/services/return.ts:61](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L61) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L55) +[packages/medusa/src/services/return.ts:54](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L54) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L60) +[packages/medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L59) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L54) +[packages/medusa/src/services/return.ts:53](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L53) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L58) +[packages/medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L57) ___ @@ -156,7 +156,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L57) +[packages/medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L56) ___ @@ -166,7 +166,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L53) +[packages/medusa/src/services/return.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L52) ___ @@ -180,7 +180,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/return.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L51) +[packages/medusa/src/services/return.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L50) ## Methods @@ -219,7 +219,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -243,7 +243,7 @@ the updated Return #### Defined in -[packages/medusa/src/services/return.ts:160](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L160) +[packages/medusa/src/services/return.ts:159](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L159) ___ @@ -269,7 +269,7 @@ the created return #### Defined in -[packages/medusa/src/services/return.ts:338](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L338) +[packages/medusa/src/services/return.ts:344](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L344) ___ @@ -289,7 +289,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:484](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L484) +[packages/medusa/src/services/return.ts:490](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L490) ___ @@ -315,7 +315,7 @@ the line items generated by the transformer. #### Defined in -[packages/medusa/src/services/return.ts:102](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L102) +[packages/medusa/src/services/return.ts:101](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L101) ___ @@ -338,7 +338,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/return.ts:142](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L142) +[packages/medusa/src/services/return.ts:141](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L141) ___ @@ -371,13 +371,13 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/return.ts:555](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L555) +[packages/medusa/src/services/return.ts:561](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L561) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`Return`\> +▸ **retrieve**(`returnId`, `config?`): `Promise`<`Return`\> Retrieves a return by its id. @@ -385,7 +385,7 @@ Retrieves a return by its id. | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `string` | the id of the return to retrieve | +| `returnId` | `string` | the id of the return to retrieve | | `config` | `FindConfig`<`Return`\> | the config object | #### Returns @@ -396,7 +396,7 @@ the return #### Defined in -[packages/medusa/src/services/return.ts:258](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L258) +[packages/medusa/src/services/return.ts:257](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L257) ___ @@ -417,7 +417,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:279](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L279) +[packages/medusa/src/services/return.ts:285](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L285) ___ @@ -441,7 +441,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -462,7 +462,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:304](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L304) +[packages/medusa/src/services/return.ts:310](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L310) ___ @@ -537,7 +537,7 @@ a line item where the quantity is set to the requested #### Defined in -[packages/medusa/src/services/return.ts:216](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L216) +[packages/medusa/src/services/return.ts:215](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L215) ___ @@ -565,7 +565,7 @@ when statuses are not sufficient for returns. #### Defined in -[packages/medusa/src/services/return.ts:186](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/return.ts#L186) +[packages/medusa/src/services/return.ts:185](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/return.ts#L185) ___ @@ -589,4 +589,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/SalesChannelService.md b/docs/content/references/services/classes/SalesChannelService.md index 4480b1fbf1..8a11127827 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/105c68929/packages/medusa/src/services/sales-channel.ts#L37) +[packages/medusa/src/services/sales-channel.ts:37](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L37) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L34) +[packages/medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L34) ___ @@ -76,7 +76,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L30) +[packages/medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L30) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:33](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L33) +[packages/medusa/src/services/sales-channel.ts:33](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L33) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:35](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L35) +[packages/medusa/src/services/sales-channel.ts:35](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L35) ___ @@ -110,7 +110,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L31) +[packages/medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L31) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L24) +[packages/medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L24) ## Methods @@ -153,7 +153,7 @@ the sales channel on which the products have been added #### Defined in -[packages/medusa/src/services/sales-channel.ts:305](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L305) +[packages/medusa/src/services/sales-channel.ts:319](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L319) ___ @@ -192,7 +192,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -219,7 +219,7 @@ the created channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:162](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L162) +[packages/medusa/src/services/sales-channel.ts:176](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L176) ___ @@ -237,7 +237,7 @@ the sales channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:252](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L252) +[packages/medusa/src/services/sales-channel.ts:266](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L266) ___ @@ -261,7 +261,7 @@ To use this feature please enable the corresponding feature flag in your medusa #### Defined in -[packages/medusa/src/services/sales-channel.ts:213](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L213) +[packages/medusa/src/services/sales-channel.ts:227](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L227) ___ @@ -289,7 +289,7 @@ an array containing the sales channels as #### Defined in -[packages/medusa/src/services/sales-channel.ts:127](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L127) +[packages/medusa/src/services/sales-channel.ts:141](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L141) ___ @@ -314,7 +314,7 @@ the sales channel on which the products have been removed #### Defined in -[packages/medusa/src/services/sales-channel.ts:284](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L284) +[packages/medusa/src/services/sales-channel.ts:298](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L298) ___ @@ -339,7 +339,7 @@ a sales channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:99](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L99) +[packages/medusa/src/services/sales-channel.ts:99](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L99) ___ @@ -364,7 +364,7 @@ a sales channel with matching name #### Defined in -[packages/medusa/src/services/sales-channel.ts:113](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L113) +[packages/medusa/src/services/sales-channel.ts:120](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L120) ___ @@ -389,7 +389,7 @@ a single SC matching the query or throws #### Defined in -[packages/medusa/src/services/sales-channel.ts:59](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L59) +[packages/medusa/src/services/sales-channel.ts:59](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L59) ___ @@ -413,7 +413,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -434,7 +434,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:179](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/sales-channel.ts#L179) +[packages/medusa/src/services/sales-channel.ts:193](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/sales-channel.ts#L193) ___ @@ -458,4 +458,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/SearchService.md b/docs/content/references/services/classes/SearchService.md index c18e915411..d53f98a440 100644 --- a/docs/content/references/services/classes/SearchService.md +++ b/docs/content/references/services/classes/SearchService.md @@ -25,7 +25,7 @@ AbstractSearchService.constructor #### Defined in -[packages/medusa/src/services/search.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L18) +[packages/medusa/src/services/search.ts:18](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L18) ## Properties @@ -39,7 +39,7 @@ AbstractSearchService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -53,7 +53,7 @@ AbstractSearchService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -67,7 +67,7 @@ AbstractSearchService.isDefault #### Defined in -[packages/medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L11) +[packages/medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L11) ___ @@ -77,7 +77,7 @@ ___ #### Defined in -[packages/medusa/src/services/search.ts:15](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L15) +[packages/medusa/src/services/search.ts:15](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L15) ___ @@ -91,7 +91,7 @@ AbstractSearchService.manager\_ #### Defined in -[packages/medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L13) +[packages/medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L13) ___ @@ -105,7 +105,7 @@ AbstractSearchService.options\_ #### Defined in -[packages/medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L16) +[packages/medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L16) ___ @@ -119,7 +119,7 @@ AbstractSearchService.transactionManager\_ #### Defined in -[packages/medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L14) +[packages/medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L14) ## Accessors @@ -137,7 +137,7 @@ AbstractSearchService.options #### Defined in -[packages/medusa/src/interfaces/search-service.ts:82](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/search-service.ts#L82) +[packages/medusa/src/interfaces/search-service.ts:82](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/search-service.ts#L82) ## Methods @@ -163,7 +163,7 @@ AbstractSearchService.addDocuments #### Defined in -[packages/medusa/src/services/search.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L43) +[packages/medusa/src/services/search.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L43) ___ @@ -202,7 +202,7 @@ AbstractSearchService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -227,7 +227,7 @@ AbstractSearchService.createIndex #### Defined in -[packages/medusa/src/services/search.ts:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L31) +[packages/medusa/src/services/search.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L31) ___ @@ -251,7 +251,7 @@ AbstractSearchService.deleteAllDocuments #### Defined in -[packages/medusa/src/services/search.ts:72](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L72) +[packages/medusa/src/services/search.ts:72](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L72) ___ @@ -276,7 +276,7 @@ AbstractSearchService.deleteDocument #### Defined in -[packages/medusa/src/services/search.ts:63](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L63) +[packages/medusa/src/services/search.ts:63](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L63) ___ @@ -300,7 +300,7 @@ AbstractSearchService.getIndex #### Defined in -[packages/medusa/src/services/search.ts:37](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L37) +[packages/medusa/src/services/search.ts:37](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L37) ___ @@ -326,7 +326,7 @@ AbstractSearchService.replaceDocuments #### Defined in -[packages/medusa/src/services/search.ts:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L53) +[packages/medusa/src/services/search.ts:53](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L53) ___ @@ -352,7 +352,7 @@ AbstractSearchService.search #### Defined in -[packages/medusa/src/services/search.ts:78](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L78) +[packages/medusa/src/services/search.ts:78](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L78) ___ @@ -376,7 +376,7 @@ AbstractSearchService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -401,7 +401,7 @@ AbstractSearchService.updateSettings #### Defined in -[packages/medusa/src/services/search.ts:89](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/search.ts#L89) +[packages/medusa/src/services/search.ts:89](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/search.ts#L89) ___ @@ -425,4 +425,4 @@ AbstractSearchService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ShippingOptionService.md b/docs/content/references/services/classes/ShippingOptionService.md index 7c61ad65e2..469452b120 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:54](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L54) +[packages/medusa/src/services/shipping-option.ts:55](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L55) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L49) +[packages/medusa/src/services/shipping-option.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L50) ___ @@ -78,7 +78,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/shipping-option.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L51) +[packages/medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L52) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L48) +[packages/medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L49) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L47) +[packages/medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L48) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L43) +[packages/medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L44) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L44) +[packages/medusa/src/services/shipping-option.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L45) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L46) +[packages/medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L47) ___ @@ -142,7 +142,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L52) +[packages/medusa/src/services/shipping-option.ts:53](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L53) ## Methods @@ -168,7 +168,7 @@ the result of update #### Defined in -[packages/medusa/src/services/shipping-option.ts:665](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L665) +[packages/medusa/src/services/shipping-option.ts:709](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L709) ___ @@ -207,7 +207,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -233,7 +233,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/shipping-option.ts:407](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L407) +[packages/medusa/src/services/shipping-option.ts:451](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L451) ___ @@ -259,7 +259,7 @@ the resulting shipping method. #### Defined in -[packages/medusa/src/services/shipping-option.ts:270](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L270) +[packages/medusa/src/services/shipping-option.ts:278](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L278) ___ @@ -283,7 +283,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/shipping-option.ts:643](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L643) +[packages/medusa/src/services/shipping-option.ts:687](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L687) ___ @@ -307,7 +307,7 @@ removed shipping methods #### Defined in -[packages/medusa/src/services/shipping-option.ts:250](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L250) +[packages/medusa/src/services/shipping-option.ts:258](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L258) ___ @@ -335,7 +335,7 @@ the price of the shipping option. #### Defined in -[packages/medusa/src/services/shipping-option.ts:724](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L724) +[packages/medusa/src/services/shipping-option.ts:768](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L768) ___ @@ -358,7 +358,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/shipping-option.ts:147](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L147) +[packages/medusa/src/services/shipping-option.ts:148](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L148) ___ @@ -381,7 +381,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/shipping-option.ts:163](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L163) +[packages/medusa/src/services/shipping-option.ts:164](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L164) ___ @@ -405,7 +405,7 @@ the result of update #### Defined in -[packages/medusa/src/services/shipping-option.ts:694](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L694) +[packages/medusa/src/services/shipping-option.ts:738](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L738) ___ @@ -433,7 +433,7 @@ the profile document. #### Defined in -[packages/medusa/src/services/shipping-option.ts:181](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L181) +[packages/medusa/src/services/shipping-option.ts:182](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L182) ___ @@ -457,7 +457,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -484,7 +484,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/shipping-option.ts:529](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L529) +[packages/medusa/src/services/shipping-option.ts:579](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L579) ___ @@ -510,7 +510,28 @@ the resulting shipping method #### Defined in -[packages/medusa/src/services/shipping-option.ts:221](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L221) +[packages/medusa/src/services/shipping-option.ts:229](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L229) + +___ + +### validateAndMutatePrice + +▸ `Private` **validateAndMutatePrice**(`option`, `priceInput`): `Promise`<`CreateShippingOptionInput` \| `Omit`<`ShippingOption`, ``"beforeInsert"``\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `option` | `ShippingOption` \| `CreateShippingOptionInput` | +| `priceInput` | `ValidatePriceTypeAndAmountInput` | + +#### Returns + +`Promise`<`CreateShippingOptionInput` \| `Omit`<`ShippingOption`, ``"beforeInsert"``\>\> + +#### Defined in + +[packages/medusa/src/services/shipping-option.ts:408](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L408) ___ @@ -537,7 +558,7 @@ the validated shipping option #### Defined in -[packages/medusa/src/services/shipping-option.ts:358](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L358) +[packages/medusa/src/services/shipping-option.ts:366](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L366) ___ @@ -562,7 +583,7 @@ the validated price #### Defined in -[packages/medusa/src/services/shipping-option.ts:493](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L493) +[packages/medusa/src/services/shipping-option.ts:539](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L539) ___ @@ -587,7 +608,7 @@ a validated shipping requirement #### Defined in -[packages/medusa/src/services/shipping-option.ts:81](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-option.ts#L81) +[packages/medusa/src/services/shipping-option.ts:82](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-option.ts#L82) ___ @@ -611,4 +632,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/ShippingProfileService.md b/docs/content/references/services/classes/ShippingProfileService.md index f59d52027e..f0e4da3bb2 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/105c68929/packages/medusa/src/services/shipping-profile.ts#L48) +[packages/medusa/src/services/shipping-profile.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L48) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L40) +[packages/medusa/src/services/shipping-profile.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L40) ___ @@ -80,7 +80,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L45) +[packages/medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L45) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L43) +[packages/medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L43) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L38) +[packages/medusa/src/services/shipping-profile.ts:38](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L38) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:39](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L39) +[packages/medusa/src/services/shipping-profile.ts:39](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L39) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L42) +[packages/medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L42) ___ @@ -134,7 +134,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L46) +[packages/medusa/src/services/shipping-profile.ts:46](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L46) ## Methods @@ -160,7 +160,7 @@ the result of update #### Defined in -[packages/medusa/src/services/shipping-profile.ts:354](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L354) +[packages/medusa/src/services/shipping-profile.ts:361](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L361) ___ @@ -186,7 +186,7 @@ the result of the model update operation #### Defined in -[packages/medusa/src/services/shipping-profile.ts:374](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L374) +[packages/medusa/src/services/shipping-profile.ts:381](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L381) ___ @@ -225,7 +225,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -249,7 +249,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/shipping-profile.ts:243](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L243) +[packages/medusa/src/services/shipping-profile.ts:250](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L250) ___ @@ -267,7 +267,7 @@ the shipping profile #### Defined in -[packages/medusa/src/services/shipping-profile.ts:173](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L173) +[packages/medusa/src/services/shipping-profile.ts:180](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L180) ___ @@ -286,7 +286,7 @@ the shipping profile #### Defined in -[packages/medusa/src/services/shipping-profile.ts:217](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L217) +[packages/medusa/src/services/shipping-profile.ts:224](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L224) ___ @@ -310,7 +310,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/shipping-profile.ts:328](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L328) +[packages/medusa/src/services/shipping-profile.ts:335](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L335) ___ @@ -335,7 +335,7 @@ a list of the available shipping options #### Defined in -[packages/medusa/src/services/shipping-profile.ts:394](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L394) +[packages/medusa/src/services/shipping-profile.ts:401](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L401) ___ @@ -356,7 +356,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:83](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L83) +[packages/medusa/src/services/shipping-profile.ts:83](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L83) ___ @@ -380,7 +380,7 @@ a list of product ids #### Defined in -[packages/medusa/src/services/shipping-profile.ts:460](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L460) +[packages/medusa/src/services/shipping-profile.ts:467](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L467) ___ @@ -403,7 +403,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/shipping-profile.ts:71](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L71) +[packages/medusa/src/services/shipping-profile.ts:71](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L71) ___ @@ -429,7 +429,7 @@ the profile document. #### Defined in -[packages/medusa/src/services/shipping-profile.ts:135](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L135) +[packages/medusa/src/services/shipping-profile.ts:135](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L135) ___ @@ -443,7 +443,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:157](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L157) +[packages/medusa/src/services/shipping-profile.ts:164](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L164) ___ @@ -461,7 +461,7 @@ the shipping profile for gift cards #### Defined in -[packages/medusa/src/services/shipping-profile.ts:200](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L200) +[packages/medusa/src/services/shipping-profile.ts:207](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L207) ___ @@ -485,7 +485,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -512,7 +512,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/shipping-profile.ts:271](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/shipping-profile.ts#L271) +[packages/medusa/src/services/shipping-profile.ts:278](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/shipping-profile.ts#L278) ___ @@ -536,4 +536,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/StoreService.md b/docs/content/references/services/classes/StoreService.md index ad204a754a..a12709163f 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/105c68929/packages/medusa/src/services/store.ts#L31) +[packages/medusa/src/services/store.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L31) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L28) +[packages/medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L28) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L29) +[packages/medusa/src/services/store.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L29) ___ @@ -88,7 +88,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L24) +[packages/medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L24) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L27) +[packages/medusa/src/services/store.ts:27](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L27) ___ @@ -112,7 +112,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L25) +[packages/medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L25) ## Methods @@ -136,7 +136,7 @@ result after update #### Defined in -[packages/medusa/src/services/store.ts:204](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L204) +[packages/medusa/src/services/store.ts:204](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L204) ___ @@ -175,7 +175,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -193,7 +193,7 @@ The store. #### Defined in -[packages/medusa/src/services/store.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L49) +[packages/medusa/src/services/store.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L49) ___ @@ -213,7 +213,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:98](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L98) +[packages/medusa/src/services/store.ts:98](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L98) ___ @@ -237,7 +237,7 @@ result after update #### Defined in -[packages/medusa/src/services/store.ts:248](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L248) +[packages/medusa/src/services/store.ts:248](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L248) ___ @@ -261,7 +261,7 @@ the store #### Defined in -[packages/medusa/src/services/store.ts:85](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L85) +[packages/medusa/src/services/store.ts:85](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L85) ___ @@ -285,7 +285,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -309,7 +309,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/store.ts:114](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/store.ts#L114) +[packages/medusa/src/services/store.ts:114](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/store.ts#L114) ___ @@ -333,4 +333,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/StrategyResolverService.md b/docs/content/references/services/classes/StrategyResolverService.md index 7f7907bc9b..e2adc4be5c 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/105c68929/packages/medusa/src/services/strategy-resolver.ts#L14) +[packages/medusa/src/services/strategy-resolver.ts:14](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/strategy-resolver.ts#L14) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:14](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/strategy-resolver.ts#L14) +[packages/medusa/src/services/strategy-resolver.ts:14](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/strategy-resolver.ts#L14) ___ @@ -76,7 +76,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/strategy-resolver.ts#L11) +[packages/medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/strategy-resolver.ts#L11) ___ @@ -90,7 +90,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:12](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/strategy-resolver.ts#L12) +[packages/medusa/src/services/strategy-resolver.ts:12](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/strategy-resolver.ts#L12) ## Methods @@ -129,7 +129,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -149,7 +149,7 @@ ___ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:19](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/strategy-resolver.ts#L19) +[packages/medusa/src/services/strategy-resolver.ts:19](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/strategy-resolver.ts#L19) ___ @@ -173,7 +173,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -197,4 +197,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/SwapService.md b/docs/content/references/services/classes/SwapService.md index 99de524413..09e1a72af3 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:93](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L93) +[packages/medusa/src/services/swap.ts:93](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L93) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L80) +[packages/medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L80) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:91](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L91) +[packages/medusa/src/services/swap.ts:91](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L91) ___ @@ -84,7 +84,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:81](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L81) +[packages/medusa/src/services/swap.ts:81](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L81) ___ @@ -94,7 +94,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L87) +[packages/medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L87) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L86) +[packages/medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L86) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:90](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L90) +[packages/medusa/src/services/swap.ts:90](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L90) ___ @@ -124,7 +124,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L85) +[packages/medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L85) ___ @@ -138,7 +138,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/swap.ts:75](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L75) +[packages/medusa/src/services/swap.ts:75](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L75) ___ @@ -148,7 +148,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L82) +[packages/medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L82) ___ @@ -158,7 +158,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:89](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L89) +[packages/medusa/src/services/swap.ts:89](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L89) ___ @@ -168,7 +168,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L83) +[packages/medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L83) ___ @@ -178,7 +178,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:88](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L88) +[packages/medusa/src/services/swap.ts:88](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L88) ___ @@ -188,7 +188,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L78) +[packages/medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L78) ___ @@ -198,7 +198,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L84) +[packages/medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L84) ___ @@ -212,7 +212,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/swap.ts:76](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L76) +[packages/medusa/src/services/swap.ts:76](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L76) ___ @@ -236,7 +236,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:63](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L63) +[packages/medusa/src/services/swap.ts:63](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L63) ## Methods @@ -275,7 +275,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -301,7 +301,7 @@ the canceled swap. #### Defined in -[packages/medusa/src/services/swap.ts:845](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L845) +[packages/medusa/src/services/swap.ts:852](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L852) ___ @@ -325,7 +325,7 @@ updated swap #### Defined in -[packages/medusa/src/services/swap.ts:1046](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L1046) +[packages/medusa/src/services/swap.ts:1053](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L1053) ___ @@ -359,7 +359,7 @@ the newly created swap #### Defined in -[packages/medusa/src/services/swap.ts:307](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L307) +[packages/medusa/src/services/swap.ts:314](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L314) ___ @@ -387,7 +387,7 @@ the swap with its cart_id prop set to the id of the new cart. #### Defined in -[packages/medusa/src/services/swap.ts:556](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L556) +[packages/medusa/src/services/swap.ts:563](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L563) ___ @@ -413,7 +413,7 @@ the updated swap with new status and fulfillments. #### Defined in -[packages/medusa/src/services/swap.ts:907](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L907) +[packages/medusa/src/services/swap.ts:914](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L914) ___ @@ -440,7 +440,7 @@ the updated swap with new fulfillments and status. #### Defined in -[packages/medusa/src/services/swap.ts:1077](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L1077) +[packages/medusa/src/services/swap.ts:1084](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L1084) ___ @@ -465,7 +465,7 @@ resolves to the updated result. #### Defined in -[packages/medusa/src/services/swap.ts:1155](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L1155) +[packages/medusa/src/services/swap.ts:1162](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L1162) ___ @@ -490,7 +490,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/swap.ts:277](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L277) +[packages/medusa/src/services/swap.ts:284](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L284) ___ @@ -514,7 +514,7 @@ processed swap #### Defined in -[packages/medusa/src/services/swap.ts:400](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L400) +[packages/medusa/src/services/swap.ts:407](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L407) ___ @@ -538,7 +538,7 @@ swap related to the cart #### Defined in -[packages/medusa/src/services/swap.ts:694](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L694) +[packages/medusa/src/services/swap.ts:701](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L701) ___ @@ -563,13 +563,13 @@ the resulting order #### Defined in -[packages/medusa/src/services/swap.ts:1195](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L1195) +[packages/medusa/src/services/swap.ts:1202](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L1202) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`Swap`\> +▸ **retrieve**(`swapId`, `config?`): `Promise`<`Swap`\> Retrieves a swap with the given id. @@ -577,7 +577,7 @@ Retrieves a swap with the given id. | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `string` | the id of the swap to retrieve | +| `swapId` | `string` | the id of the swap to retrieve | | `config` | `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } | the configuration to retrieve the swap | #### Returns @@ -588,7 +588,7 @@ the swap #### Defined in -[packages/medusa/src/services/swap.ts:208](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L208) +[packages/medusa/src/services/swap.ts:208](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L208) ___ @@ -613,7 +613,7 @@ the swap #### Defined in -[packages/medusa/src/services/swap.ts:250](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L250) +[packages/medusa/src/services/swap.ts:257](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L257) ___ @@ -637,7 +637,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -661,7 +661,7 @@ transformed find swap config #### Defined in -[packages/medusa/src/services/swap.ts:135](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L135) +[packages/medusa/src/services/swap.ts:135](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L135) ___ @@ -686,7 +686,7 @@ updated swap record #### Defined in -[packages/medusa/src/services/swap.ts:523](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/swap.ts#L523) +[packages/medusa/src/services/swap.ts:530](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/swap.ts#L530) ___ @@ -710,4 +710,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/SystemPaymentProviderService.md b/docs/content/references/services/classes/SystemPaymentProviderService.md index a7d9006b01..6a9178da25 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/105c68929/packages/medusa/src/services/system-payment-provider.ts#L10) +[packages/medusa/src/services/system-payment-provider.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L10) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:5](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L5) +[packages/medusa/src/services/system-payment-provider.ts:5](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L5) ___ @@ -80,7 +80,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L6) +[packages/medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L6) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:8](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L8) +[packages/medusa/src/services/system-payment-provider.ts:8](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L8) ## Methods @@ -129,7 +129,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -149,7 +149,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L26) +[packages/medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L26) ___ @@ -169,7 +169,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L50) +[packages/medusa/src/services/system-payment-provider.ts:50](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L50) ___ @@ -189,7 +189,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L42) +[packages/medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L42) ___ @@ -209,7 +209,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L14) +[packages/medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L14) ___ @@ -229,7 +229,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L38) +[packages/medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L38) ___ @@ -249,7 +249,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L22) +[packages/medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L22) ___ @@ -269,7 +269,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L18) +[packages/medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L18) ___ @@ -289,7 +289,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L46) +[packages/medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L46) ___ @@ -313,7 +313,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -333,7 +333,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L34) +[packages/medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L34) ___ @@ -353,7 +353,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/system-payment-provider.ts#L30) +[packages/medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/system-payment-provider.ts#L30) ___ @@ -377,4 +377,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/TaxProviderService.md b/docs/content/references/services/classes/TaxProviderService.md index 13e7c008c9..adee44a88d 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:53](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L53) +[packages/medusa/src/services/tax-provider.ts:51](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L51) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,17 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) + +___ + +### cacheService\_ + +• `Protected` `Readonly` **cacheService\_**: `ICacheService` + +#### Defined in + +[packages/medusa/src/services/tax-provider.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L44) ___ @@ -64,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L45) +[packages/medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L43) ___ @@ -74,7 +84,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:51](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L51) +[packages/medusa/src/services/tax-provider.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L49) ___ @@ -88,17 +98,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L42) - -___ - -### redis\_ - -• `Protected` `Readonly` **redis\_**: `Redis` - -#### Defined in - -[packages/medusa/src/services/tax-provider.ts:50](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L50) +[packages/medusa/src/services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L40) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L48) +[packages/medusa/src/services/tax-provider.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L47) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L47) +[packages/medusa/src/services/tax-provider.ts:46](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L46) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:49](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L49) +[packages/medusa/src/services/tax-provider.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L48) ___ @@ -138,7 +138,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:46](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L46) +[packages/medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L45) ___ @@ -152,7 +152,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L43) +[packages/medusa/src/services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L41) ## Methods @@ -191,7 +191,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -211,7 +211,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:94](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L94) +[packages/medusa/src/services/tax-provider.ts:97](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L97) ___ @@ -231,7 +231,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:104](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L104) +[packages/medusa/src/services/tax-provider.ts:107](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L107) ___ @@ -257,7 +257,7 @@ the newly created tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:180](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L180) +[packages/medusa/src/services/tax-provider.ts:183](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L183) ___ @@ -282,38 +282,13 @@ the newly created tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:126](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L126) - -___ - -### getCacheEntry - -▸ `Private` **getCacheEntry**(`productId`, `regionId`): `Promise`<``null`` \| `TaxServiceRate`[]\> - -Gets the cache results for a set of ids - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `productId` | `string` | the product id to cache | -| `regionId` | `string` | the region id to cache | - -#### Returns - -`Promise`<``null`` \| `TaxServiceRate`[]\> - -the cached result or null - -#### Defined in - -[packages/medusa/src/services/tax-provider.ts:503](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L503) +[packages/medusa/src/services/tax-provider.ts:129](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L129) ___ ### getCacheKey -▸ `Private` **getCacheKey**(`productId`, `regionId`): `string` +▸ `Private` **getCacheKey**(`id`, `regionId`): `string` The cache key to get cache hits by. @@ -321,7 +296,7 @@ The cache key to get cache hits by. | Name | Type | Description | | :------ | :------ | :------ | -| `productId` | `string` | the product id to cache | +| `id` | `string` | the entity id to cache | | `regionId` | `string` | the region id to cache | #### Returns @@ -332,7 +307,7 @@ the cache key to use for the id set #### Defined in -[packages/medusa/src/services/tax-provider.ts:472](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L472) +[packages/medusa/src/services/tax-provider.ts:477](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L477) ___ @@ -358,7 +333,7 @@ the tax rates configured for the shipping option. #### Defined in -[packages/medusa/src/services/tax-provider.ts:425](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L425) +[packages/medusa/src/services/tax-provider.ts:429](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L429) ___ @@ -384,7 +359,7 @@ the tax rates configured for the shipping option. #### Defined in -[packages/medusa/src/services/tax-provider.ts:379](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L379) +[packages/medusa/src/services/tax-provider.ts:382](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L382) ___ @@ -411,7 +386,7 @@ the computed tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:201](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L201) +[packages/medusa/src/services/tax-provider.ts:204](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L204) ___ @@ -440,7 +415,7 @@ the computed tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:253](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L253) +[packages/medusa/src/services/tax-provider.ts:256](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L256) ___ @@ -463,7 +438,7 @@ Return a map of tax lines for line items and shipping methods #### Defined in -[packages/medusa/src/services/tax-provider.ts:342](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L342) +[packages/medusa/src/services/tax-provider.ts:345](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L345) ___ @@ -477,7 +452,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:66](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L66) +[packages/medusa/src/services/tax-provider.ts:65](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L65) ___ @@ -497,7 +472,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:524](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L524) +[packages/medusa/src/services/tax-provider.ts:481](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L481) ___ @@ -521,33 +496,7 @@ the region specific tax provider #### Defined in -[packages/medusa/src/services/tax-provider.ts:76](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L76) - -___ - -### setCache - -▸ `Private` **setCache**(`productId`, `regionId`, `value`): `Promise`<``null`` \| `string`\> - -Sets the cache results for a set of ids - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `productId` | `string` | the product id to cache | -| `regionId` | `string` | the region id to cache | -| `value` | `TaxServiceRate`[] | tax rates to cache | - -#### Returns - -`Promise`<``null`` \| `string`\> - -promise that resolves after the cache has been set - -#### Defined in - -[packages/medusa/src/services/tax-provider.ts:483](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-provider.ts#L483) +[packages/medusa/src/services/tax-provider.ts:75](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-provider.ts#L75) ___ @@ -571,7 +520,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -595,4 +544,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/TaxRateService.md b/docs/content/references/services/classes/TaxRateService.md index f18ab8204a..a28bc7e24a 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:31](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L31) +[packages/medusa/src/services/tax-rate.ts:33](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -52,7 +52,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/tax-rate.ts:23](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L23) +[packages/medusa/src/services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L25) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L26) +[packages/medusa/src/services/tax-rate.ts:28](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L28) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:27](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L27) +[packages/medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L29) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:28](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L28) +[packages/medusa/src/services/tax-rate.ts:30](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L30) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L29) +[packages/medusa/src/services/tax-rate.ts:31](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L31) ___ @@ -120,7 +120,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/tax-rate.ts:24](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L24) +[packages/medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L26) ## Methods @@ -142,7 +142,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/tax-rate.ts:181](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L181) +[packages/medusa/src/services/tax-rate.ts:190](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L190) ___ @@ -164,7 +164,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:217](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L217) +[packages/medusa/src/services/tax-rate.ts:226](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L226) ___ @@ -186,7 +186,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:257](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L257) +[packages/medusa/src/services/tax-rate.ts:266](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L266) ___ @@ -225,7 +225,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -245,7 +245,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:88](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L88) +[packages/medusa/src/services/tax-rate.ts:97](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L97) ___ @@ -265,7 +265,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:119](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L119) +[packages/medusa/src/services/tax-rate.ts:128](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L128) ___ @@ -286,7 +286,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:47](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L47) +[packages/medusa/src/services/tax-rate.ts:49](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L49) ___ @@ -307,7 +307,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:58](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L58) +[packages/medusa/src/services/tax-rate.ts:60](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L60) ___ @@ -328,7 +328,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:305](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L305) +[packages/medusa/src/services/tax-rate.ts:314](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L314) ___ @@ -348,7 +348,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:315](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L315) +[packages/medusa/src/services/tax-rate.ts:324](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L324) ___ @@ -369,7 +369,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:127](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L127) +[packages/medusa/src/services/tax-rate.ts:136](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L136) ___ @@ -390,7 +390,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:145](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L145) +[packages/medusa/src/services/tax-rate.ts:154](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L154) ___ @@ -411,19 +411,19 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:163](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L163) +[packages/medusa/src/services/tax-rate.ts:172](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L172) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`TaxRate`\> +▸ **retrieve**(`taxRateId`, `config?`): `Promise`<`TaxRate`\> #### Parameters | Name | Type | | :------ | :------ | -| `id` | `string` | +| `taxRateId` | `string` | | `config` | `FindConfig`<`TaxRate`\> | #### Returns @@ -432,7 +432,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:69](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L69) +[packages/medusa/src/services/tax-rate.ts:71](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L71) ___ @@ -456,7 +456,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -477,7 +477,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:104](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/tax-rate.ts#L104) +[packages/medusa/src/services/tax-rate.ts:113](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/tax-rate.ts#L113) ___ @@ -501,4 +501,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/TokenService.md b/docs/content/references/services/classes/TokenService.md new file mode 100644 index 0000000000..a65981eddf --- /dev/null +++ b/docs/content/references/services/classes/TokenService.md @@ -0,0 +1,79 @@ +# Class: TokenService + +## Constructors + +### constructor + +• **new TokenService**(`__namedParameters`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `__namedParameters` | `InjectedDependencies` | + +#### Defined in + +[packages/medusa/src/services/token.ts:16](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/token.ts#L16) + +## Properties + +### configModule\_ + +• `Protected` `Readonly` **configModule\_**: `ConfigModule` + +#### Defined in + +[packages/medusa/src/services/token.ts:14](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/token.ts#L14) + +___ + +### RESOLUTION\_KEY + +▪ `Static` **RESOLUTION\_KEY**: `string` + +#### Defined in + +[packages/medusa/src/services/token.ts:12](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/token.ts#L12) + +## Methods + +### signToken + +▸ **signToken**(`data`, `options?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `string` \| `object` \| `Buffer` | +| `options?` | `SignOptions` | + +#### Returns + +`string` + +#### Defined in + +[packages/medusa/src/services/token.ts:34](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/token.ts#L34) + +___ + +### verifyToken + +▸ **verifyToken**(`token`, `options?`): `string` \| `Jwt` \| `JwtPayload` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `token` | `string` | +| `options?` | `VerifyOptions` | + +#### Returns + +`string` \| `Jwt` \| `JwtPayload` + +#### Defined in + +[packages/medusa/src/services/token.ts:20](https://github.com/medusajs/medusa/blob/d843bc102/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 fcc7d13b87..31653268d5 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:108](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L108) +[packages/medusa/src/services/totals.ts:116](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L116) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -56,7 +56,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:106](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L106) +[packages/medusa/src/services/totals.ts:114](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L114) ___ @@ -80,7 +80,17 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/totals.ts:101](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L101) +[packages/medusa/src/services/totals.ts:108](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L108) + +___ + +### newTotalsService\_ + +• `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) + +#### Defined in + +[packages/medusa/src/services/totals.ts:112](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L112) ___ @@ -90,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:105](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L105) +[packages/medusa/src/services/totals.ts:113](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L113) ___ @@ -100,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:104](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L104) +[packages/medusa/src/services/totals.ts:111](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L111) ___ @@ -114,7 +124,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/totals.ts:102](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L102) +[packages/medusa/src/services/totals.ts:109](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L109) ## Methods @@ -153,7 +163,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -181,7 +191,7 @@ triples of lineitem, variant and applied discount #### Defined in -[packages/medusa/src/services/totals.ts:609](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L609) +[packages/medusa/src/services/totals.ts:624](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L624) ___ @@ -210,7 +220,7 @@ array of triples of lineitem, variant and applied discount #### Defined in -[packages/medusa/src/services/totals.ts:651](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L651) +[packages/medusa/src/services/totals.ts:666](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L666) ___ @@ -226,7 +236,11 @@ applies to a specific line item. | Name | Type | Description | | :------ | :------ | :------ | -| `orderOrCart` | `Cart` \| `Order` | the order or cart to get an allocation map for | +| `orderOrCart` | `Object` | the order or cart to get an allocation map for | +| `orderOrCart.claims?` | `ClaimOrder`[] | - | +| `orderOrCart.discounts?` | `Discount`[] | - | +| `orderOrCart.items` | `LineItem`[] | - | +| `orderOrCart.swaps?` | `Swap`[] | - | | `options` | `AllocationMapOptions` | controls what should be included in allocation map | #### Returns @@ -237,13 +251,13 @@ the allocation map for the line items in the cart or order. #### Defined in -[packages/medusa/src/services/totals.ts:431](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L431) +[packages/medusa/src/services/totals.ts:441](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L441) ___ ### getCalculationContext -▸ **getCalculationContext**(`cartOrOrder`, `options?`): `Promise`<`TaxCalculationContext`\> +▸ **getCalculationContext**(`calculationContextData`, `options?`): `Promise`<`TaxCalculationContext`\> Prepares the calculation context for a tax total calculation. @@ -251,7 +265,7 @@ Prepares the calculation context for a tax total calculation. | Name | Type | Description | | :------ | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | the cart or order to get the calculation context for | +| `calculationContextData` | `CalculationContextData` | the calculationContextData to get the calculation context for | | `options` | `CalculationContextOptions` | options to gather context by | #### Returns @@ -262,7 +276,7 @@ the tax calculation context #### Defined in -[packages/medusa/src/services/totals.ts:1058](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L1058) +[packages/medusa/src/services/totals.ts:1028](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L1028) ___ @@ -287,7 +301,7 @@ the total discounts amount #### Defined in -[packages/medusa/src/services/totals.ts:1028](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L1028) +[packages/medusa/src/services/totals.ts:998](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L998) ___ @@ -313,7 +327,7 @@ the gift card amount applied to the cart or order #### Defined in -[packages/medusa/src/services/totals.ts:945](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L945) +[packages/medusa/src/services/totals.ts:964](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L964) ___ @@ -338,7 +352,7 @@ the gift card amount applied to the cart or order #### Defined in -[packages/medusa/src/services/totals.ts:928](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L928) +[packages/medusa/src/services/totals.ts:947](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L947) ___ @@ -352,7 +366,10 @@ Returns the discount amount allocated to the line items of an order. | Name | Type | Description | | :------ | :------ | :------ | -| `cartOrOrder` | `Cart` \| `Order` | the cart or order to get line discount allocations for | +| `cartOrOrder` | `Object` | the cart or order to get line discount allocations for | +| `cartOrOrder.claims?` | `ClaimOrder`[] | - | +| `cartOrOrder.items` | `LineItem`[] | - | +| `cartOrOrder.swaps?` | `Swap`[] | - | | `discount` | `Discount` | the discount to use as context for the calculation | #### Returns @@ -364,7 +381,7 @@ the allocations that the discount has on the items in the cart or #### Defined in -[packages/medusa/src/services/totals.ts:702](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L702) +[packages/medusa/src/services/totals.ts:717](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L717) ___ @@ -384,7 +401,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:679](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L679) +[packages/medusa/src/services/totals.ts:694](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L694) ___ @@ -405,7 +422,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:664](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L664) +[packages/medusa/src/services/totals.ts:679](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L679) ___ @@ -430,7 +447,7 @@ the line item refund amount. #### Defined in -[packages/medusa/src/services/totals.ts:487](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L487) +[packages/medusa/src/services/totals.ts:502](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L502) ___ @@ -457,7 +474,7 @@ the line item total #### Defined in -[packages/medusa/src/services/totals.ts:901](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L901) +[packages/medusa/src/services/totals.ts:920](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L920) ___ @@ -485,7 +502,7 @@ the breakdown of the line item totals #### Defined in -[packages/medusa/src/services/totals.ts:748](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L748) +[packages/medusa/src/services/totals.ts:767](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L767) ___ @@ -509,7 +526,7 @@ the total paid amount #### Defined in -[packages/medusa/src/services/totals.ts:153](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L153) +[packages/medusa/src/services/totals.ts:163](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L163) ___ @@ -536,7 +553,7 @@ the calculated subtotal #### Defined in -[packages/medusa/src/services/totals.ts:566](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L566) +[packages/medusa/src/services/totals.ts:581](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L581) ___ @@ -560,7 +577,7 @@ the total refunded amount for an order. #### Defined in -[packages/medusa/src/services/totals.ts:472](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L472) +[packages/medusa/src/services/totals.ts:487](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L487) ___ @@ -587,7 +604,7 @@ An object that breaks down the totals for the shipping method #### Defined in -[packages/medusa/src/services/totals.ts:187](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L187) +[packages/medusa/src/services/totals.ts:197](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L197) ___ @@ -611,7 +628,7 @@ shipping total #### Defined in -[packages/medusa/src/services/totals.ts:315](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L315) +[packages/medusa/src/services/totals.ts:325](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L325) ___ @@ -636,7 +653,7 @@ the calculated subtotal #### Defined in -[packages/medusa/src/services/totals.ts:279](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L279) +[packages/medusa/src/services/totals.ts:289](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L289) ___ @@ -661,7 +678,7 @@ the swap total #### Defined in -[packages/medusa/src/services/totals.ts:168](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L168) +[packages/medusa/src/services/totals.ts:178](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L178) ___ @@ -687,7 +704,7 @@ tax total #### Defined in -[packages/medusa/src/services/totals.ts:342](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L342) +[packages/medusa/src/services/totals.ts:352](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L352) ___ @@ -712,7 +729,7 @@ the calculated subtotal #### Defined in -[packages/medusa/src/services/totals.ts:130](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L130) +[packages/medusa/src/services/totals.ts:140](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L140) ___ @@ -736,7 +753,7 @@ the rounded value #### Defined in -[packages/medusa/src/services/totals.ts:1088](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/totals.ts#L1088) +[packages/medusa/src/services/totals.ts:1058](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/totals.ts#L1058) ___ @@ -760,7 +777,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -784,4 +801,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/classes/UserService.md b/docs/content/references/services/classes/UserService.md index 80bc4e17f8..7017fdf669 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/105c68929/packages/medusa/src/services/user.ts#L47) +[packages/medusa/src/services/user.ts:47](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.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/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L10) ___ @@ -54,7 +54,7 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L42) +[packages/medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L42) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:44](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L44) +[packages/medusa/src/services/user.ts:44](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L44) ___ @@ -84,7 +84,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L45) +[packages/medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L45) ___ @@ -98,7 +98,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L40) +[packages/medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L40) ___ @@ -112,7 +112,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L41) +[packages/medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L41) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L43) +[packages/medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L43) ___ @@ -141,7 +141,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L33) +[packages/medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L33) ## Methods @@ -180,7 +180,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L48) +[packages/medusa/src/interfaces/transaction-base-service.ts:48](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L48) ___ @@ -206,7 +206,7 @@ the result of create #### Defined in -[packages/medusa/src/services/user.ts:172](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L172) +[packages/medusa/src/services/user.ts:179](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L179) ___ @@ -230,7 +230,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/user.ts:252](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L252) +[packages/medusa/src/services/user.ts:259](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L259) ___ @@ -258,7 +258,7 @@ the generated JSON web token #### Defined in -[packages/medusa/src/services/user.ts:314](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L314) +[packages/medusa/src/services/user.ts:321](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L321) ___ @@ -282,7 +282,7 @@ hashed password #### Defined in -[packages/medusa/src/services/user.ts:160](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L160) +[packages/medusa/src/services/user.ts:167](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L167) ___ @@ -305,7 +305,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/user.ts:69](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L69) +[packages/medusa/src/services/user.ts:69](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L69) ___ @@ -331,7 +331,7 @@ the user document. #### Defined in -[packages/medusa/src/services/user.ts:82](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L82) +[packages/medusa/src/services/user.ts:82](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L82) ___ @@ -347,7 +347,7 @@ Throws in case of DB Error and if user was not found. | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `apiToken` | `string` | `undefined` | the token of the user to get. | -| `relations` | `string`[] | `[]` | relations to include with the user | +| `relations` | `string`[] | `[]` | relations to include with the user. | #### Returns @@ -357,7 +357,7 @@ the user document. #### Defined in -[packages/medusa/src/services/user.ts:106](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L106) +[packages/medusa/src/services/user.ts:113](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L113) ___ @@ -383,7 +383,7 @@ the user document. #### Defined in -[packages/medusa/src/services/user.ts:135](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L135) +[packages/medusa/src/services/user.ts:142](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L142) ___ @@ -410,7 +410,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/user.ts:285](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L285) +[packages/medusa/src/services/user.ts:292](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L292) ___ @@ -434,7 +434,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L29) +[packages/medusa/src/interfaces/transaction-base-service.ts:29](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L29) ___ @@ -459,7 +459,7 @@ the result of create #### Defined in -[packages/medusa/src/services/user.ts:206](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/services/user.ts#L206) +[packages/medusa/src/services/user.ts:213](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/services/user.ts#L213) ___ @@ -483,4 +483,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/105c68929/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[packages/medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/d843bc102/packages/medusa/src/interfaces/transaction-base-service.ts#L13) diff --git a/docs/content/references/services/index.md b/docs/content/references/services/index.md index cc37e6b7d8..521d9dfee7 100644 --- a/docs/content/references/services/index.md +++ b/docs/content/references/services/index.md @@ -5,6 +5,7 @@ - [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) @@ -53,5 +54,6 @@ - [SystemPaymentProviderService](classes/SystemPaymentProviderService.md) - [TaxProviderService](classes/TaxProviderService.md) - [TaxRateService](classes/TaxRateService.md) +- [TokenService](classes/TokenService.md) - [TotalsService](classes/TotalsService.md) - [UserService](classes/UserService.md) diff --git a/docs/content/starters/gatsby-medusa-starter.md b/docs/content/starters/gatsby-medusa-starter.mdx similarity index 84% rename from docs/content/starters/gatsby-medusa-starter.md rename to docs/content/starters/gatsby-medusa-starter.mdx index 20d3f8896c..4c892c8f8f 100644 --- a/docs/content/starters/gatsby-medusa-starter.md +++ b/docs/content/starters/gatsby-medusa-starter.mdx @@ -1,3 +1,5 @@ +import Feedback from '@site/src/components/Feedback'; + # Gatsby Storefront Quickstart This document guides you to install and set up the Gatsby Storefront for your Medusa Server. @@ -12,9 +14,11 @@ Instead of manually following this guide to install then later deploy the Gatsby Deploy to Netlify +--- + ## Prerequisites -This document assumes you already have a Medusa server installed. If you don’t, please follow the [Quickstart guide for the Medusa server](../quickstart/quick-start.md) to learn how to do it. +This document assumes you already have a Medusa server installed. If you don’t, please follow the [Quickstart guide for the Medusa server](../quickstart/quick-start.mdx) to learn how to do it. You should also have the Gatsby CLI installed: @@ -22,6 +26,8 @@ You should also have the Gatsby CLI installed: npm install gatsby-cli -g ``` +--- + ## Installation :::tip @@ -51,6 +57,21 @@ npm run start Your Gatsby storefront is now running at `localhost:8000`! + + +:::tip + +If you run into errors during the installation, check out [this troubleshooting guide](../troubleshooting/common-installation-errors.mdx). + +::: + +--- + ## Development Notes ### Customization @@ -98,6 +119,8 @@ If you’re not familiar with Gatsby, you can learn more about it through the fo - [Plugin Library](https://www.gatsbyjs.com/plugins/) - [Cheat Sheet](https://www.gatsbyjs.com/docs/cheat-sheet/) +--- + ## Storefront Features The Gatsby storefront comes with a lot of features out of the box including: @@ -115,8 +138,10 @@ The Gatsby storefront comes with a lot of features out of the box including: ![Request Return for Order](https://res.cloudinary.com/dza7lstvk/image/upload/v1668003162/Medusa%20Docs/Screenshots/mAChp3f_ubd89n.png) -## What’s Next +--- -- Check the [Storefront API reference](https://docs.medusajs.com/api/store) for a full list of REST APIs to use on your storefront. -- Learn how to [deploy the Gatsby storefront on Netlify](../deployments/storefront/deploying-gatsby-on-netlify.md). -- Learn how to add [Stripe as a payment provider](../add-plugins/stripe.md#gatsby-storefront). +## See Also + +- [Storefront API reference](https://docs.medusajs.com/api/store) +- [Deploy the Gatsby storefront on Netlify](../deployments/storefront/deploying-gatsby-on-netlify.md) +- [Install Stripe as a payment provider](../add-plugins/stripe.md#add-to-gatsby-storefront) diff --git a/docs/content/starters/nextjs-medusa-starter.md b/docs/content/starters/nextjs-medusa-starter.mdx similarity index 84% rename from docs/content/starters/nextjs-medusa-starter.md rename to docs/content/starters/nextjs-medusa-starter.mdx index 2d07d06452..56947a6e60 100644 --- a/docs/content/starters/nextjs-medusa-starter.md +++ b/docs/content/starters/nextjs-medusa-starter.mdx @@ -1,3 +1,5 @@ +import Feedback from '@site/src/components/Feedback'; + # Next.js Storefront Quickstart This document guides you to install and set up the Next.js Storefront for your Medusa Server. @@ -12,9 +14,13 @@ Instead of manually following this guide to install then later deploy the Next.j Deploy to Netlify +--- + ## Prerequisites -This document assumes you already have a Medusa server installed. If you don’t, please follow the [Quickstart guide for the Medusa server](../quickstart/quick-start.md) to learn how to do it. +This document assumes you already have a Medusa server installed. If you don’t, please follow the [Quickstart guide for the Medusa server](../quickstart/quick-start.mdx) to learn how to do it. + +--- ## Installation @@ -24,13 +30,13 @@ It is recommended to use [Yarn](https://yarnpkg.com/getting-started/install) for ::: -1\. Create a new Next.js project using the [Medusa starter template](https://github.com/medusajs/nextjs-starter-medusa): +1\. Create a new Next.js project using the [Medusa starter template](https://github.com/medusajs/nextjs-starter-medusa): ```bash npx create-next-app -e https://github.com/medusajs/nextjs-starter-medusa my-medusa-storefront ``` -2\. Change to the newly created directory `my-medusa-storefront` and rename the template environment variable file to use environment variables in development: +2\. Change to the newly created directory `my-medusa-storefront` and rename the template environment variable file to use environment variables in development: ```bash cd my-medusa-storefront @@ -43,7 +49,22 @@ mv .env.template .env.local npm run dev ``` -Your Next.js storefront is now running at `localhost:8000`! +Your Next.js storefront is now running at `localhost:8000`! + + + +:::tip + +If you run into errors during the installation, check out [this troubleshooting guide](../troubleshooting/common-installation-errors.mdx). + +::: + +--- ## Development Notes @@ -183,9 +204,9 @@ To customize the styles of the storefront, you can customize the `src/styles` di ### Change Port -By default, the Next.js storefront runs on port `8000`. +By default, the Next.js storefront runs on port `8000`. -To change the port, change the `develop` command in `package.json` to the following: +To change the port, change the `develop` command in `package.json` to the following: ```json "scripts": { @@ -194,9 +215,9 @@ To change the port, change the `develop` command in `package.json` to the fo } ``` -Make sure to replace `` with the port number you want the storefront to run on. For example, `3000`. +Make sure to replace `` with the port number you want the storefront to run on. For example, `3000`. -Then, on your server, update the environment variable `STORE_CORS` to the URL with the new port: +Then, on your server, update the environment variable `STORE_CORS` to the URL with the new port: ```bash STORE_CORS=http://localhost: @@ -206,6 +227,8 @@ STORE_CORS=http://localhost: You can learn more about development with Next.js through [their documentation](https://nextjs.org/docs/getting-started). +--- + ## Storefront Features - View all products and manage your cart. @@ -220,7 +243,10 @@ You can learn more about development with Next.js through [their documentation]( ![Checkout Page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668003296/Medusa%20Docs/Screenshots/VC8SYfb_eowjno.png) -## What’s Next +--- -- Check the [Storefront API reference](https://docs.medusajs.com/api/store) for a full list of REST APIs to use on your storefront. -- Learn [how to install Medusa Admin](../admin/quickstart.md). +## See Also + +- [Storefront API reference](https://docs.medusajs.com/api/store) +- [Install Medusa Admin](../admin/quickstart.mdx). +- [Install Stripe as a payment provider](../add-plugins/stripe.md#add-to-nextjs-storefront) diff --git a/docs/content/troubleshooting/cli-installation-errors.mdx b/docs/content/troubleshooting/cli-installation-errors.mdx index 63a4d488e4..2c1c758d55 100644 --- a/docs/content/troubleshooting/cli-installation-errors.mdx +++ b/docs/content/troubleshooting/cli-installation-errors.mdx @@ -11,6 +11,24 @@ If you install the Medusa CLI tool with NPM and get a permission error, NPM prop You can check out more information in [NPM’s documentation](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally). +--- + + + +## Powershell Error: command not found: medusa + + + +If you're using Powershell and you installed the CLI tool, but when you try to use it you get the error: + +```bash noReport +command not found: medusa +``` + +Try closing your Powershell window and opening a new one. + +--- + ## Yarn Error: command not found: medusa @@ -44,4 +62,4 @@ setx path "%path%;c:\users\YOURUSERNAME\appdata\local\yarn\bin" -You can learn more in [Yarn’s documentation](https://classic.yarnpkg.com/en/docs/cli/global#adding-the-install-location-to-your-path). +You can learn more in [Yarn’s documentation](https://classic.yarnpkg.com/en/docs/cli/global#adding-the-install-location-to-your-path). \ No newline at end of file diff --git a/docs/content/troubleshooting/common-installation-errors.mdx b/docs/content/troubleshooting/common-installation-errors.mdx new file mode 100644 index 0000000000..fd57372694 --- /dev/null +++ b/docs/content/troubleshooting/common-installation-errors.mdx @@ -0,0 +1,27 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Resolve "Cannot find module X" Errors + +This error can occur while installing one of the storefronts or the Medusa admin. There is no specific cause to this error. + +One way to resolve it is by removing the `node_modules` directory in the project and re-installing the dependencies: + + + + +```bash +rm -rf node_modules +yarn install +``` + + + + +```bash +rd /s /q node_modules +yarn install +``` + + + \ No newline at end of file diff --git a/docs/content/troubleshooting/cors-issues.md b/docs/content/troubleshooting/cors-issues.md index 5119d8b18d..73372a435a 100644 --- a/docs/content/troubleshooting/cors-issues.md +++ b/docs/content/troubleshooting/cors-issues.md @@ -10,9 +10,10 @@ In your `medusa-config.js` , you should ensure that you've configured your CORS The default configuration uses the following CORS settings: -```jsx title=medusa-config.js +```js title=medusa-config.js // CORS when consuming Medusa from admin -const ADMIN_CORS = process.env.ADMIN_CORS || "http://localhost:7000,http://localhost:7001" +const ADMIN_CORS = process.env.ADMIN_CORS || + "http://localhost:7000,http://localhost:7001" // CORS to avoid issues when consuming Medusa from a client const STORE_CORS = process.env.STORE_CORS || "http://localhost:8000" @@ -20,6 +21,8 @@ const STORE_CORS = process.env.STORE_CORS || "http://localhost:8000" If you wish to run your storefront or Medusa admin on other ports, you should update the above settings accordingly. -## Additional Resources +--- -To learn more about CORS configurations, check out the [Configure your Server](../usage/configurations.md) documentation. +## See Also + +- [Configure your Medusa server](../usage/configurations.md) diff --git a/docs/content/troubleshooting/database-error.md b/docs/content/troubleshooting/database-error.md new file mode 100644 index 0000000000..e3da1ef9e8 --- /dev/null +++ b/docs/content/troubleshooting/database-error.md @@ -0,0 +1,20 @@ +# Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: Client password must be a string + +You can get the following error while running `medusa new` or while running integration tests during [local development](../usage/local-development.md): + +```bash +Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string +``` + +If the error occurs while running `medusa new` and you've selected to enter your database credentials, either: + +1. Make sure your database credentials are correct; +2. Or choose the Skip option to skip entering your database credentials. + +If the error occurs while running integration tests, make sure the following variable is set in your system's environment variable: + +```bash +DB_HOST= +DB_USERNAME= +DB_PASSWORD= +``` diff --git a/docs/content/troubleshooting/documentation-error.md b/docs/content/troubleshooting/documentation-error.md index 94fbcd525f..cc31b8e5e3 100644 --- a/docs/content/troubleshooting/documentation-error.md +++ b/docs/content/troubleshooting/documentation-error.md @@ -8,6 +8,8 @@ This is because the content resides in `docs/content`. When that content is bein For that reason, when the `start` and `build` scripts in `www/docs` are used, the `clean-node-modules` script is called. This script deleted the `node_modules` directory in the root of the Medusa repository. +--- + ## Out of Memory Error If you receive the following error when you run the `build` command in `www/docs`: diff --git a/docs/content/troubleshooting/missing-payment-providers.md b/docs/content/troubleshooting/missing-payment-providers.md index 9e7feaf6db..95d33da338 100644 --- a/docs/content/troubleshooting/missing-payment-providers.md +++ b/docs/content/troubleshooting/missing-payment-providers.md @@ -2,9 +2,9 @@ You add payment providers to your Medusa instance by adding them as plugins in `medusa-config.js`: -```jsx title=medusa-config.js +```js title=medusa-config.js const plugins = [ - ... + // ... // You can create a Stripe account via: https://stripe.com { resolve: `medusa-payment-stripe`, @@ -13,8 +13,7 @@ const plugins = [ webhook_secret: STRIPE_WEBHOOK_SECRET, }, }, - ... -]; +] ``` And installing them with your favourite package manager: @@ -27,7 +26,9 @@ However, to also show them as part of your checkout flow you need to add them to In the Medusa Admin go to Settings > Regions and for each region scroll down to the Payment Provider input and choose the payment provider you want to use in that region. -## Additional Resources +--- -- Learn how to install [Stripe](../add-plugins/stripe.md) as a payment provider. -- Learn more about the [Payment architecture](../advanced/backend/payment/overview.md). +## See Also + +- [Install Stripe](../add-plugins/stripe.md) +- [Payment Architecture Overview](../advanced/backend/payment/overview.md) diff --git a/docs/content/troubleshooting/redis-events.md b/docs/content/troubleshooting/redis-events.md index c8342b92bf..8ddf29c1c7 100644 --- a/docs/content/troubleshooting/redis-events.md +++ b/docs/content/troubleshooting/redis-events.md @@ -11,7 +11,7 @@ After installing it, make sure to configure your Medusa server to use Redis: ```jsx title=medusa-config.js module.exports = { projectConfig: { - //... + // ... redis_url: REDIS_URL, }, } @@ -23,7 +23,9 @@ By default, Medusa connects to Redis over the URL `redis://localhost:6379`. If y REDIS_URL= ``` -## Additional Resources +--- -- Learn how to [set up your development environment](../tutorial/0-set-up-your-development-environment.mdx). -- Learn how to [configure your server](../usage/configurations.md). +## See Also + +- [Set up your development environment](../tutorial/0-set-up-your-development-environment.mdx) +- [Configure your server](../usage/configurations.md) diff --git a/docs/content/troubleshooting/signing-in-to-admin.md b/docs/content/troubleshooting/signing-in-to-admin.md index 0089558b3c..aa8a389f24 100644 --- a/docs/content/troubleshooting/signing-in-to-admin.md +++ b/docs/content/troubleshooting/signing-in-to-admin.md @@ -13,6 +13,8 @@ Alternatively, you can create your own users using the Medusa CLI tool: medusa user -e some@email.com -p somepassword ``` -## Additional Resources +--- -Learn more about Medusa's CLI tool in the [CLI reference](../cli/reference.md). +## See Also + +- [Medusa CLI tool reference](../cli/reference.md) diff --git a/docs/content/troubleshooting/transaction-error-in-checkout.md b/docs/content/troubleshooting/transaction-error-in-checkout.md index 6830f67d24..d6537381ab 100644 --- a/docs/content/troubleshooting/transaction-error-in-checkout.md +++ b/docs/content/troubleshooting/transaction-error-in-checkout.md @@ -19,7 +19,7 @@ Then in your `medusa-config.js`, you should change the project configuration to ```jsx title=medusa-config.js module.exports = { projectConfig: { - //... + // ... database_url: DATABASE_URL, database_type: "postgres", }, @@ -31,6 +31,8 @@ Where `DATABASE_URL` is the connection string to your PostgreSQL database. You c Make sure to also remove the following lines that are used to configure an SQLite database: + + ```jsx title=medusa-config.js database_type: "sqlite", database_database: "./medusa-db.sql", @@ -52,8 +54,10 @@ npm run seed ::: -## Additional Resources +--- -- Learn how to [set up your development environment](../tutorial/0-set-up-your-development-environment.mdx). -- Learn how to [configure your server](../usage/configurations.md). -- Learn more about [the Medusa CLI tool](../cli/reference.md). +## See Also + +- [Set up your development environment](../tutorial/0-set-up-your-development-environment.mdx) +- [Configure your server](../usage/configurations.md) +- [Medusa CLI tool reference](../cli/reference.md) diff --git a/docs/content/tutorial/0-set-up-your-development-environment.mdx b/docs/content/tutorial/0-set-up-your-development-environment.mdx index 82c98e5f3a..0ef044ca8f 100644 --- a/docs/content/tutorial/0-set-up-your-development-environment.mdx +++ b/docs/content/tutorial/0-set-up-your-development-environment.mdx @@ -139,6 +139,14 @@ If you run into any errors while installing the CLI tool, check out the [trouble ::: +--- + +## Install Medusa Server + +If you're not interested in installing the optional tools and want to get started quickly, check out the [quickstart guide](../quickstart/quick-start.mdx). + +--- + ## Optional Tools These tools are not required to have to run a Medusa server, but it's highly recommended that you have them installed. @@ -268,8 +276,11 @@ To install Redis without Homebrew you can check out [Redis’s guide on installi -## What’s Next +--- -- Learn how to [configure your Medusa server](../usage/configurations.md). -- Learn how to install a storefront with [Next.js](../starters/nextjs-medusa-starter.md) or [Gatsby](./../starters/gatsby-medusa-starter.md). -- Learn how to install the [Medusa Admin](../admin/quickstart.md). +## See Also + +- [Install Medusa server](../quickstart/quick-start.mdx) +- [Configure your Medusa server](../usage/configurations.md). +- Install a storefront with [Next.js](../starters/nextjs-medusa-starter.mdx) or [Gatsby](./../starters/gatsby-medusa-starter.mdx). +- [Install the Medusa Admin](../admin/quickstart.mdx). diff --git a/docs/content/usage.md b/docs/content/usage.md index 0c61986283..f64b0f22d3 100644 --- a/docs/content/usage.md +++ b/docs/content/usage.md @@ -9,6 +9,8 @@ This document gives an overview of Medusa’s optional collected usage informati At Medusa, we strive to provide the best experience for developers using our platform. For that reason, Medusa collects anonymous and non-sensitive data that provides a global understanding of how users are using Medusa. +--- + ## Purpose As an open source solution, we work closely and constantly interact with our community to ensure that we provide the best experience for everyone using Medusa. @@ -25,6 +27,8 @@ Collecting this data allows us to understand certain details such as: - How much data do users manage through our Medusa Admin? Is it being used for large number of products, orders, and other types of data? - What Node version is globally used? Should we focus our efforts on providing support for versions that we don’t currently support? +--- + ## Server Analytics This section covers which data in the server are collected and how to opt out of it. @@ -58,6 +62,8 @@ Or, you can run the following command in the root of your Medusa server project medusa telemetry --disable ``` +--- + ## Admin Analytics This section covers which data in the admin are collected and how to opt out of it. diff --git a/docs/content/usage/configurations.md b/docs/content/usage/configurations.md index d90f1b94bc..ad5a6f6661 100644 --- a/docs/content/usage/configurations.md +++ b/docs/content/usage/configurations.md @@ -4,7 +4,9 @@ In this document, you’ll learn what configurations you can add to your Medusa ## Prerequisites -This document assumes you already followed along with the [“Set up your development environment” documentation](../tutorial/0-set-up-your-development-environment.mdx) and have [installed a Medusa server](../quickstart/quick-start.md#create-a-medusa-server). +This document assumes you already followed along with the [“Set up your development environment” documentation](../tutorial/0-set-up-your-development-environment.mdx) and have [installed a Medusa server](../quickstart/quick-start.mdx#create-a-medusa-server). + +--- ## Medusa Configurations File @@ -12,6 +14,8 @@ The configurations for your Medusa server are in `medusa-config.js`. This includ Some of the configurations mentioned in this document are already defined in `medusa-config.js` with default values. It’s important that you know what these configurations are used for and how to set them. +--- + ## Environment Variables In your configurations, you’ll often use environment variables. For example, when using API keys or setting your database URL. @@ -24,6 +28,8 @@ This change in how environment variables are loaded was introduced in version 1. ::: +--- + ## Database Configuration Medusa supports two database types: SQLite and PostgreSQL. @@ -41,11 +47,11 @@ For SQLite you mainly need two configurations: ```jsx module.exports = { projectConfig: { - //...other configurations + // ...other configurations database_type: "sqlite", database_database: "./medusa-db.sql", }, -}; +} ``` Where `database_type` is `sqlite` and `database_database` is the location you want the SQLite database to be created in. @@ -54,7 +60,7 @@ Where `database_type` is `sqlite` and `database_database` is the location you wa :::note -Before getting started with configuring PostgreSQL, you should have created a PostgreSQL `database`. You can check how to create a database in [PostgreSQL's documentation](https://www.postgresql.org/docs/current/sql-createdatabase.html). +Before getting started with configuring PostgreSQL, you should have created a PostgreSQL database. You can check how to create a database in [PostgreSQL's documentation](https://www.postgresql.org/docs/current/sql-createdatabase.html). ::: @@ -63,16 +69,19 @@ For PostgreSQL you mainly need two configurations: ```jsx module.exports = { projectConfig: { - //...other configurations + // ...other configurations database_type: "postgres", database_url: DATABASE_URL, + database_schema: process.env.DATABASE_SCHEMA, // optional }, -}; +} ``` Where `database_type` is `postgres` and `DATABASE_URL` is the URL connection string to your PostgreSQL database. You can check out how to format it in [PostgreSQL’s documentation](https://www.postgresql.org/docs/current/libpq-connect.html). -It is recommended to set the Database URL as an environment variable: +You can optionally set the `database_schema` option. By default, its value is `public`. + +It's recommended to set the Database URL as an environment variable: ```bash DATABASE_URL= @@ -100,13 +109,15 @@ These configurations are not required and can be omitted. ```jsx module.exports = { projectConfig: { - //...other configurations + // ...other configurations database_logging: true, - database_extra: {} + database_extra: {}, }, -}; +} ``` +--- + ## Redis Medusa uses Redis to handle the event queue, among other usages. You need to set Redis URL in the configurations: @@ -114,10 +125,10 @@ Medusa uses Redis to handle the event queue, among other usages. You need to set ```jsx module.exports = { projectConfig: { - //...other configurations - redis_url: REDIS_URL + // ...other configurations + redis_url: REDIS_URL, }, -}; +} ``` Where `REDIS_URL` is the URL used to connect to Redis. The format of the connection string is `redis[s]://[[username][:password]@][host][:port][/db-number]`. @@ -144,6 +155,8 @@ You can learn more about Subscribers and events in the [Subscriber documentation ::: +--- + ## JWT Secret Medusa uses JSON Web Token (JWT) to handle user authentication. To set the JWT secret: @@ -151,10 +164,10 @@ Medusa uses JSON Web Token (JWT) to handle user authentication. To set the JWT s ```jsx module.exports = { projectConfig: { - //...other configurations + // ...other configurations jwt_secret: "very secure string", }, -}; +} ``` Where `jwt_secret` is the secret used to create the tokens. The more secure it is the better. @@ -173,6 +186,8 @@ In a development environment, if this option is not set the default secret is ::: +--- + ## Cookie Secret This configuration is used to sign the session ID cookie. To set the cookie secret: @@ -180,10 +195,10 @@ This configuration is used to sign the session ID cookie. To set the cookie secr ```jsx module.exports = { projectConfig: { - //...other configurations + // ...other configurations cookie_secret: "very secure string", }, -}; +} ``` Where `cookie_secret` is the secret used to create the tokens. The more secure it is the better. @@ -202,6 +217,8 @@ In a development environment, if this option is not set the default secret is ::: +--- + ## CORS Configurations Medusa uses Cross-Origin Resource Sharing (CORS) to only allow specific origins to access the server. @@ -222,10 +239,10 @@ To make sure your Admin dashboard can access the Medusa server’s admin endpoin ```jsx module.exports = { projectConfig: { - //...other configurations + // ...other configurations admin_cors: ADMIN_CORS, }, -}; +} ``` Where `ADMIN_CORS` is the URL of your admin dashboard. By default, it’s `http://localhost:7000,http://localhost:7001`. @@ -251,10 +268,10 @@ To make sure your Storefront dashboard can access the Medusa server, set this co ```jsx module.exports = { projectConfig: { - //...other configurations + // ...other configurations store_cors: STORE_CORS, }, -}; +} ``` Where `STORE_CORS` is the URL of your storefront. By default, it’s `http://localhost:8000`. @@ -273,6 +290,8 @@ Make sure that the URL is without a backslash at the end. For example, you shoul ::: +--- + ## Plugins On your Medusa server, you can use Plugins to add custom features or integrate third-party services. For example, installing a plugin to use Stripe as a payment provider. @@ -288,10 +307,10 @@ Aside from installing the plugin with NPM, you need to pass the plugin you insta ```jsx module.exports = { projectConfig: { - //previous configurations mentioned... + // previous configurations mentioned... }, plugins, -}; +} ``` ### Add a Plugin Without Configuration @@ -300,9 +319,9 @@ To add a plugin that doesn’t need any configurations, you can simply add its n ```jsx const plugins = [ - //other plugins... + // other plugins... `medusa-my-plugin`, -]; +] ``` ### Add a Plugin With Configuration @@ -311,14 +330,14 @@ To add a plugin with configurations, you need to add an object to the `plugins` ```jsx const plugins = [ - //other plugins... + // other plugins... { resolve: `medusa-my-plugin`, options: { - apiKey: `test` - } - } -]; + apiKey: `test`, + }, + }, +] ``` :::tip @@ -327,8 +346,10 @@ It is recommended to use environment variables to store values of options instea ::: -## What’s Next +--- -- Check out the [Next.js](../starters/nextjs-medusa-starter.md) and [Gatsby](../starters/gatsby-medusa-starter.md) starter storefronts. -- Install the [Medusa admin](../admin/quickstart.md). -- Learn about [deploying the Medusa server](../deployments/server/index.mdx). +## See Also + +- Check out the [Next.js](../starters/nextjs-medusa-starter.mdx) and [Gatsby](../starters/gatsby-medusa-starter.mdx) starter storefronts +- [Install the Medusa admin](../admin/quickstart.mdx) +- [Deploy the Medusa server](../deployments/server/index.mdx) diff --git a/docs/content/usage/create-medusa-app.mdx b/docs/content/usage/create-medusa-app.mdx index 03699e637d..adff4da8cd 100644 --- a/docs/content/usage/create-medusa-app.mdx +++ b/docs/content/usage/create-medusa-app.mdx @@ -15,6 +15,8 @@ However, if you’re interested in using Medusa’s starters for the three compo When you run the `create-medusa-app` command, you’ll install a Medusa server, a Medusa admin, and optionally a storefront at the same time. +--- + ## How to Create a Medusa Project In your terminal, run the following command: @@ -77,7 +79,7 @@ If you choose an option other than `None`, a storefront will be installed under :::tip -Learn more about the [Next.js](../starters/nextjs-medusa-starter.md) and [Gatsby](../starters/gatsby-medusa-starter.md) starter storefronts. +Learn more about the [Next.js](../starters/nextjs-medusa-starter.mdx) and [Gatsby](../starters/gatsby-medusa-starter.mdx) starter storefronts. ::: @@ -103,6 +105,8 @@ yarn start The commands will differ based on your choices in previous prompts. +--- + ## Project Directory Structure Inside the root project directory which was specified at the beginning of the installation process you’ll find the following directory structure: @@ -114,8 +118,10 @@ Inside the root project directory which was specified at the beginning of the in /admin // Medusa admin panel ``` +--- + ## What’s Next -- Learn how to [deploy the Medusa server](../deployments/server/index.mdx). -- Learn how to [deploy the Medusa admin](../deployments/admin/index.mdx). -- Learn how to [deploy the storefront](../deployments/storefront/index.mdx). \ No newline at end of file +- [Deploy the Medusa server](../deployments/server/index.mdx) +- [Deploy the Medusa admin](../deployments/admin/index.mdx) +- [Deploy the storefront](../deployments/storefront/index.mdx) diff --git a/docs/content/usage/local-development.md b/docs/content/usage/local-development.md index 9b52873033..7ef4fe5be5 100644 --- a/docs/content/usage/local-development.md +++ b/docs/content/usage/local-development.md @@ -14,6 +14,8 @@ Whether you want to implement something differently, introduce a new future as p All the packages are part of a [Yarn workspace](https://classic.yarnpkg.com/lang/en/docs/workspaces/). So, when you run a command in the root of the project, such as `yarn build`, it goes through all registered packages in the workspace under the `packages` directory and runs the `build` command in each of those packages. +--- + ## Prerequisites ### Yarn @@ -51,10 +53,22 @@ In the directory of your forked GitHub repository, run the following command to medusa-dev --set-path-to-repo `pwd` ``` +--- + ## Run Tests in the Repository In this section, you’ll learn how to run tests in the Medusa repository. This is helpful after you customize any of Medusa’s packages and want to make sure everything is still working as expected. +### Set System Environment Variables + +Before you can run the tests, make sure you set the following system environment variables: + +```bash +DB_HOST= +DB_USERNAME= +DB_PASSWORD= +``` + ### Run Unit Tests To run unit tests in all packages in the Medusa repository, run the following command in the root directory of the repository: @@ -94,6 +108,8 @@ To run the plugin integration tests, run the following command in the root direc yarn test:integration:plugins ``` +--- + ## Test in a Local Server Using Medusa’s dev CLI tool, you can test any changes you make to Medusa’s packages in a local server installation. This eliminates the need to publish these packages on NPM publicly to be able to use them. @@ -122,7 +138,27 @@ cd medusa-server medusa-dev ``` -By default, Medusa’s dev CLI runs in watch mode. So, it copies the files when you first run it, then, whenever you make changes in the packages in the Medusa repository, it copies the changed files again. +By default, Medusa’s dev CLI runs in watch mode. So, it copies the files when you first run it. Then, whenever you make changes in the `dist` directory of the packages in the Medusa repository, it copies the changed files again. + +### Watch and Compile Changes + +While the above command is running, it's recommended to run the `watch` command inside the directory of every package you're making changes to. + +The combination of these two commands running at the same time will compile the package into the `dist` directory of the package, then copy the compiled changes into your local server. + +For example, if you're making changes in the `medusa` package, run the following command inside the directory of the `medusa` package: + +```bash title=packages/medusa +yarn watch +``` + +Make sure the `medusa-dev` command is also running to copy the changes automatically. + +Alternatively, you can manually run the `build` command every time you want to compile the changes: + +```bash title=packages/medusa +yarn build +``` ### CLI Options @@ -146,7 +182,9 @@ medusa-dev -q medusa-dev --packages @medusajs/medusa-cli medusa-file-minio ``` -## What’s Next +--- -- Check out our [contribution guidelines](https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md). -- Learn how to [create a plugin](../advanced/backend/plugins/create.md). +## See Also + +- [Create a Plugin](../advanced/backend/plugins/create.md) +- [Contribution Guidelines](https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md) diff --git a/package.json b/package.json index c19084b426..fcdf8d041f 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@babel/plugin-transform-instanceof": "^7.10.4", "@babel/plugin-transform-runtime": "^7.11.5", "@babel/preset-env": "^7.11.5", + "@babel/preset-react": "^7.18.6", "@babel/register": "^7.11.5", "@babel/runtime": "^7.11.2", "@redocly/cli": "latest", @@ -29,7 +30,9 @@ "eslint": "^8.23.0", "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^8.5.0", + "eslint-plugin-markdown": "^3.0.0", "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-react": "^7.31.11", "express": "^4.17.1", "get-port": "^5.1.1", "husky": "^7.0.2", @@ -60,6 +63,7 @@ "hooks:uninstall": "husky uninstall", "build": "turbo run build --no-daemon", "lint": "eslint --ignore-path .eslintignore --ext .js,.ts,.tsx .", + "lint:docs": "eslint -c docs/.eslintrc.js --ignore-path docs/.eslintignore docs/content", "prettier": "prettier", "jest": "jest", "test": "turbo run test --no-daemon --filter=!integration-tests-api --filter=!integration-tests-plugins", diff --git a/packages/medusa/CHANGELOG.md b/packages/medusa/CHANGELOG.md index e50a9c13a6..10db6e75be 100644 --- a/packages/medusa/CHANGELOG.md +++ b/packages/medusa/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 1.7.2 + +### Patch Changes + +- [#2889](https://github.com/medusajs/medusa/pull/2889) [`d843bc102`](https://github.com/medusajs/medusa/commit/d843bc10235f33db9eecb72d74018966e43c26d6) Thanks [@olivermrbl](https://github.com/olivermrbl)! - Assign jobSchedulerService in EventBusService + ## 1.7.1 ### Patch Changes diff --git a/packages/medusa/package.json b/packages/medusa/package.json index 522da00bd4..d7e65281fd 100644 --- a/packages/medusa/package.json +++ b/packages/medusa/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa", - "version": "1.7.1", + "version": "1.7.2", "description": "E-commerce for JAMstack", "main": "dist/index.js", "bin": "./cli.js", diff --git a/packages/medusa/src/api/routes/admin/discounts/add-resources-to-condition-batch.ts b/packages/medusa/src/api/routes/admin/discounts/add-resources-to-condition-batch.ts index 6d17a87f5b..b500deadac 100644 --- a/packages/medusa/src/api/routes/admin/discounts/add-resources-to-condition-batch.ts +++ b/packages/medusa/src/api/routes/admin/discounts/add-resources-to-condition-batch.ts @@ -12,7 +12,7 @@ import { FindParams } from "../../../../types/common" /** * @oas [post] /discounts/{discount_id}/conditions/{condition_id}/batch * operationId: "PostDiscountsDiscountConditionsConditionBatch" - * summary: "Add a batch of resources to a discount condition" + * summary: "Add Batch Resources" * description: "Add a batch of resources to a discount condition." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/discounts/delete-resources-from-condition-batch.ts b/packages/medusa/src/api/routes/admin/discounts/delete-resources-from-condition-batch.ts index 9e3bf68d17..a2064606db 100644 --- a/packages/medusa/src/api/routes/admin/discounts/delete-resources-from-condition-batch.ts +++ b/packages/medusa/src/api/routes/admin/discounts/delete-resources-from-condition-batch.ts @@ -11,7 +11,7 @@ import { FindParams } from "../../../../types/common" /** * @oas [delete] /discounts/{discount_id}/conditions/{condition_id}/batch * operationId: "DeleteDiscountsDiscountConditionsConditionBatch" - * summary: "Delete a batch of resources from a discount condition" + * summary: "Delete Batch Resources" * description: "Delete a batch of resources from a discount condition." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/order-edits/add-line-item.ts b/packages/medusa/src/api/routes/admin/order-edits/add-line-item.ts index 1aff36ecb6..e079bc4642 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/add-line-item.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/add-line-item.ts @@ -11,7 +11,7 @@ import { /** * @oas [post] /order-edits/{id}/items * operationId: "PostOrderEditsEditLineItems" - * summary: "Add an line item to an order (edit)" + * summary: "Add a Line Item" * description: "Create an OrderEdit LineItem." * parameters: * - (path) id=* {string} The ID of the Order Edit. diff --git a/packages/medusa/src/api/routes/admin/order-edits/delete-line-item.ts b/packages/medusa/src/api/routes/admin/order-edits/delete-line-item.ts index faad5d8096..3747ba758e 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/delete-line-item.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/delete-line-item.ts @@ -9,7 +9,7 @@ import { /** * @oas [delete] /order-edits/{id}/items/{item_id} * operationId: "DeleteOrderEditsOrderEditLineItemsLineItem" - * summary: "Delete line items from an order edit and create change item" + * summary: "Delete a Line Item" * description: "Delete line items from an order edit and create change item" * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit-item-change.ts b/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit-item-change.ts index bc0278e757..0c05d37413 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit-item-change.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit-item-change.ts @@ -4,7 +4,7 @@ import { OrderEditService } from "../../../../services" /** * @oas [delete] /order-edits/{id}/changes/{change_id} * operationId: "DeleteOrderEditsOrderEditItemChange" - * summary: "Delete an Order Edit Item Change" + * summary: "Delete a Line Item Change" * description: "Deletes an Order Edit Item Change" * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit.ts index f65b60f98f..16f1653b71 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/delete-order-edit.ts @@ -5,7 +5,7 @@ import { OrderEditService } from "../../../../services" * @oas [delete] /order-edits/{id} * operationId: "DeleteOrderEditsOrderEdit" * summary: "Delete an Order Edit" - * description: "Deletes an Order Edit" + * description: "Delete an Order Edit" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order Edit to delete. diff --git a/packages/medusa/src/api/routes/admin/order-edits/get-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/get-order-edit.ts index 458230490a..0ac1ec7451 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/get-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/get-order-edit.ts @@ -5,7 +5,7 @@ import { FindParams } from "../../../../types/common" /** * @oas [get] /order-edits/{id} * operationId: "GetOrderEditsOrderEdit" - * summary: "Retrieve an OrderEdit" + * summary: "Get an OrderEdit" * description: "Retrieves a OrderEdit." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/order-edits/request-confirmation.ts b/packages/medusa/src/api/routes/admin/order-edits/request-confirmation.ts index 1715895a73..d6179150ee 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/request-confirmation.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/request-confirmation.ts @@ -14,7 +14,7 @@ import { PaymentCollectionType } from "../../../../models" /** * @oas [post] /order-edits/{id}/request * operationId: "PostOrderEditsOrderEditRequest" - * summary: "Request order edit confirmation" + * summary: "Request Confirmation" * description: "Request customer confirmation of an Order Edit" * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/order-edits/update-order-edit-line-item.ts b/packages/medusa/src/api/routes/admin/order-edits/update-order-edit-line-item.ts index 92c7043ae4..bc9e4093d1 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/update-order-edit-line-item.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/update-order-edit-line-item.ts @@ -10,7 +10,7 @@ import { /** * @oas [post] /order-edits/{id}/items/{item_id} * operationId: "PostOrderEditsEditLineItemsLineItem" - * summary: "Create or update the order edit change holding the line item changes" + * summary: "Upsert Line Item Change" * description: "Create or update the order edit change holding the line item changes" * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/order-edits/update-order-edit.ts b/packages/medusa/src/api/routes/admin/order-edits/update-order-edit.ts index 43f440be4b..4c39353ff0 100644 --- a/packages/medusa/src/api/routes/admin/order-edits/update-order-edit.ts +++ b/packages/medusa/src/api/routes/admin/order-edits/update-order-edit.ts @@ -11,7 +11,7 @@ import { /** * @oas [post] /order-edits/{id} * operationId: "PostOrderEditsOrderEdit" - * summary: "Updates an OrderEdit" + * summary: "Update an OrderEdit" * description: "Updates a OrderEdit." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/payment-collections/delete-payment-collection.ts b/packages/medusa/src/api/routes/admin/payment-collections/delete-payment-collection.ts index cc3b6c63b1..b87970532a 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/delete-payment-collection.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/delete-payment-collection.ts @@ -3,7 +3,7 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [delete] /payment-collections/{id} * operationId: "DeletePaymentCollectionsPaymentCollection" - * summary: "Delete a Payment Collection" + * summary: "Del a PaymentCollection" * description: "Deletes a Payment Collection" * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts b/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts index 6710b2c8f3..e76dc35793 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/get-payment-collection.ts @@ -4,7 +4,7 @@ import { FindParams } from "../../../../types/common" /** * @oas [get] /payment-collections/{id} * operationId: "GetPaymentCollectionsPaymentCollection" - * summary: "Retrieve an PaymentCollection" + * summary: "Get a PaymentCollection" * description: "Retrieves a PaymentCollection." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/payment-collections/mark-authorized-payment-collection.ts b/packages/medusa/src/api/routes/admin/payment-collections/mark-authorized-payment-collection.ts index 8e8a0fbfb3..42346356f6 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/mark-authorized-payment-collection.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/mark-authorized-payment-collection.ts @@ -4,7 +4,7 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [post] /payment-collections/{id}/authorize * operationId: "PostPaymentCollectionsPaymentCollectionAuthorize" - * summary: "Set the status of PaymentCollection as Authorized" + * summary: "Mark Authorized" * description: "Sets the status of PaymentCollection as Authorized." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/payment-collections/update-payment-collection.ts b/packages/medusa/src/api/routes/admin/payment-collections/update-payment-collection.ts index 40adb2aed9..83af43a19b 100644 --- a/packages/medusa/src/api/routes/admin/payment-collections/update-payment-collection.ts +++ b/packages/medusa/src/api/routes/admin/payment-collections/update-payment-collection.ts @@ -6,7 +6,7 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [post] /payment-collections/{id} * operationId: "PostPaymentCollectionsPaymentCollection" - * summary: "Updates a PaymentCollection" + * summary: "Update PaymentCollection" * description: "Updates a PaymentCollection." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/add-channels-batch.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/add-channels-batch.ts index 0148df84ef..9de91351d9 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/add-channels-batch.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/add-channels-batch.ts @@ -9,7 +9,7 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [post] /publishable-api-keys/{id}/sales-channels/batch * operationId: "PostPublishableApiKeySalesChannelsChannelsBatch" - * summary: "Add sales channel to a publishable api key scope" + * summary: "Add SalesChannels" * description: "Assign a batch of sales channels to a publishable api key." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/create-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/create-publishable-api-key.ts index a0c08a2cda..a480f588b6 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/create-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/create-publishable-api-key.ts @@ -7,7 +7,7 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [post] /publishable-api-keys * operationId: "PostPublishableApiKeys" - * summary: "Create a PublishableApiKey" + * summary: "Create PublishableApiKey" * description: "Creates a PublishableApiKey." * requestBody: * content: diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-channels-batch.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-channels-batch.ts index b29b6de0fa..4c1d40206e 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-channels-batch.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-channels-batch.ts @@ -9,7 +9,7 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [delete] /publishable-api-keys/{id}/sales-channels/batch * operationId: "DeletePublishableApiKeySalesChannelsChannelsBatch" - * summary: "Remove sales channel from a publishable api key scope" + * summary: "Delete SalesChannels" * description: "Remove a batch of sales channels from a publishable api key." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-publishable-api-key.ts index c916929798..25d69f06a0 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/delete-publishable-api-key.ts @@ -5,7 +5,7 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [delete] /publishable-api-keys/{id} * operationId: "DeletePublishableApiKeysPublishableApiKey" - * summary: "Delete a PublishableApiKey" + * summary: "Delete PublishableApiKey" * description: "Deletes a PublishableApiKeys" * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/get-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/get-publishable-api-key.ts index eda1667d77..4223587400 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/get-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/get-publishable-api-key.ts @@ -5,7 +5,7 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [get] /publishable-api-keys/{id} * operationId: "GetPublishableApiKeysPublishableApiKey" - * summary: "Get a Publishable API Key" + * summary: "Get a PublishableApiKey" * description: "Retrieve the Publishable Api Key." * parameters: * - (path) id=* {string} The ID of the PublishableApiKey. diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-key-sales-channels.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-key-sales-channels.ts index b9ac340377..47d575c5d5 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-key-sales-channels.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/list-publishable-api-key-sales-channels.ts @@ -7,7 +7,7 @@ import { extendedFindParamsMixin } from "../../../../types/common" /** * @oas [get] /publishable-api-keys/{id}/sales-channels * operationId: "GetPublishableApiKeySalesChannels" - * summary: "List PublishableApiKey's SalesChannels" + * summary: "List SalesChannels" * description: "List PublishableApiKey's SalesChannels" * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/revoke-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/revoke-publishable-api-key.ts index 6afe33e0b7..863934838a 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/revoke-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/revoke-publishable-api-key.ts @@ -6,7 +6,7 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [post] /publishable-api-keys/{id}/revoke * operationId: "PostPublishableApiKeysPublishableApiKeyRevoke" - * summary: "Revoke a PublishableApiKey" + * summary: "Revoke PublishableApiKey" * description: "Revokes a PublishableApiKey." * parameters: * - (path) id=* {string} The ID of the PublishableApiKey. diff --git a/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts b/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts index 1b271cfca7..6d5d33ee6b 100644 --- a/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts +++ b/packages/medusa/src/api/routes/admin/publishable-api-keys/update-publishable-api-key.ts @@ -7,7 +7,7 @@ import PublishableApiKeyService from "../../../../services/publishable-api-key" /** * @oas [post] /publishable-api-key/{id} * operationId: "PostPublishableApiKysPublishableApiKey" - * summary: "Updates a PublishableApiKey" + * summary: "Update PublishableApiKey" * description: "Updates a PublishableApiKey." * x-authenticated: true * parameters: diff --git a/packages/medusa/src/api/routes/admin/uploads/create-protected-upload.ts b/packages/medusa/src/api/routes/admin/uploads/create-protected-upload.ts index fc523c3d10..b87cffd814 100644 --- a/packages/medusa/src/api/routes/admin/uploads/create-protected-upload.ts +++ b/packages/medusa/src/api/routes/admin/uploads/create-protected-upload.ts @@ -4,8 +4,8 @@ import { IFileService } from "../../../../interfaces" /** * @oas [post] /uploads/protected * operationId: "PostUploadsProtected" - * summary: "Upload files with acl or in a non-public bucket" - * description: "Uploads at least one file to the specific fileservice that is installed in Medusa." + * 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: diff --git a/packages/medusa/src/api/routes/store/orders/confirm-order-request.ts b/packages/medusa/src/api/routes/store/orders/confirm-order-request.ts index d41dab78c5..c941c84585 100644 --- a/packages/medusa/src/api/routes/store/orders/confirm-order-request.ts +++ b/packages/medusa/src/api/routes/store/orders/confirm-order-request.ts @@ -9,7 +9,7 @@ import { /** * @oas [post] /orders/customer/confirm * operationId: "PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept" - * summary: "Verify a claim to orders" + * summary: "Verify an Order Claim" * description: "Verifies the claim order token provided to the customer upon request of order ownership" * requestBody: * content: @@ -44,7 +44,7 @@ import { * - api_token: [] * - cookie_auth: [] * tags: - * - Invite + * - Order * responses: * 200: * description: OK diff --git a/packages/medusa/src/api/routes/store/orders/request-order.ts b/packages/medusa/src/api/routes/store/orders/request-order.ts index 39439fa648..ab9f8f36da 100644 --- a/packages/medusa/src/api/routes/store/orders/request-order.ts +++ b/packages/medusa/src/api/routes/store/orders/request-order.ts @@ -11,7 +11,7 @@ import { TokenEvents } from "../../../../types/token" /** * @oas [post] /orders/batch/customer/token * operationId: "PostOrdersCustomerOrderClaim" - * summary: "Claim orders for signed in account" + * summary: "Claim an Order" * description: "Sends an email to emails registered to orders provided with link to transfer order ownership" * requestBody: * content: diff --git a/packages/medusa/src/api/routes/store/payment-collections/authorize-batch-payment-sessions.ts b/packages/medusa/src/api/routes/store/payment-collections/authorize-batch-payment-sessions.ts index b5a6ff4c98..3f6e5aa86f 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/authorize-batch-payment-sessions.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/authorize-batch-payment-sessions.ts @@ -4,7 +4,7 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [post] /payment-collections/{id}/sessions/batch/authorize * operationId: "PostPaymentCollectionsSessionsBatchAuthorize" - * summary: "Authorize Payment Sessions of a Payment Collection" + * summary: "Authorize PaymentSessions" * description: "Authorizes Payment Sessions of a Payment Collection." * x-authenticated: false * parameters: @@ -33,7 +33,7 @@ import { PaymentCollectionService } from "../../../../services" * - api_token: [] * - cookie_auth: [] * tags: - * - Payment + * - PaymentCollection * responses: * 200: * description: OK diff --git a/packages/medusa/src/api/routes/store/payment-collections/authorize-payment-session.ts b/packages/medusa/src/api/routes/store/payment-collections/authorize-payment-session.ts index b2d580b3c0..83b6ca2324 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/authorize-payment-session.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/authorize-payment-session.ts @@ -5,7 +5,7 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [post] /payment-collections/{id}/sessions/{session_id}/authorize * operationId: "PostPaymentCollectionsSessionsSessionAuthorize" - * summary: "Authorize a Payment Session of a Payment Collection" + * summary: "Authorize Payment Session" * description: "Authorizes a Payment Session of a Payment Collection." * x-authenticated: false * parameters: @@ -30,7 +30,7 @@ import { PaymentCollectionService } from "../../../../services" * - api_token: [] * - cookie_auth: [] * tags: - * - Payment + * - PaymentCollection * responses: * 200: * description: OK diff --git a/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts b/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts index b6402497b3..d9530b1aad 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/get-payment-collection.ts @@ -4,8 +4,8 @@ import { FindParams } from "../../../../types/common" /** * @oas [get] /payment-collections/{id} * operationId: "GetPaymentCollectionsPaymentCollection" - * summary: "Retrieve an PaymentCollection" - * description: "Retrieves a PaymentCollection." + * summary: "Get a PaymentCollection" + * description: "Get a Payment Collection" * x-authenticated: false * parameters: * - (path) id=* {string} The ID of the PaymentCollection. diff --git a/packages/medusa/src/api/routes/store/payment-collections/manage-batch-payment-sessions.ts b/packages/medusa/src/api/routes/store/payment-collections/manage-batch-payment-sessions.ts index 549ddd4751..f3566df96b 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/manage-batch-payment-sessions.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/manage-batch-payment-sessions.ts @@ -7,7 +7,7 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [post] /payment-collections/{id}/sessions/batch * operationId: "PostPaymentCollectionsPaymentCollectionSessionsBatch" - * summary: "Manage Multiple Payment Sessions from Payment Collections" + * summary: "Manage Payment Sessions" * description: "Manages Multiple Payment Sessions from Payment Collections." * x-authenticated: false * parameters: @@ -61,7 +61,7 @@ import { PaymentCollectionService } from "../../../../services" * - api_token: [] * - cookie_auth: [] * tags: - * - Payment + * - PaymentCollection * responses: * 200: * description: OK diff --git a/packages/medusa/src/api/routes/store/payment-collections/manage-payment-session.ts b/packages/medusa/src/api/routes/store/payment-collections/manage-payment-session.ts index cc99e80093..861c9f19ee 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/manage-payment-session.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/manage-payment-session.ts @@ -6,7 +6,7 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [post] /payment-collections/{id}/sessions * operationId: "PostPaymentCollectionsSessions" - * summary: "Manage Payment Sessions from Payment Collections" + * summary: "Manage a Payment Session" * description: "Manages Payment Sessions from Payment Collections." * x-authenticated: false * parameters: @@ -40,7 +40,7 @@ import { PaymentCollectionService } from "../../../../services" * - api_token: [] * - cookie_auth: [] * tags: - * - Payment + * - PaymentCollection * responses: * 200: * description: OK diff --git a/packages/medusa/src/api/routes/store/payment-collections/refresh-payment-session.ts b/packages/medusa/src/api/routes/store/payment-collections/refresh-payment-session.ts index f7294588f7..ac91104d15 100644 --- a/packages/medusa/src/api/routes/store/payment-collections/refresh-payment-session.ts +++ b/packages/medusa/src/api/routes/store/payment-collections/refresh-payment-session.ts @@ -4,7 +4,7 @@ import { PaymentCollectionService } from "../../../../services" /** * @oas [post] /payment-collections/{id}/sessions/{session_id} * operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession - * summary: Refresh a Payment Session + * 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: diff --git a/packages/medusa/src/services/event-bus.ts b/packages/medusa/src/services/event-bus.ts index e9ae4d896d..da5068cae3 100644 --- a/packages/medusa/src/services/event-bus.ts +++ b/packages/medusa/src/services/event-bus.ts @@ -52,6 +52,7 @@ export default class EventBusService { stagedJobRepository, redisClient, redisSubscriber, + jobSchedulerService, }: InjectedDependencies, config: ConfigModule, singleton = true @@ -59,6 +60,7 @@ export default class EventBusService { this.config_ = config this.manager_ = manager this.logger_ = logger + this.jobSchedulerService_ = jobSchedulerService this.stagedJobRepository_ = stagedJobRepository if (singleton) { diff --git a/www/docs/docusaurus.config.js b/www/docs/docusaurus.config.js index 18497638d1..8dcfda82ad 100644 --- a/www/docs/docusaurus.config.js +++ b/www/docs/docusaurus.config.js @@ -191,7 +191,10 @@ const config = { href: 'https://github.com/medusajs/medusa' }, ], - reportCodeLinkPrefix: 'https://github.com/medusajs/medusa/issues/new?assignees=&labels=type%3A+docs&template=docs.yml' + reportCodeLinkPrefix: 'https://github.com/medusajs/medusa/issues/new?assignees=&labels=type%3A+docs&template=docs.yml', + footerFeedback: { + event: 'survey' + } }, presets: [ [ diff --git a/www/docs/netlify.toml b/www/docs/netlify.toml new file mode 100644 index 0000000000..03b920b820 --- /dev/null +++ b/www/docs/netlify.toml @@ -0,0 +1,87 @@ +[[redirects]] + from = "/api" + to = "/api/store" + +[[redirects]] + from = "/api/store/auth/*" + to = "/api/store/#tag/Auth" + +[[redirects]] + from = "/api/store/cart/*" + to = "/api/store/#tag/Cart" + +[[redirects]] + from = "/api/store/collection/*" + to = "/api/store/#tag/Collection" + +[[redirects]] + from = "/api/store/product/*" + to = "/api/store/#tag/Product" + +[[redirects]] + from = "/api/admin/auth/*" + to = "/api/admin/#tag/Auth" + +[[redirects]] + from = "/api/admin/users/*" + to = "/api/admin/#tag/User" + +[[redirects]] + from = "/how-to/headless-ecommerce-store-with-gatsby-contentful-medusa" + to = "/add-plugins/contentful" + +[[redirects]] + from = "/how-to/deploying-on-heroku" + to = "/deployments/server/deploying-on-heroku" + +[[redirects]] + from = "/admin/introduction" + to = "/admin/quickstart" + +[[redirects]] + from = "/admin/quickstart/quick-start" + to = "/admin/quickstart" + +[[redirects]] + from = "/admin/quickstart" + to = "/admin/quickstart" + +[[redirects]] + from = "/quickstart/starters/nextjs-medusa-starter" + to = "/starters/nextjs-medusa-starter" + +[[redirects]] + from = "/quickstart/starters/gatsby-medusa-starter" + to = "/starters/gatsby-medusa-starter" + +[[redirects]] + from = "/how-to/create-medusa-app" + to = "/usage/create-medusa-app" + +[[redirects]] + from = "/guides/plugins" + to = "/advanced/backend/plugins/overview" + +[[redirects]] + from = "/how-to/deploying-admin-on-netlify" + to = "/deployments/admin/deploying-on-netlify" + +[[redirects]] + from = "/how-to/deploying-on-digital-ocean/" + to = "/deployments/server/deploying-on-digital-ocean" + +[[redirects]] + from = "/how-to/deploying-on-qovery/" + to = "/deployments/server/deploying-on-qovery" + +[[redirects]] + from = "/guides/fulfillment-api" + to = "/advanced/backend/shipping/add-fulfillment-provider" + +[[redirects]] + from = "/guides/checkouts" + to = "/advanced/storefront/how-to-implement-checkout-flow" + +[[redirects]] + from = "/guides/checkouts" + to = "/advanced/storefront/how-to-implement-checkout-flow" \ No newline at end of file diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 290528d71f..5616fd8b12 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -176,18 +176,13 @@ module.exports = { items: [ { type: "doc", - id: "advanced/backend/upgrade-guides/1-3-0", - label: "v1.3.0" + id: "advanced/backend/upgrade-guides/1-7-1", + label: "v1.7.1" }, { type: "doc", - id: "advanced/backend/upgrade-guides/1-3-6", - label: "v1.3.6" - }, - { - type: "doc", - id: "advanced/backend/upgrade-guides/1-3-8", - label: "v1.3.8" + id: "advanced/backend/upgrade-guides/1-7-0", + label: "v1.7.0" }, { type: "doc", @@ -196,8 +191,18 @@ module.exports = { }, { type: "doc", - id: "advanced/backend/upgrade-guides/1-7-0", - label: "v1.7.0" + id: "advanced/backend/upgrade-guides/1-3-8", + label: "v1.3.8" + }, + { + type: "doc", + id: "advanced/backend/upgrade-guides/1-3-6", + label: "v1.3.6" + }, + { + type: "doc", + id: "advanced/backend/upgrade-guides/1-3-0", + label: "v1.3.0" }, { type: "doc", @@ -237,6 +242,11 @@ module.exports = { id: "advanced/storefront/use-regions", label: "Use Regions" }, + { + type: "doc", + id: "advanced/storefront/customer-profiles", + label: "Add Customer Profiles" + }, { type: "doc", id: "guides/carts-in-medusa", @@ -262,6 +272,11 @@ module.exports = { id: "advanced/storefront/implement-claim-order", label: "Implement Claim Order" }, + { + type: "doc", + id: "advanced/storefront/handle-order-edits", + label: "Handle Order Edits" + }, { type: "doc", id: "advanced/storefront/use-sales-channels", @@ -275,8 +290,18 @@ module.exports = { items: [ { type: "doc", - id: "advanced/admin/manage-regions", - label: "Manage Regions" + id: "advanced/admin/order-edit", + label: "Edit an Order" + }, + { + type: "doc", + id: "advanced/admin/manage-customers", + label: "Manage Customers" + }, + { + type: "doc", + id: "advanced/admin/use-customergroups-api", + label: "Manage Customer Groups" }, { type: "doc", @@ -291,22 +316,22 @@ module.exports = { { type: "doc", id: "advanced/backend/price-lists/use-api", - label: "Use PriceList APIs" - }, - { - type: "doc", - id: "advanced/backend/sales-channels/manage-admin", - label: "Use SalesChannel APIs" - }, - { - type: "doc", - id: "advanced/admin/use-customergroups-api", - label: "Use CustomerGroup APIs" + label: "Manage PriceLists" }, { type: "doc", id: "advanced/admin/manage-discounts", - label: "Use Discount APIs" + label: "Manage Discounts" + }, + { + type: "doc", + id: "advanced/admin/manage-regions", + label: "Manage Regions" + }, + { + type: "doc", + id: "advanced/backend/sales-channels/manage-admin", + label: "Manage Sales Channels" }, ] }, @@ -444,6 +469,10 @@ module.exports = { id: "advanced/backend/regions/overview", label: "Regions" }, + { + type: "doc", + id: "advanced/backend/customers/index" + }, { type: "doc", id: "advanced/backend/taxes/inclusive-pricing", @@ -607,6 +636,16 @@ module.exports = { id: "troubleshooting/cli-installation-errors", label: "Errors Installing CLI", }, + { + type: "doc", + id: "troubleshooting/common-installation-errors", + label: "Installation Errors", + }, + { + type: "doc", + id: "troubleshooting/database-error", + label: "Database SASL Error", + }, { type: "doc", id: "troubleshooting/cors-issues", diff --git a/www/docs/src/components/Feedback/index.css b/www/docs/src/components/Feedback/index.css index cfbf36696d..d67e1f66af 100644 --- a/www/docs/src/components/Feedback/index.css +++ b/www/docs/src/components/Feedback/index.css @@ -1,6 +1,7 @@ .feedback-container { padding-top: var(--ifm-base-margin-vertical); + padding-bottom: var(--ifm-base-margin-vertical); border-top: 1px solid var(--ifm-doc-footer-border-color); } diff --git a/www/docs/src/components/Feedback/index.js b/www/docs/src/components/Feedback/index.js index ffc4a6ce54..47ff900210 100644 --- a/www/docs/src/components/Feedback/index.js +++ b/www/docs/src/components/Feedback/index.js @@ -5,7 +5,16 @@ import './index.css'; import useIsBrowser from '@docusaurus/useIsBrowser'; import {useLocation} from '@docusaurus/router'; -export default function Feedback () { +export default function Feedback ({ + event, + question = 'Was this page helpful?', + positiveBtn = 'Yes', + negativeBtn = 'No', + positiveQuestion = 'What was most helpful?', + negativeQuestion = 'What can we improve?', + submitBtn = 'Submit', + submitMessage = 'Thank you for helping improve our documentation!' +}) { const [showForm, setShowForm] = useState(false); const [submittedFeedback, setSubmittedFeedback] = useState(false); const [loading, setLoading] = useState(false); @@ -28,7 +37,7 @@ export default function Feedback () { if (isBrowser) { if (window.analytics) { setLoading(true); - window.analytics.track('survey', { + window.analytics.track(event, { url: location.pathname, label: document.title, feedback: positiveFeedback ? 'yes' : 'no', @@ -63,21 +72,21 @@ export default function Feedback () { <> {(!showForm && !submittedFeedback) && (
- Was this page helpful? - - + {question} + +
)} {(showForm && !submittedFeedback) && (
- {positiveFeedback ? 'What was most helpful?' : 'What can we improve?'} + {positiveFeedback ? positiveQuestion : negativeQuestion} - +
)} {submittedFeedback && (
- Thank you for helping improve our documentation! + {submitMessage}
)} diff --git a/www/docs/src/css/_docspage.css b/www/docs/src/css/_docspage.css index 7d93f33ea8..deb48dfd4c 100644 --- a/www/docs/src/css/_docspage.css +++ b/www/docs/src/css/_docspage.css @@ -83,7 +83,7 @@ kbd { } .theme-doc-footer { - margin-top: var(--ifm-base-margin-vertical) !important; + margin-top: 0 !important; border-top: 1px solid var(--ifm-doc-footer-border-color) !important; padding-top: var(--ifm-base-margin-vertical); } diff --git a/www/docs/src/theme/DocItem/Footer/index.js b/www/docs/src/theme/DocItem/Footer/index.js index ee7380f112..3776679a9e 100644 --- a/www/docs/src/theme/DocItem/Footer/index.js +++ b/www/docs/src/theme/DocItem/Footer/index.js @@ -2,15 +2,17 @@ import React from 'react'; import Footer from '@theme-original/DocItem/Footer'; import Feedback from '../../../components/Feedback'; import { useDoc } from '@docusaurus/theme-common/internal'; +import {useThemeConfig} from '@docusaurus/theme-common'; export default function FooterWrapper(props) { const { metadata } = useDoc() + const { footerFeedback = { event: '' } } = useThemeConfig(); return ( <> {!metadata.frontMatter?.hide_footer && (
- +
)} diff --git a/yarn.lock b/yarn.lock index c8773f73be..e7c74d45f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1826,7 +1826,7 @@ __metadata: languageName: node linkType: hard -"@babel/preset-react@npm:^7.12.10, @babel/preset-react@npm:^7.14.0": +"@babel/preset-react@npm:^7.12.10, @babel/preset-react@npm:^7.14.0, @babel/preset-react@npm:^7.18.6": version: 7.18.6 resolution: "@babel/preset-react@npm:7.18.6" dependencies: @@ -9888,6 +9888,19 @@ __metadata: languageName: node linkType: hard +"array-includes@npm:^3.1.6": + version: 3.1.6 + resolution: "array-includes@npm:3.1.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + get-intrinsic: ^1.1.3 + is-string: ^1.0.7 + checksum: d0caeaa57bea7d14b8480daee30cf8611899321006b15a6cd872b831bd7aaed7649f8764e060d01c5d33b8d9e998e5de5c87f4901874e1c1f467f429b7db2929 + languageName: node + linkType: hard + "array-union@npm:^1.0.2": version: 1.0.2 resolution: "array-union@npm:1.0.2" @@ -9942,6 +9955,18 @@ __metadata: languageName: node linkType: hard +"array.prototype.flatmap@npm:^1.3.1": + version: 1.3.1 + resolution: "array.prototype.flatmap@npm:1.3.1" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + es-shim-unscopables: ^1.0.0 + checksum: 2bd58a0e79d5d90cb4f5ef0e287edf8b28e87c65428f54025ac6b7b4c204224b92811c266f296c53a2dbc93872117c0fcea2e51d3c9e8cecfd5024d4a4a57db4 + languageName: node + linkType: hard + "array.prototype.map@npm:^1.0.4": version: 1.0.4 resolution: "array.prototype.map@npm:1.0.4" @@ -9968,6 +9993,19 @@ __metadata: languageName: node linkType: hard +"array.prototype.tosorted@npm:^1.1.1": + version: 1.1.1 + resolution: "array.prototype.tosorted@npm:1.1.1" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + es-shim-unscopables: ^1.0.0 + get-intrinsic: ^1.1.3 + checksum: fd5f57aca3c7ddcd1bb83965457b625f3a67d8f334f5cbdb8ac8ef33d5b0d38281524114db2936f8c08048115d5158af216c94e6ae1eb966241b9b6f4ab8a7e8 + languageName: node + linkType: hard + "arrify@npm:^1.0.1": version: 1.0.1 resolution: "arrify@npm:1.0.1" @@ -13756,7 +13794,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:~4.3.1": +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:~4.3.1": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -14894,6 +14932,39 @@ __metadata: languageName: node linkType: hard +"es-abstract@npm:^1.20.4": + version: 1.20.5 + resolution: "es-abstract@npm:1.20.5" + dependencies: + call-bind: ^1.0.2 + es-to-primitive: ^1.2.1 + function-bind: ^1.1.1 + function.prototype.name: ^1.1.5 + get-intrinsic: ^1.1.3 + get-symbol-description: ^1.0.0 + gopd: ^1.0.1 + has: ^1.0.3 + has-property-descriptors: ^1.0.0 + has-symbols: ^1.0.3 + internal-slot: ^1.0.3 + is-callable: ^1.2.7 + is-negative-zero: ^2.0.2 + is-regex: ^1.1.4 + is-shared-array-buffer: ^1.0.2 + is-string: ^1.0.7 + is-weakref: ^1.0.2 + object-inspect: ^1.12.2 + object-keys: ^1.1.1 + object.assign: ^4.1.4 + regexp.prototype.flags: ^1.4.3 + safe-regex-test: ^1.0.0 + string.prototype.trimend: ^1.0.6 + string.prototype.trimstart: ^1.0.6 + unbox-primitive: ^1.0.2 + checksum: c99f8a3e9ac15890cde5bf78d1910d72758d3e79c710bd1ad2ab6b595d39ad07209626befaa7c18591bd935a02f6a3bdba3a7e9c8dd6a01146e655df09dc4353 + languageName: node + linkType: hard + "es-array-method-boxes-properly@npm:^1.0.0": version: 1.0.0 resolution: "es-array-method-boxes-properly@npm:1.0.0" @@ -15265,6 +15336,17 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-markdown@npm:^3.0.0": + version: 3.0.0 + resolution: "eslint-plugin-markdown@npm:3.0.0" + dependencies: + mdast-util-from-markdown: ^0.8.5 + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + checksum: 3424fd97b6990cbed7be3764ae8bec7eae9bd1cc03cd76d8d1cf38e088a9777ed4491921e7e1a8d3a146361bcd935e5ed1b2bfd4fd623bcdafdb824bccfdd2b2 + languageName: node + linkType: hard + "eslint-plugin-prettier@npm:^4.2.1": version: 4.2.1 resolution: "eslint-plugin-prettier@npm:4.2.1" @@ -15313,6 +15395,31 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-react@npm:^7.31.11": + version: 7.31.11 + resolution: "eslint-plugin-react@npm:7.31.11" + dependencies: + array-includes: ^3.1.6 + array.prototype.flatmap: ^1.3.1 + array.prototype.tosorted: ^1.1.1 + doctrine: ^2.1.0 + estraverse: ^5.3.0 + jsx-ast-utils: ^2.4.1 || ^3.0.0 + minimatch: ^3.1.2 + object.entries: ^1.1.6 + object.fromentries: ^2.0.6 + object.hasown: ^1.1.2 + object.values: ^1.1.6 + prop-types: ^15.8.1 + resolve: ^2.0.0-next.3 + semver: ^6.3.0 + string.prototype.matchall: ^4.0.8 + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + checksum: 2f8d27adbfe1b551a170cc1340dd8bbecf6c9fdbfcde04dd1097bbf198e99f0c981af84bc3c69f851af5736cc4d6520687a03dfb3271717079f88983d79cb9cd + languageName: node + linkType: hard + "eslint-plugin-testing-library@npm:^5.5.1": version: 5.5.1 resolution: "eslint-plugin-testing-library@npm:5.5.1" @@ -17753,6 +17860,17 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.1.3": + version: 1.1.3 + resolution: "get-intrinsic@npm:1.1.3" + dependencies: + function-bind: ^1.1.1 + has: ^1.0.3 + has-symbols: ^1.0.3 + checksum: 6f201d5f95ea0dd6c8d0dc2c265603aff0b9e15614cb70f8f4674bb3d2b2369d521efaa84d0b70451d2c00762ebd28402758bf46279c6f2a00d242ebac0d8442 + languageName: node + linkType: hard + "get-own-enumerable-property-symbols@npm:^3.0.0": version: 3.0.2 resolution: "get-own-enumerable-property-symbols@npm:3.0.2" @@ -18152,6 +18270,15 @@ __metadata: languageName: node linkType: hard +"gopd@npm:^1.0.1": + version: 1.0.1 + resolution: "gopd@npm:1.0.1" + dependencies: + get-intrinsic: ^1.1.3 + checksum: 505c05487f7944c552cee72087bf1567debb470d4355b1335f2c262d218ebbff805cd3715448fe29b4b380bae6912561d0467233e4165830efd28da241418c63 + languageName: node + linkType: hard + "got@npm:^11.8.2, got@npm:^11.8.5": version: 11.8.5 resolution: "got@npm:11.8.5" @@ -19613,6 +19740,13 @@ __metadata: languageName: node linkType: hard +"is-callable@npm:^1.2.7": + version: 1.2.7 + resolution: "is-callable@npm:1.2.7" + checksum: ceebaeb9d92e8adee604076971dd6000d38d6afc40bb843ea8e45c5579b57671c3f3b50d7f04869618242c6cee08d1b67806a8cb8edaaaf7c0748b3720d6066f + languageName: node + linkType: hard + "is-ci@npm:^2.0.0": version: 2.0.0 resolution: "is-ci@npm:2.0.0" @@ -23624,6 +23758,19 @@ __metadata: languageName: node linkType: hard +"mdast-util-from-markdown@npm:^0.8.5": + version: 0.8.5 + resolution: "mdast-util-from-markdown@npm:0.8.5" + dependencies: + "@types/mdast": ^3.0.0 + mdast-util-to-string: ^2.0.0 + micromark: ~2.11.0 + parse-entities: ^2.0.0 + unist-util-stringify-position: ^2.0.0 + checksum: 86e7589e574378817c180f10ab602db844b6b71b7b1769314947a02ef42ac5c1435f5163d02a975ae8cdab8b6e6176acbd9188da1848ddd5f0d5e09d0291c870 + languageName: node + linkType: hard + "mdast-util-to-hast@npm:10.0.1": version: 10.0.1 resolution: "mdast-util-to-hast@npm:10.0.1" @@ -23647,6 +23794,13 @@ __metadata: languageName: node linkType: hard +"mdast-util-to-string@npm:^2.0.0": + version: 2.0.0 + resolution: "mdast-util-to-string@npm:2.0.0" + checksum: a4231085133cdfec24644b694c13661e5a01d26716be0105b6792889faa04b8030e4abbf72d4be3363098b2b38b2b98f1f1f1f0858eb6580dc04e2aca1436a37 + languageName: node + linkType: hard + "mdn-data@npm:2.0.14": version: 2.0.14 resolution: "mdn-data@npm:2.0.14" @@ -24723,6 +24877,16 @@ __metadata: languageName: node linkType: hard +"micromark@npm:~2.11.0": + version: 2.11.4 + resolution: "micromark@npm:2.11.4" + dependencies: + debug: ^4.0.0 + parse-entities: ^2.0.0 + checksum: 67307cbacae621ab1eb23e333a5addc7600cf97d3b40cad22fc1c2d03d734d6d9cbc3f5a7e5d655a8c0862a949abe590ab7cfa96be366bfe09e239a94e6eea55 + languageName: node + linkType: hard + "micromatch@npm:4.x, micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": version: 4.0.5 resolution: "micromatch@npm:4.0.5" @@ -26102,7 +26266,7 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.12.0, object-inspect@npm:^1.9.0": +"object-inspect@npm:^1.12.0, object-inspect@npm:^1.12.2, object-inspect@npm:^1.9.0": version: 1.12.2 resolution: "object-inspect@npm:1.12.2" checksum: e1bd625f4c44a2f733bd69cfccce6469f71333fb09c6de151f4f346c16d658ef7555727b12652c108e20c2afb908ae7cd165f52ca53745a1d6cbf228cdb46ebe @@ -26154,6 +26318,18 @@ __metadata: languageName: node linkType: hard +"object.assign@npm:^4.1.4": + version: 4.1.4 + resolution: "object.assign@npm:4.1.4" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + has-symbols: ^1.0.3 + object-keys: ^1.1.1 + checksum: 2f286118c023e557757620e647b02e7c88d3d417e0c568fca0820de8ec9cca68928304854d5b03e99763eddad6e78a6716e2930f7e6372e4b9b843f3fd3056f3 + languageName: node + linkType: hard + "object.entries@npm:^1.1.0, object.entries@npm:^1.1.5": version: 1.1.5 resolution: "object.entries@npm:1.1.5" @@ -26165,6 +26341,17 @@ __metadata: languageName: node linkType: hard +"object.entries@npm:^1.1.6": + version: 1.1.6 + resolution: "object.entries@npm:1.1.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: 8782c71db3a068ccbae9e0541e6b4ac2c25dc67c63f97b7e6ad3c88271d7820197e7398e37747f96542ed47c27f0b81148cdf14c42df15dc22f64818ae7bb5bf + languageName: node + linkType: hard + "object.fromentries@npm:^2.0.0 || ^1.0.0, object.fromentries@npm:^2.0.5": version: 2.0.5 resolution: "object.fromentries@npm:2.0.5" @@ -26176,6 +26363,17 @@ __metadata: languageName: node linkType: hard +"object.fromentries@npm:^2.0.6": + version: 2.0.6 + resolution: "object.fromentries@npm:2.0.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: db6759ea68131cbdb70b1152f9984b49db03e81de4f6de079b39929bebd8b45501e5333ca2351991e07ee56f4651606c023396644e8f25c0806fa39a26c4c6e6 + languageName: node + linkType: hard + "object.getownpropertydescriptors@npm:^2.0.3, object.getownpropertydescriptors@npm:^2.1.1, object.getownpropertydescriptors@npm:^2.1.2": version: 2.1.4 resolution: "object.getownpropertydescriptors@npm:2.1.4" @@ -26198,6 +26396,16 @@ __metadata: languageName: node linkType: hard +"object.hasown@npm:^1.1.2": + version: 1.1.2 + resolution: "object.hasown@npm:1.1.2" + dependencies: + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: 419fc1c74a2aea7ebb4d49b79d5b1599a010b26c18eae35bd061ccdd013ccb749c499d8dd6ee21a91e6d7264ccc592573d0f13562970f76e25fc844d8c1b02ce + languageName: node + linkType: hard + "object.pick@npm:^1.3.0": version: 1.3.0 resolution: "object.pick@npm:1.3.0" @@ -26218,6 +26426,17 @@ __metadata: languageName: node linkType: hard +"object.values@npm:^1.1.6": + version: 1.1.6 + resolution: "object.values@npm:1.1.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: 3381204390f10c9f653a4875a50d221c67b5c16cb80a6ac06c706fc82a7cad8400857d4c7a0731193b0abb56b84fe803eabcf7addcf32de76397bbf207e68c66 + languageName: node + linkType: hard + "objectFitPolyfill@npm:^2.3.5": version: 2.3.5 resolution: "objectFitPolyfill@npm:2.3.5" @@ -30150,6 +30369,7 @@ __metadata: "@babel/plugin-transform-instanceof": ^7.10.4 "@babel/plugin-transform-runtime": ^7.11.5 "@babel/preset-env": ^7.11.5 + "@babel/preset-react": ^7.18.6 "@babel/register": ^7.11.5 "@babel/runtime": ^7.11.2 "@changesets/changelog-github": ^0.4.5 @@ -30167,7 +30387,9 @@ __metadata: eslint: ^8.23.0 eslint-config-google: ^0.14.0 eslint-config-prettier: ^8.5.0 + eslint-plugin-markdown: ^3.0.0 eslint-plugin-prettier: ^4.2.1 + eslint-plugin-react: ^7.31.11 express: ^4.17.1 get-port: ^5.1.1 global: ^4.4.0 @@ -30295,6 +30517,17 @@ __metadata: languageName: node linkType: hard +"safe-regex-test@npm:^1.0.0": + version: 1.0.0 + resolution: "safe-regex-test@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.1.3 + is-regex: ^1.1.4 + checksum: 14a81a7e683f97b2d6e9c8be61fddcf8ed7a02f4e64a825515f96bb1738eb007145359313741d2704d28b55b703a0f6300c749dde7c1dbc13952a2b85048ede2 + languageName: node + linkType: hard + "safe-regex@npm:^1.1.0": version: 1.1.0 resolution: "safe-regex@npm:1.1.0" @@ -31814,6 +32047,22 @@ __metadata: languageName: node linkType: hard +"string.prototype.matchall@npm:^4.0.8": + version: 4.0.8 + resolution: "string.prototype.matchall@npm:4.0.8" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + get-intrinsic: ^1.1.3 + has-symbols: ^1.0.3 + internal-slot: ^1.0.3 + regexp.prototype.flags: ^1.4.3 + side-channel: ^1.0.4 + checksum: 644523d05c1ee93bab7474e999a5734ee5f6ad2d7ad24ed6ea8706c270dc92b352bde0f2a5420bfbeed54e28cb6a770c3800e1988a5267a70fd5e677c7750abc + languageName: node + linkType: hard + "string.prototype.padend@npm:^3.0.0": version: 3.1.3 resolution: "string.prototype.padend@npm:3.1.3" @@ -31847,6 +32096,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.trimend@npm:^1.0.6": + version: 1.0.6 + resolution: "string.prototype.trimend@npm:1.0.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: 51b663e3195a74b58620a250b3fc4efb58951000f6e7d572a9f671c038f2f37f24a2b8c6994500a882aeab2f1c383fac1e8c023c01eb0c8b4e52d2f13b6c4513 + languageName: node + linkType: hard + "string.prototype.trimstart@npm:^1.0.5": version: 1.0.5 resolution: "string.prototype.trimstart@npm:1.0.5" @@ -31858,6 +32118,17 @@ __metadata: languageName: node linkType: hard +"string.prototype.trimstart@npm:^1.0.6": + version: 1.0.6 + resolution: "string.prototype.trimstart@npm:1.0.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: 13b9970d4e234002dfc8069c655c1fe19e83e10ced208b54858c41bb0f7544e581ac0ce746e92b279563664ad63910039f7253f36942113fec413b2b4e7c1fcd + languageName: node + linkType: hard + "string_decoder@npm:^1.0.0, string_decoder@npm:^1.1.1": version: 1.3.0 resolution: "string_decoder@npm:1.3.0"