diff --git a/.github/workflows/generate-api-reference.yml b/.github/workflows/generate-api-reference.yml index 126fb24b08..e6a651940e 100644 --- a/.github/workflows/generate-api-reference.yml +++ b/.github/workflows/generate-api-reference.yml @@ -1,21 +1,9 @@ name: Generate API Reference on: - push: - branches: - - "master" - paths: - - packages/medusa/src/api/routes/** - - '!packages/medusa/src/api/routes/**/index.ts' - - '!packages/medusa/src/api/routes/**/index.js' - pull_request: - types: - - closed - branches: - - "master" - paths: - - packages/medusa/src/api/routes/** - - '!packages/medusa/src/api/routes/**/index.ts' - - '!packages/medusa/src/api/routes/**/index.js' + workflow_dispatch: + release: + types: [published] + jobs: api: runs-on: ubuntu-latest diff --git a/.github/workflows/generate-entity-reference.yml b/.github/workflows/generate-entity-reference.yml index c7f97ce254..edb3f7a3bd 100644 --- a/.github/workflows/generate-entity-reference.yml +++ b/.github/workflows/generate-entity-reference.yml @@ -1,17 +1,9 @@ name: Generate Entity Reference on: - push: - branches: - - "master" - paths: - - packages/medusa/src/models/** - pull_request: - types: - - closed - branches: - - "master" - paths: - - packages/medusa/src/models/** + workflow_dispatch: + release: + types: [published] + jobs: services: runs-on: ubuntu-latest diff --git a/.github/workflows/generate-js-reference.yml b/.github/workflows/generate-js-reference.yml index 5c28fe2ed1..ff37428f71 100644 --- a/.github/workflows/generate-js-reference.yml +++ b/.github/workflows/generate-js-reference.yml @@ -1,17 +1,9 @@ name: Generate JS Client Reference on: - push: - branches: - - "master" - paths: - - packages/medusa-js/src/resources/** - pull_request: - types: - - closed - branches: - - "master" - paths: - - packages/medusa-js/src/resources/** + workflow_dispatch: + release: + types: [published] + jobs: services: runs-on: ubuntu-latest diff --git a/.github/workflows/generate-reference.yml b/.github/workflows/generate-reference.yml index 4852406797..256f80e4e4 100644 --- a/.github/workflows/generate-reference.yml +++ b/.github/workflows/generate-reference.yml @@ -1,17 +1,9 @@ name: Generate Services Reference on: - push: - branches: - - "master" - paths: - - packages/medusa/src/services/** - pull_request: - types: - - closed - branches: - - "master" - paths: - - packages/medusa/src/services/** + workflow_dispatch: + release: + types: [published] + jobs: services: runs-on: ubuntu-latest diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json new file mode 100644 index 0000000000..b0470e23cc --- /dev/null +++ b/docs/api/admin-spec3.json @@ -0,0 +1,32196 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Medusa Admin API + description: > + API reference for Medusa's Admin endpoints. All endpoints are prefixed with + `/admin`. + + + ## Authentication + + + There are two ways to send authenticated requests to the Medusa server: + Using a user's API token, or using a Cookie Session ID. + + + + + + ## Expanding Fields + + + In many endpoints you'll find an `expand` query parameter that can be passed + to the endpoint. You can use the `expand` query parameter to unpack an + entity's relations and return them in the response. + + + For example, when you list customers you can also retrieve their groups by + passing to the `expand` query parameter the value `groups`. + + + You can expand more than one relation by separating the relations in the + `expand` query parameter with a comma. For example, to retrieve both the + orders and the groups of a customer, pass to the `expand` query parameter + the value `groups,orders`. + + + Please note that the parameters you pass to `expand` replace any relations + that are expanded by default. + + + ## Selecting Fields + + + In many endpoints you'll find a `fields` query parameter that can be passed + to the endpoint. You can use the `fields` query parameter to specify which + fields in the entity should be returned in the response. + + + You can pass more than one field by seperating the field names in the + `fields` query parameter with a comma. + + + Only the fields you pass to `field` will be retrieved and returned in the + response. Any fields that are returned by default will not be returned in + this case. This does not affect relations. + + + For example, to only select the `title` and `description` fields of a + product, pass to the `fields` query parameter the value `title,description`. + + + ## Pagination + + + ### Query Parameters + + + In listing endpoints, such as list customers or list products, you can + control the pagination using the query parameters `limit` and `offset`. + + + `limit` is used to specify the maximum number of items that can be return in + the response. `offset` is used to specify how many items to skip before + returning the resulting entities. + + + You can use the `offset` query parameter to change between pages. For + example, if the limit is 50, at page 1 the offset should be 0; at page 2 the + offset should be 50, and so on. + + + ### Response Fields + + + In listing fields, aside from the entities retrieved, there are three + pagination-related fields returned: `count`, `limit`, and `offset`. + + + Similarly to the query parameters, `limit` is the maximum number of items + that can be returned in the response, and `field` is the number of items + that were skipped before the entities in the result. + + + `count` is the total number of available items of this entity. It can be + used to determine how many pages are there. + + + For example, if the `count` is 100 and the `limit` is 50, you can divide the + `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. + license: + name: MIT + url: 'https://github.com/medusajs/medusa/blob/master/LICENSE' +tags: + - name: Auth + description: >- + Auth endpoints that allow authorization of admin Users and manages their + sessions. + - name: App + description: App endpoints that allow handling apps in Medusa. + - name: Batch Job + description: Batch Job endpoints that allow handling batch jobs in Medusa. + - name: Claim + description: Claim endpoints that allow handling claims in Medusa. + - name: Collection + description: Collection endpoints that allow handling collections in Medusa. + - name: Customer + description: Customer endpoints that allow handling customers in Medusa. + - name: Customer Group + description: Customer Group endpoints that allow handling customer groups in Medusa. + - name: Discount + description: Discount endpoints that allow handling discounts in Medusa. + - name: Discount Condition + description: >- + Discount Condition endpoints that allow handling discount conditions in + Medusa. + - name: Draft Order + description: Draft Order endpoints that allow handling draft orders in Medusa. + - name: Gift Card + description: Gift Card endpoints that allow handling gift cards in Medusa. + - name: Invite + description: Invite endpoints that allow handling invites in Medusa. + - name: Note + description: Note endpoints that allow handling notes in Medusa. + - name: Notification + description: Notification endpoints that allow handling notifications in Medusa. + - name: Order + description: Order endpoints that allow handling orders in Medusa. + - name: Price List + description: Price List endpoints that allow handling price lists in Medusa. + - name: Product + description: Product endpoints that allow handling products in Medusa. + - name: Product Tag + description: Product Tag endpoints that allow handling product tags in Medusa. + - name: Product Type + description: Product Types endpoints that allow handling product types in Medusa. + - name: Product Variant + description: Product Variant endpoints that allow handling product variants in Medusa. + - name: Region + description: Region endpoints that allow handling regions in Medusa. + - name: Return Reason + description: Return Reason endpoints that allow handling return reasons in Medusa. + - name: Return + description: Return endpoints that allow handling returns in Medusa. + - name: Sales Channel + description: Sales Channel endpoints that allow handling sales channels in Medusa. + - name: Shipping Option + description: Shipping Option endpoints that allow handling shipping options in Medusa. + - name: Shipping Profile + description: >- + Shipping Profile endpoints that allow handling shipping profiles in + Medusa. + - name: Store + description: Store endpoints that allow handling stores in Medusa. + - name: Swap + description: Swap endpoints that allow handling swaps in Medusa. + - name: Tax Rate + description: Tax Rate endpoints that allow handling tax rates in Medusa. + - name: Upload + description: Upload endpoints that allow handling uploads in Medusa. + - name: User + description: User endpoints that allow handling users in Medusa. +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-codegen: + method: authorize + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/apps/authorizations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "application_name": "example", + "state": "ready", + "code": "token" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAppsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /apps: + get: + operationId: GetApps + summary: List Applications + description: Retrieve a list of applications. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/apps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAppsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /auth: + post: + operationId: PostAuth + summary: User Login + x-authenticated: false + description: Logs a User in and authorizes them to manage Store settings. + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - password + properties: + email: + type: string + description: The User's email. + password: + type: string + description: The User's password. + x-codegen: + method: createSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.admin.auth.createSession({ + email: 'user@example.com', + password: 'supersecret' + }).then((({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/incorrect_credentials' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteAuth + summary: User Logout + x-authenticated: true + description: Deletes the current session for the logged in user. + x-codegen: + method: deleteSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.auth.deleteSession() + - lang: Shell + label: cURL + source: > + curl --location --request DELETE 'https://medusa-url.com/admin/auth' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetAuth + summary: Get Current User + x-authenticated: true + description: Gets the currently logged in User. + x-codegen: + method: getSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.auth.getSession() + + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/auth' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/batch-jobs/{id}/cancel': + post: + operationId: PostBatchJobsBatchJobCancel + summary: Cancel a Batch Job + description: Marks a batch job as canceled + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the batch job. + schema: + type: string + x-codegen: + method: cancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.batchJobs.cancel(batch_job_id) + + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/batch-jobs/{id}/confirm': + post: + operationId: PostBatchJobsBatchJobConfirmProcessing + summary: Confirm a Batch Job + description: Confirms that a previously requested batch job should be executed. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the batch job. + schema: + type: string + x-codegen: + method: confirm + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.batchJobs.confirm(batch_job_id) + + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /batch-jobs: + post: + operationId: PostBatchJobs + summary: Create a Batch Job + description: Creates a Batch Job. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostBatchesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.batchJobs.create({ + type: 'product-export', + context: {}, + dry_run: false + }).then((({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/batch-jobs' \ + + --header 'Content-Type: application/json' \ + + --header 'Authorization: Bearer {api_token}' \ + + --data-raw '{ + "type": "product-export", + "context": { } + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '201': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetBatchJobs + summary: List Batch Jobs + description: Retrieve a list of Batch Jobs. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of batch jobs to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of batch jobs to skip before results. + schema: + type: integer + default: 0 + - in: query + name: id + style: form + explode: false + description: Filter by the batch ID + schema: + oneOf: + - type: string + description: batch job ID + - type: array + description: multiple batch job IDs + items: + type: string + - in: query + name: type + style: form + explode: false + description: Filter by the batch type + schema: + type: array + items: + type: string + - in: query + name: confirmed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was confirmed, i.e. + less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: pre_processed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was pre processed, + i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: completed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was completed, i.e. + less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: failed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was failed, i.e. less + than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: canceled_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was canceled, i.e. + less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: order + description: Field used to order retrieved batch jobs + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each order of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each order of + the result. + schema: + type: string + - in: query + name: created_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was created, i.e. + less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was updated, i.e. + less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.batchJobs.list() + + .then(({ batch_jobs, limit, offset, count }) => { + console.log(batch_jobs.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/batch-jobs' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/batch-jobs/{id}': + get: + operationId: GetBatchJobsBatchJob + summary: Get a Batch Job + description: Retrieves a Batch Job. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Batch Job + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.batchJobs.retrieve(batch_job_id) + + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/batch-jobs/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/collections/{id}/products/batch': + post: + operationId: PostProductsToCollection + summary: Update Products + description: Updates products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsToCollectionReq' + x-codegen: + method: addProducts + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductsFromCollection + summary: Remove Product + description: Removes products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteProductsFromCollectionReq' + x-codegen: + method: removeProducts + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteProductsFromCollectionRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.create({ + title: 'New Collection' + }) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of collections to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of collections to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: title + description: The title of collections to return. + schema: + type: string + - in: query + name: handle + description: The handle of collections to return. + schema: + type: string + - in: query + name: q + description: a search term to search titles and handles. + schema: + type: string + - in: query + name: discount_condition_id + description: >- + The discount condition id on which to filter the product + collections. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.list() + + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/collections' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.delete(collection_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Collection + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.retrieve(collection_id) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCollectionsCollection + summary: Update a Collection + description: Updates a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCollectionsCollectionReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.collections.update(collection_id, { + title: 'New Collection' + }) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency + x-authenticated: true + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' + x-codegen: + method: list + queryParams: AdminGetCurrenciesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCurrenciesListRes' + '/currencies/{code}': + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCurrenciesCurrencyReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.update(code, { + includes_tax: true + }) + + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCurrenciesRes' + '/customer-groups/{id}/customers/batch': + post: + operationId: PostCustomerGroupsGroupCustomersBatch + summary: Add Customers + description: 'Adds a list of customers, represented by id''s, to a customer group.' + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq + x-codegen: + method: addCustomers + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.addCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: Remove Customers + description: 'Removes a list of customers, represented by id''s, from a customer group.' + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq + x-codegen: + method: removeCustomers + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.removeCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customer-groups: + post: + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.create({ + name: 'VIP' + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCustomerGroups + summary: List Customer Groups + description: Retrieve a list of customer groups. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching customer group names. + schema: + type: string + - in: query + name: offset + description: How many groups to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: order + description: the field used to order the customer groups. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by the customer group ID + schema: + oneOf: + - type: string + description: customer group ID + - type: array + description: multiple customer group IDs + items: + type: string + - type: object + properties: + lt: + type: string + description: filter by IDs less than this ID + gt: + type: string + description: filter by IDs greater than this ID + lte: + type: string + description: filter by IDs less than or equal to this ID + gte: + type: string + description: filter by IDs greater than or equal to this ID + - in: query + name: name + style: form + explode: false + description: Filter by the customer group name + schema: + type: array + description: multiple customer group names + items: + type: string + description: customer group name + - in: query + name: created_at + description: Date comparison for when resulting customer groups were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting customer groups were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: limit + description: Limit the number of customer groups returned. + schema: + type: integer + default: 10 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each customer + groups of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetCustomerGroupsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.list() + + .then(({ customer_groups, limit, offset, count }) => { + console.log(customer_groups.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.delete(customer_group_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/customer-groups/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCustomerGroupsGroup + summary: Get a Customer Group + description: Retrieves a Customer Group. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer Group. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in the customer + group. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in the customer + group. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetCustomerGroupsGroupParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.retrieve(customer_group_id) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomerGroupsGroup + summary: Update a Customer Group + description: Update a CustomerGroup. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsGroupReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.update(customer_group_id, { + name: 'VIP' + }) + + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customer-groups/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/customer-groups/{id}/customers': + get: + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of customers in a customer group + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: 'a search term to search email, first_name, and last_name.' + schema: + type: string + x-codegen: + method: listCustomers + queryParams: AdminGetGroupsGroupCustomersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customerGroups.listCustomers(customer_group_id) + + .then(({ customers }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers: + post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomersReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customers.create({ + email: 'user@example.com', + first_name: 'Caterina', + last_name: 'Yost', + password: 'supersecret' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customers' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "first_name": "Caterina", + "last_name": "Yost", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '201': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCustomers + summary: List Customers + description: Retrieves a list of Customers. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: 'a search term to search email, first_name, and last_name.' + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetCustomersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customers.list() + + .then(({ customers, limit, offset, count }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/customers/{id}': + get: + operationId: GetCustomersCustomer + summary: Get a Customer + description: Retrieves a Customer. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the customer. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the customer. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customers.retrieve(customer_id) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/customers/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomer + summary: Update a Customer + description: Updates a Customer. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in each customer. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomersCustomerReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.customers.update(customer_id, { + first_name: 'Dolly' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/customers/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Dolly" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{id}/regions/{region_id}': + post: + operationId: PostDiscountsDiscountRegionsRegion + summary: Add Region + description: Adds a Region to the list of Regions that a Discount can be used in. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: addRegion + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.addRegion(discount_id, region_id) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountRegionsRegion + summary: Remove Region + x-authenticated: true + description: >- + Removes a Region from the list of Regions that a Discount can be used + in. + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: removeRegion + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.removeRegion(discount_id, region_id) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{discount_id}/conditions/{condition_id}/batch': + post: + operationId: PostDiscountsDiscountConditionsConditionBatch + summary: Add Batch Resources + description: Add a batch of resources to a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each + discount of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount + of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq + x-codegen: + method: addConditionResourceBatch + queryParams: AdminPostDiscountsDiscountConditionsConditionBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.addConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountConditionsConditionBatch + summary: Delete Batch Resources + description: Delete a batch of resources from a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each + discount of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount + of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq + x-codegen: + method: deleteConditionResourceBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.deleteConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{discount_id}/conditions': + post: + operationId: PostDiscountsDiscountConditions + summary: Create a Condition + description: >- + Creates a DiscountCondition. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` should be + provided. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditions' + x-codegen: + method: createCondition + queryParams: AdminPostDiscountsDiscountConditionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + import { DiscountConditionOperator } from "@medusajs/medusa" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.createCondition(discount_id, { + operator: DiscountConditionOperator.IN + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "operator": "in" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts: + post: + operationId: PostDiscounts + summary: Creates a Discount + x-authenticated: true + description: >- + Creates a Discount with a given set of rules that define how the + Discount behaves. + parameters: + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsReq' + x-codegen: + method: create + queryParams: AdminPostDiscountsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + import { AllocationType, DiscountRuleType } from "@medusajs/medusa" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.create({ + code: 'TEST', + rule: { + type: DiscountRuleType.FIXED, + value: 10, + allocation: AllocationType.ITEM + }, + regions: ["reg_XXXXXXXX"], + is_dynamic: false, + is_disabled: false + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "code": "TEST", + "rule": { + "type": "fixed", + "value": 10, + "allocation": "item" + }, + "regions": ["reg_XXXXXXXX"] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDiscounts + summary: List Discounts + x-authenticated: true + description: Retrieves a list of Discounts + parameters: + - in: query + name: q + description: Search query applied on the code field. + schema: + type: string + - in: query + name: rule + description: Discount Rules filters to apply on the search + schema: + type: object + properties: + type: + type: string + enum: + - fixed + - percentage + - free_shipping + description: >- + The type of the Discount, can be `fixed` for discounts that + reduce the price by a fixed amount, `percentage` for + percentage reductions or `free_shipping` for shipping + vouchers. + allocation: + type: string + enum: + - total + - item + description: >- + The value that the discount represents; this will depend on + the type of the discount + - in: query + name: is_dynamic + description: Return only dynamic discounts. + schema: + type: boolean + - in: query + name: is_disabled + description: Return only disabled discounts. + schema: + type: boolean + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetDiscountsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.list() + + .then(({ discounts, limit, offset, count }) => { + console.log(discounts.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/discounts' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{id}/dynamic-codes': + post: + operationId: PostDiscountsDiscountDynamicCodes + summary: Create a Dynamic Code + description: >- + Creates a dynamic unique code that can map to a parent Discount. This is + useful if you want to automatically generate codes with the same + behaviour. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount to create the dynamic code from." + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountDynamicCodesReq' + x-codegen: + method: createDynamicCode + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.createDynamicCode(discount_id, { + code: 'TEST', + usage_limit: 1 + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "code": "TEST" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{discount_id}/conditions/{condition_id}': + delete: + operationId: DeleteDiscountsDiscountConditionsCondition + summary: Delete a Condition + description: Deletes a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Discount + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: deleteCondition + queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.deleteCondition(discount_id, condition_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountConditionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDiscountsDiscountConditionsCondition + summary: Get a Condition + description: Gets a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: getCondition + queryParams: AdminGetDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.getCondition(discount_id, condition_id) + + .then(({ discount_condition }) => { + console.log(discount_condition.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountConditionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDiscountsDiscountConditionsCondition + summary: Update a Condition + description: >- + Updates a DiscountCondition. Only one of `products`, `product_types`, + `product_collections`, `product_tags`, and `customer_groups` should be + provided. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each item of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each item of + the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostDiscountsDiscountConditionsCondition + x-codegen: + method: updateCondition + queryParams: AdminPostDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.updateCondition(discount_id, condition_id, { + products: [ + product_id + ] + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "products": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{id}': + delete: + operationId: DeleteDiscountsDiscount + summary: Delete a Discount + description: Deletes a Discount. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.delete(discount_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDiscountsDiscount + summary: Get a Discount + description: Retrieves a Discount + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetDiscountParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.retrieve(discount_id) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/discounts/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDiscountsDiscount + summary: Update a Discount + description: >- + Updates a Discount with a given set of rules that define how the + Discount behaves. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each item of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each item of + the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountReq' + x-codegen: + method: update + queryParams: AdminPostDiscountsDiscountParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.update(discount_id, { + code: 'TEST' + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "code": "TEST" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/{id}/dynamic-codes/{code}': + delete: + operationId: DeleteDiscountsDiscountDynamicCodesCode + summary: Delete a Dynamic Code + description: Deletes a dynamic code from a Discount. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount + schema: + type: string + - in: path + name: code + required: true + description: The ID of the Discount + schema: + type: string + x-codegen: + method: deleteDynamicCode + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.deleteDynamicCode(discount_id, code) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/discounts/code/{code}': + get: + operationId: GetDiscountsDiscountCode + summary: Get Discount by Code + description: Retrieves a Discount by its discount code + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Discount + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieveByCode + queryParams: AdminGetDiscountsDiscountCodeParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.retrieveByCode(code) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/discounts/code/{code}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.create({ + email: 'user@example.com', + region_id, + items: [ + { + quantity: 1 + } + ], + shipping_methods: [ + { + option_id + } + ], + }) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "region_id": "{region_id}" + "items": [ + { + "quantity": 1 + } + ], + "shipping_methods": [ + { + "option_id": "{option_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDraftOrders + summary: List Draft Orders + description: Retrieves an list of Draft Orders + x-authenticated: true + parameters: + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: number + default: '50' + - in: query + name: q + description: >- + a search term to search emails in carts associated with draft orders + and display IDs of draft orders + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetDraftOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.list() + + .then(({ draft_orders, limit, offset, count }) => { + console.log(draft_orders.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/draft-orders' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{id}/line-items': + post: + operationId: PostDraftOrdersDraftOrderLineItems + summary: Create a Line Item + description: Creates a Line Item for the Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq' + x-codegen: + method: addLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.addLineItem(draft_order_id, { + quantity: 1 + }) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.delete(draft_order_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/draft-orders/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDraftOrdersDraftOrder + summary: Get a Draft Order + description: Retrieves a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.retrieve(draft_order_id) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/draft-orders/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: removeLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDraftOrdersDraftOrderLineItemsItem + summary: Update a Line Item + description: Updates a Line Item for a Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The ID of the Line Item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq + x-codegen: + method: updateLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { + quantity: 1 + }) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/draft-orders/{id}/pay': + post: + summary: Registers a Payment + operationId: PostDraftOrdersDraftOrderRegisterPayment + description: Registers a payment for a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Draft Order id. + schema: + type: string + x-codegen: + method: markPaid + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.markPaid(draft_order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/admin/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-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.draftOrders.update(draft_order_id, { + email: "user@example.com" + }) + + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/draft-orders/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /gift-cards: + post: + operationId: PostGiftCards + summary: Create a Gift Card + description: >- + Creates a Gift Card that can redeemed by its unique code. The Gift Card + is only valid within 1 region. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostGiftCardsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.giftCards.create({ + region_id + }) + + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/gift-cards' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "region_id": "{region_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetGiftCards + summary: List Gift Cards + description: Retrieves a list of Gift Cards. + x-authenticated: true + parameters: + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: number + default: '50' + - in: query + name: q + description: a search term to search by code or display ID + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetGiftCardsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.giftCards.list() + + .then(({ gift_cards, limit, offset, count }) => { + console.log(gift_cards.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/gift-cards' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/gift-cards/{id}': + delete: + operationId: DeleteGiftCardsGiftCard + summary: Delete a Gift Card + description: Deletes a Gift Card + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.giftCards.delete(gift_card_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/gift-cards/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetGiftCardsGiftCard + summary: Get a Gift Card + description: Retrieves a Gift Card. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.giftCards.retrieve(gift_card_id) + + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/gift-cards/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostGiftCardsGiftCard + summary: Update a Gift Card + description: >- + Update a Gift Card that can redeemed by its unique code. The Gift Card + is only valid within 1 region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.giftCards.update(gift_card_id, { + region_id + }) + + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/gift-cards/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "region_id": "{region_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/inventory-items/{id}/location-levels': + post: + operationId: PostInventoryItemsInventoryItemLocationLevels + summary: Create an Inventory Location Level for a given Inventory Item. + description: Creates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostInventoryItemsItemLocationLevelsReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, { + location_id: 'sloc', + stocked_quantity: 10, + }) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "location_id": "sloc", + "stocked_quantity": 10 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetInventoryItemsInventoryItemLocationLevels + summary: List stock levels of a given location. + description: Lists stock levels of a given location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: offset + description: How many stock locations levels to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of stock locations levels returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.listLocationLevels(inventoryItemId) + + .then(({ inventory_item }) => { + console.log(inventory_item.location_levels); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsLocationLevelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/inventory-items/{id}': + delete: + operationId: DeleteInventoryItemsInventoryItem + summary: Delete an Inventory Item + description: Delete an Inventory Item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.delete(inventoryItemId) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/inventory-items/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - InventoryItem + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetInventoryItemsInventoryItem + summary: Retrive an Inventory Item. + description: Retrives an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.retrieve(inventoryItemId) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/inventory-items/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItem + summary: Update an Inventory Item. + description: Updates an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsInventoryItemReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.update(inventoryItemId, { + origin_country: "US", + }) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/inventory-items/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "origin_country": "US" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/inventory-items/{id}/location-levels/{location_id}': + delete: + operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation + summary: Delete a location level of an Inventory Item. + description: Delete a location level of an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, + locationId) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel + summary: Update an Inventory Location Level for a given Inventory Item. + description: Updates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.updateLocationLevel(inventoryItemId, + locationId, { + stocked_quantity: 15, + }) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "stocked_quantity": 15 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /inventory-items: + get: + operationId: GetInventoryItems + summary: List inventory items. + description: Lists inventory items. + x-authenticated: true + parameters: + - in: query + name: offset + description: How many inventory items to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of inventory items returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + - in: query + name: q + description: >- + Query used for searching product inventory items and their + properties. + schema: + type: string + - in: query + name: location_id + style: form + explode: false + description: Locations ids to search for. + schema: + type: array + items: + type: string + - in: query + name: id + description: id to search for. + schema: + type: string + - in: query + name: sku + description: sku to search for. + schema: + type: string + - in: query + name: origin_country + description: origin_country to search for. + schema: + type: string + - in: query + name: mid_code + description: mid_code to search for. + schema: + type: string + - in: query + name: material + description: material to search for. + schema: + type: string + - in: query + name: hs_code + description: hs_code to search for. + schema: + type: string + - in: query + name: weight + description: weight to search for. + schema: + type: string + - in: query + name: length + description: length to search for. + schema: + type: string + - in: query + name: height + description: height to search for. + schema: + type: string + - in: query + name: width + description: width to search for. + schema: + type: string + - in: query + name: requires_shipping + description: requires_shipping to search for. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.list() + + .then(({ inventory_items }) => { + console.log(inventory_items.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/inventory-items' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /invites/accept: + post: + operationId: PostInvitesInviteAccept + summary: Accept an Invite + description: Accepts an Invite and creates a corresponding user + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInvitesInviteAcceptReq' + x-codegen: + method: accept + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.invites.accept({ + token, + user: { + first_name: 'Brigitte', + last_name: 'Collier', + password: 'supersecret' + } + }) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/invites/accept' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "token": "{token}", + "user": { + "first_name": "Brigitte", + "last_name": "Collier", + "password": "supersecret" + } + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /invites: + post: + operationId: PostInvites + summary: Create an Invite + description: Creates an Invite and triggers an 'invite' created event + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInvitesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.invites.create({ + user: "user@example.com", + role: "admin" + }) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/invites' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "user": "user@example.com", + "role": "admin" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetInvites + summary: Lists Invites + description: Lists all Invites + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.invites.list() + + .then(({ invites }) => { + console.log(invites.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET 'https://medusa-url.com/admin/invites' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminListInvitesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/invites/{invite_id}': + delete: + operationId: DeleteInvitesInvite + summary: Delete an Invite + description: Deletes an Invite + x-authenticated: true + parameters: + - in: path + name: invite_id + required: true + description: The ID of the Invite + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.invites.delete(invite_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/invites/{invite_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInviteDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/invites/{invite_id}/resend': + post: + operationId: PostInvitesInviteResend + summary: Resend an Invite + description: Resends an Invite by triggering the 'invite' created event again + x-authenticated: true + parameters: + - in: path + name: invite_id + required: true + description: The ID of the Invite + schema: + type: string + x-codegen: + method: resend + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.invites.resend(invite_id) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/invites/{invite_id}/resend' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /notes: + post: + operationId: PostNotes + summary: Creates a Note + description: Creates a Note which can be associated with any resource as required. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.notes.create({ + resource_id, + resource_type: 'order', + value: 'We delivered this order' + }) + + .then(({ note }) => { + console.log(note.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST 'https://medusa-url.com/admin/notes' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resource_id": "{resource_id}", + "resource_type": "order", + "value": "We delivered this order" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetNotes + summary: List Notes + x-authenticated: true + description: Retrieves a list of notes + parameters: + - in: query + name: limit + description: The number of notes to get + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset at which to get notes + schema: + type: number + default: '0' + - in: query + name: resource_id + description: The ID which the notes belongs to + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetNotesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.notes.list() + + .then(({ notes, limit, offset, count }) => { + console.log(notes.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/notes' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/notes/{id}': + delete: + operationId: DeleteNotesNote + summary: Delete a Note + description: Deletes a Note. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Note to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.notes.delete(note_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/notes/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetNotesNote + summary: Get a Note + description: Retrieves a single note using its id + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the note to retrieve. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.notes.retrieve(note_id) + + .then(({ note }) => { + console.log(note.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/notes/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostNotesNote + summary: Update a Note + x-authenticated: true + description: Updates a Note associated with some resource + parameters: + - in: path + name: id + required: true + description: The ID of the Note to update + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotesNoteReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.notes.update(note_id, { + value: 'We delivered this order' + }) + + .then(({ note }) => { + console.log(note.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/notes/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "value": "We delivered this order" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /notifications: + get: + operationId: GetNotifications + summary: List Notifications + description: Retrieves a list of Notifications. + x-authenticated: true + parameters: + - in: query + name: offset + description: >- + The number of notifications to skip before starting to collect the + notifications set + schema: + type: integer + default: 0 + - in: query + name: limit + description: The number of notifications to return + schema: + type: integer + default: 50 + - in: query + name: fields + description: Comma separated fields to include in the result set + schema: + type: string + - in: query + name: expand + description: Comma separated fields to populate + schema: + type: string + - in: query + name: event_name + description: The name of the event that the notification was sent for. + schema: + type: string + - in: query + name: resource_type + description: The type of resource that the Notification refers to. + schema: + type: string + - in: query + name: resource_id + description: The ID of the resource that the Notification refers to. + schema: + type: string + - in: query + name: to + description: >- + The address that the Notification was sent to. This will usually be + an email address, but represent other addresses such as a chat bot + user id + schema: + type: string + - in: query + name: include_resends + description: >- + A boolean indicating whether the result set should include resent + notifications or not + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetNotificationsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.notifications.list() + + .then(({ notifications }) => { + console.log(notifications.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/notifications' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notification + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotificationsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/notifications/{id}/resend': + post: + operationId: PostNotificationsNotificationResend + summary: Resend Notification + description: >- + Resends a previously sent notifications, with the same data but + optionally to a different address + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Notification + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' + x-codegen: + method: resend + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.notifications.resend(notification_id) + + .then(({ notification }) => { + console.log(notification.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/notifications/{id}/resend' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notification + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotificationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/items': + post: + operationId: PostOrderEditsEditLineItems + summary: Add a Line Item + description: Create an OrderEdit LineItem. + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsReq' + x-authenticated: true + x-codegen: + method: addLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.addLineItem(order_edit_id, { + variant_id, + quantity + }) + + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/items' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", + "quantity": 3 }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/cancel': + post: + operationId: PostOrderEditsOrderEditCancel + summary: Cancel an OrderEdit + description: Cancels an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + x-codegen: + method: cancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.cancel(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/confirm': + post: + operationId: PostOrderEditsOrderEditConfirm + summary: Confirms an OrderEdit + description: Confirms an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the order edit. + schema: + type: string + x-codegen: + method: confirm + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.confirm(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.create({ order_id }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "order_id": "my_order_id", "internal_note": + "my_optional_note" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetOrderEdits + summary: List OrderEdits + description: List OrderEdits. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching order edit internal note. + schema: + type: string + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: list + queryParams: GetOrderEditsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.list() + .then(({ order_edits, count, limit, offset }) => { + console.log(order_edits.length) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/order-edits' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: removeLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEditsEditLineItemsLineItem + summary: Upsert Line Item Change + description: Create or update the order edit change holding the line item changes + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to update. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq' + x-codegen: + method: updateLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, + { + quantity: 5 + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ "quantity": 5 }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/changes/{change_id}': + delete: + operationId: DeleteOrderEditsOrderEditItemChange + summary: Delete a Line Item Change + description: Deletes an Order Edit Item Change + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete. + schema: + type: string + - in: path + name: change_id + required: true + description: The ID of the Order Edit Item Change to delete. + schema: + type: string + x-codegen: + method: deleteItemChange + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.deleteItemChange(order_edit_id, + item_change_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditItemChangeDeleteRes' + '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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.delete(order_edit_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/order-edits/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditDeleteRes' + '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-codegen: + method: retrieve + queryParams: GetOrderEditsOrderEditParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.retrieve(orderEditId) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/order-edits/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEditsOrderEdit + summary: Update an OrderEdit + description: Updates a OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsOrderEditReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.update(order_edit_id, { + internal_note: "internal reason XY" + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "internal_note": "internal reason XY" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/request': + post: + operationId: PostOrderEditsOrderEditRequest + summary: Request Confirmation + description: Request customer confirmation of an Order Edit + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to request confirmation from. + schema: + type: string + x-codegen: + method: requestConfirmation + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.requestConfirmation(order_edit_id) + .then({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/order-edits/{id}/request' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/shipping-methods': + post: + operationId: PostOrdersOrderShippingMethods + summary: Add a Shipping Method + description: >- + Adds a Shipping Method to an Order. If another Shipping Method exists + with the same Shipping Profile, the previous Shipping Method will be + replaced. + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderShippingMethodsReq' + x-authenticated: true + x-codegen: + method: addShippingMethod + params: AdminPostOrdersOrderShippingMethodsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.addShippingMethod(order_id, { + price: 1000, + option_id + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "price": 1000, + "option_id": "{option_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/archive': + post: + operationId: PostOrdersOrderArchive + summary: Archive Order + description: Archives the order with the given id. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: archive + params: AdminPostOrdersOrderArchiveParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.archive(order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/archive' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/claims/{claim_id}/cancel': + post: + operationId: PostOrdersClaimCancel + summary: Cancel a Claim + description: Cancels a Claim + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelClaim + params: AdminPostOrdersClaimCancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.cancelClaim(order_id, claim_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Claim + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel': + post: + operationId: PostOrdersClaimFulfillmentsCancel + summary: Cancel Claim Fulfillment + description: Registers a claim's fulfillment as canceled. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Claim relates to. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelClaimFulfillment + params: AdminPostOrdersClaimFulfillmentsCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, + fulfillment_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel': + post: + operationId: PostOrdersSwapFulfillmentsCancel + summary: Cancel Swap's Fulfilmment + description: Registers a Swap's Fulfillment as canceled. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Swap relates to. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelSwapFulfillment + params: AdminPostOrdersSwapFulfillementsCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, + fulfillment_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/fulfillments/{fulfillment_id}/cancel': + post: + operationId: PostOrdersOrderFulfillmentsCancel + summary: Cancels a Fulfilmment + description: Registers a Fulfillment as canceled. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelFulfillment + params: AdminPostOrdersOrderFulfillementsCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.cancelFulfillment(order_id, fulfillment_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/cancel': + post: + operationId: PostOrdersOrderCancel + summary: Cancel an Order + description: >- + Registers an Order as canceled. This triggers a flow that will cancel + any created Fulfillments and Payments, may fail if the Payment or + Fulfillment Provider is unable to cancel the Payment/Fulfillment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancel + params: AdminPostOrdersOrderCancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.cancel(order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/cancel' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/swaps/{swap_id}/cancel': + post: + operationId: PostOrdersSwapCancel + summary: Cancels a Swap + description: Cancels a Swap + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelSwap + params: AdminPostOrdersSwapCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.cancelSwap(order_id, swap_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/capture': + post: + operationId: PostOrdersOrderCapture + summary: Capture Order's Payment + description: Captures all the Payments associated with an Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: capturePayment + params: AdminPostOrdersOrderCaptureParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.capturePayment(order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/capture' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/complete': + post: + operationId: PostOrdersOrderComplete + summary: Complete an Order + description: Completes an Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: complete + params: AdminPostOrdersOrderCompleteParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.complete(order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/complete' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/claims/{claim_id}/shipments': + post: + operationId: PostOrdersOrderClaimsClaimShipments + summary: Create Claim Shipment + description: Registers a Claim Fulfillment as shipped. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq' + x-codegen: + method: createClaimShipment + params: AdminPostOrdersOrderClaimsClaimShipmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.createClaimShipment(order_id, claim_id, { + fulfillment_id + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Claim + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order/{id}/claims': + post: + operationId: PostOrdersOrderClaims + summary: Create a Claim + description: Creates a Claim. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsReq' + x-codegen: + method: createClaim + params: AdminPostOrdersOrderClaimsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.createClaim(order_id, { + type: 'refund', + claim_items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/claims' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "type": "refund", + "claim_items": [ + { + "item_id": "asdsd", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Claim + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/fulfillment': + post: + operationId: PostOrdersOrderFulfillments + summary: Create a Fulfillment + description: >- + Creates a Fulfillment of an Order - will notify Fulfillment Providers to + prepare a shipment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderFulfillmentsReq' + x-codegen: + method: createFulfillment + params: AdminPostOrdersOrderFulfillmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.createFulfillment(order_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "items": [ + { + "item_id": "{item_id}", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/line-items/{line_item_id}/reserve': + post: + operationId: PostOrdersOrderLineItemReservations + summary: Create a Reservation for a line item + description: >- + Creates a Reservation for a line item at a specified location, + optionally for a partial quantity. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: line_item_id + required: true + description: The ID of the Line item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersOrderLineItemReservationReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.createReservation(order_id, line_item_id, { + location_id + }) + + .then(({ reservation }) => { + console.log(reservation.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "location_id": "loc_1" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/shipment': + post: + operationId: PostOrdersOrderShipment + summary: Create a Shipment + description: Registers a Fulfillment as shipped. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderShipmentReq' + x-codegen: + method: createShipment + params: AdminPostOrdersOrderShipmentParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.createShipment(order_id, { + fulfillment_id + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/shipment' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/swaps/{swap_id}/shipments': + post: + operationId: PostOrdersOrderSwapsSwapShipments + summary: Create Swap Shipment + description: Registers a Swap Fulfillment as shipped. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq' + x-codegen: + method: createSwapShipment + params: AdminPostOrdersOrderSwapsSwapShipmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.createSwapShipment(order_id, swap_id, { + fulfillment_id + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order/{id}/swaps': + post: + operationId: PostOrdersOrderSwaps + summary: Create a Swap + description: >- + Creates a Swap. Swaps are used to handle Return of previously purchased + goods and Fulfillment of replacements simultaneously. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded the order of the + result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included the order of the + result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsReq' + x-codegen: + method: createSwap + queryParams: AdminPostOrdersOrderSwapsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.createSwap(order_id, { + return_items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/swaps' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "return_items": [ + { + "item_id": "asfasf", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/claims/{claim_id}/fulfillments': + post: + operationId: PostOrdersOrderClaimsClaimFulfillments + summary: Create Claim Fulfillment + description: Creates a Fulfillment for a Claim. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq + x-codegen: + method: fulfillClaim + params: AdminPostOrdersOrderClaimsClaimFulfillmentsReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.fulfillClaim(order_id, claim_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/swaps/{swap_id}/fulfillments': + post: + operationId: PostOrdersOrderSwapsSwapFulfillments + summary: Create Swap Fulfillment + description: Creates a Fulfillment for a Swap. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq + x-codegen: + method: fulfillSwap + params: AdminPostOrdersOrderSwapsSwapFulfillmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.fulfillSwap(order_id, swap_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}': + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetOrdersOrderParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.retrieve(order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/orders/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrdersOrder + summary: Update an Order + description: Updates and order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderReq' + x-codegen: + method: update + params: AdminPostOrdersOrderParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.update(order_id, { + email: 'user@example.com' + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/adasda' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/reservations': + get: + operationId: GetOrdersOrderReservations + summary: Get reservations for an Order + description: Retrieves reservations for an Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: offset + description: How many reservations to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of reservations returned. + schema: + type: integer + default: 20 + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.retrieveReservations(order_id) + + .then(({ reservations }) => { + console.log(reservations[0].id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/orders/{id}/reservations' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGetReservationReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders: + get: + operationId: GetOrders + summary: List Orders + description: Retrieves a list of Orders + x-authenticated: true + parameters: + - in: query + name: q + description: >- + Query used for searching orders by shipping address first name, + orders' email, and orders' display ID + schema: + type: string + - in: query + name: id + description: ID of the order to search for. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for + schema: + type: array + items: + type: string + enum: + - pending + - completed + - archived + - canceled + - requires_action + - in: query + name: fulfillment_status + style: form + explode: false + description: Fulfillment status to search for. + schema: + type: array + items: + type: string + enum: + - not_fulfilled + - fulfilled + - partially_fulfilled + - shipped + - partially_shipped + - canceled + - returned + - partially_returned + - requires_action + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + enum: + - captured + - awaiting + - not_paid + - refunded + - partially_refunded + - canceled + - requires_action + - in: query + name: display_id + description: Display ID to search for. + schema: + type: string + - in: query + name: cart_id + description: to search for. + schema: + type: string + - in: query + name: customer_id + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + style: form + explode: false + description: Regions to search orders by + schema: + oneOf: + - type: string + description: ID of a Region. + - type: array + items: + type: string + description: ID of a Region. + - in: query + name: currency_code + style: form + explode: false + description: Currency code to search for + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + - in: query + name: tax_rate + description: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting orders were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting orders were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: canceled_at + description: Date comparison for when resulting orders were canceled. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: sales_channel_id + style: form + explode: false + description: Filter by Sales Channels + schema: + type: array + items: + type: string + description: The ID of a Sales Channel + - in: query + name: offset + description: How many orders to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of orders returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each order of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each order of + the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.list() + + .then(({ orders, limit, offset, count }) => { + console.log(orders.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET 'https://medusa-url.com/admin/orders' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/swaps/{swap_id}/process-payment': + post: + operationId: PostOrdersOrderSwapsSwapProcessPayment + summary: Process Swap Payment + description: >- + When there are differences between the returned and shipped Products in + a Swap, the difference must be processed. Either a Refund will be issued + or a Payment will be captured. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: processSwapPayment + params: AdminPostOrdersOrderSwapsSwapProcessPaymentParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.processSwapPayment(order_id, swap_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/refund': + post: + operationId: PostOrdersOrderRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderRefundsReq' + x-codegen: + method: refundPayment + params: AdminPostOrdersOrderRefundsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.refundPayment(order_id, { + amount: 1000, + reason: 'Do not like it' + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/adasda/refund' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "amount": 1000, + "reason": "Do not like it" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}/return': + post: + operationId: PostOrdersOrderReturns + summary: Request a Return + description: >- + Requests a Return. If applicable a return label will be created and + other plugins notified. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderReturnsReq' + x-codegen: + method: requestReturn + params: AdminPostOrdersOrderReturnsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.requestReturn(order_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/return' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "items": [ + { + "item_id": "{item_id}", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order/{id}/claims/{claim_id}': + post: + operationId: PostOrdersOrderClaimsClaim + summary: Update a Claim + description: Updates a Claim. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimReq' + x-codegen: + method: updateClaim + params: AdminPostOrdersOrderClaimsClaimParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orders.updateClaim(order_id, claim_id, { + no_notification: true + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "no_notification": true + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Claim + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.delete(payment_collection_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/payment-collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionDeleteRes' + '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-codegen: + method: retrieve + queryParams: GetPaymentCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@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: + $ref: '#/components/schemas/AdminPaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostPaymentCollectionsPaymentCollection + summary: Update PaymentCollection + description: Updates a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdatePaymentCollectionsReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.update(payment_collection_id, { + description: "Description of payCol" + }) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payment-collections/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "description": "Description of payCol" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/authorize': + post: + operationId: PostPaymentCollectionsPaymentCollectionAuthorize + summary: Mark Authorized + description: Sets the status of PaymentCollection as Authorized. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + x-codegen: + method: markAsAuthorized + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payments/{id}/capture': + post: + operationId: PostPaymentsPaymentCapture + summary: Capture a Payment + description: Captures a Payment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codegen: + method: capturePayment + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.payments.capturePayment(payment_id) + + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payments/{id}/capture' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payments/{id}': + get: + operationId: GetPaymentsPayment + summary: Get Payment details + description: Retrieves the Payment details + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codegen: + method: retrieve + queryParams: GetPaymentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.payments.retrieve(payment_id) + + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/payments/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payments/{id}/refund': + post: + operationId: PostPaymentsPaymentRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPaymentRefundsReq' + x-codegen: + method: refundPayment + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.payments.refundPayment(payment_id, { + amount: 1000, + reason: 'return', + note: 'Do not like it', + }) + + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/payments/pay_123/refund' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "amount": 1000, + "reason": "return", + "note": "Do not like it" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRefundRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}/prices/batch': + post: + operationId: PostPriceListsPriceListPricesBatch + summary: Update Prices + description: Batch update prices for a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List to update prices for. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPriceListPricesPricesReq' + x-codegen: + method: addPrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.addPrices(price_list_id, { + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] + }) + + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "prices": [ + { + "amount": 100, + "variant_id": "afasfa", + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeletePriceListsPriceListPricesBatch + summary: Delete Prices + description: Batch delete prices that belong to a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: >- + The ID of the Price List that the Money Amounts (Prices) that will + be deleted belongs to. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeletePriceListPricesPricesReq' + x-codegen: + method: deletePrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.deletePrices(price_list_id, { + price_ids: [ + price_id + ] + }) + + .then(({ ids, object, deleted }) => { + console.log(ids.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "price_ids": [ + "adasfa" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteBatchRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /price-lists: + post: + operationId: PostPriceListsPriceList + summary: Create a Price List + description: Creates a Price List + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPriceListsPriceListReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + import { PriceListType } from "@medusajs/medusa" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.create({ + name: 'New Price List', + description: 'A new price list', + type: PriceListType.SALE, + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] + }) + + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/price-lists' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "New Price List", + "description": "A new price list", + "type": "sale", + "prices": [ + { + "amount": 1000, + "variant_id": "afafa", + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetPriceLists + summary: List Price Lists + description: Retrieves a list of Price Lists. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of items to get + schema: + type: number + default: '10' + - in: query + name: offset + description: The offset at which to get items + schema: + type: number + default: '0' + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each item of + the result. + schema: + type: string + - in: query + name: order + description: field to order results by. + schema: + type: string + - in: query + name: id + description: ID to search for. + schema: + type: string + - in: query + name: q + description: >- + query to search in price list description, price list name, and + customer group name fields. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for. + schema: + type: array + items: + type: string + enum: + - active + - draft + - in: query + name: name + description: price list name to search for. + schema: + type: string + - in: query + name: customer_groups + style: form + explode: false + description: Customer Group IDs to search for. + schema: + type: array + items: + type: string + - in: query + name: type + style: form + explode: false + description: Type to search for. + schema: + type: array + items: + type: string + enum: + - sale + - override + - in: query + name: created_at + description: Date comparison for when resulting price lists were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting price lists were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting price lists were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetPriceListPaginationParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.list() + + .then(({ price_lists, limit, offset, count }) => { + console.log(price_lists.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/price-lists' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}': + delete: + operationId: DeletePriceListsPriceList + summary: Delete a Price List + description: Deletes a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.delete(price_list_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetPriceListsPriceList + summary: Get a Price List + description: Retrieves a Price List. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.retrieve(price_list_id) + + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/price-lists/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostPriceListsPriceListPriceList + summary: Update a Price List + description: Updates a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPriceListsPriceListPriceListReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.update(price_list_id, { + name: 'New Price List' + }) + + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/price-lists/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "New Price List" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}/products/{product_id}/prices': + delete: + operationId: DeletePriceListsPriceListProductsProductPrices + summary: Delete Product's Prices + description: Delete all the prices related to a specific product in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: >- + The ID of the Price List that the Money Amounts that will be deleted + belongs to. + schema: + type: string + - in: path + name: product_id + required: true + description: The ID of the product from which the money amount will be deleted. + schema: + type: string + x-codegen: + method: deleteProductPrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.deleteProductPrices(price_list_id, + product_id) + + .then(({ ids, object, deleted }) => { + console.log(ids.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteProductPricesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}/variants/{variant_id}/prices': + delete: + operationId: DeletePriceListsPriceListVariantsVariantPrices + summary: Delete Variant's Prices + description: Delete all the prices related to a specific variant in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: >- + The ID of the Price List that the Money Amounts that will be deleted + belongs to. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the variant from which the money amount will be deleted. + schema: + type: string + x-codegen: + method: deleteVariantPrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.deleteVariantPrices(price_list_id, + variant_id) + + .then(({ ids, object, deleted }) => { + console.log(ids); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteVariantPricesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/price-lists/{id}/products': + get: + operationId: GetPriceListsPriceListProducts + summary: List Products + description: Retrieves a list of Product that are part of a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: ID of the price list. + schema: + type: string + - in: query + name: q + description: >- + Query used for searching product title and description, variant + title and sku, and collection title. + schema: + type: string + - in: query + name: id + description: ID of the product to search for. + schema: + type: string + - in: query + name: status + description: Product status to search for + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected + - in: query + name: collection_id + description: Collection IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: tags + description: Tag IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: title + description: product title to search for. + schema: + type: string + - in: query + name: description + description: product description to search for. + schema: + type: string + - in: query + name: handle + description: product handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: string + - in: query + name: type + description: to search for. + schema: + type: string + - in: query + name: order + description: field to sort results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting products were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting products were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting products were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. + schema: + type: string + x-codegen: + method: listProducts + queryParams: AdminGetPriceListsPriceListProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.priceLists.listProducts(price_list_id) + + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/price-lists/{id}/products' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListsProductsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/product-categories/{id}/products/batch': + post: + operationId: PostProductCategoriesCategoryProductsBatch + summary: Add Products to a category + description: Assign a batch of products to a product category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Category fields to be expanded in the response. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Category fields to be retrieved in the response. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostProductCategoriesCategoryProductsBatchReq + x-codegen: + method: addProducts + queryParams: AdminPostProductCategoriesCategoryProductsBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productCategories.addProducts(product_category_id, { + product_ids: [ + { + id: product_id + } + ] + }) + + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: > + curl --location \ + + --request POST + 'https://medusa-url.com/admin/product-categories/{product_category_id}/products/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductCategoriesCategoryProductsBatch + summary: Delete Products + description: Remove a list of products from a product category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Category fields to be expanded in the response. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Category fields to be retrieved in the response. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminDeleteProductCategoriesCategoryProductsBatchReq + x-codegen: + method: removeProducts + queryParams: AdminDeleteProductCategoriesCategoryProductsBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productCategories.removeProducts(product_category_id, { + product_ids: [ + { + id: product_id + } + ] + }) + + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/product-categories/{id}/products/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-categories: + post: + operationId: PostProductCategories + summary: Create a Product Category + description: Creates a Product Category. + x-authenticated: true + parameters: + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductCategoriesReq' + x-codegen: + method: create + queryParams: AdminPostProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productCategories.create({ + name: "Skinny Jeans", + }) + + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/product-categories' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Skinny Jeans", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductCategories + summary: List Product Categories + description: Retrieve a list of product categories. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching product category names orhandles. + schema: + type: string + - in: query + name: is_internal + description: Search for only internal categories. + schema: + type: boolean + - in: query + name: is_active + description: Search for only active categories + schema: + type: boolean + - in: query + name: parent_category_id + description: Returns categories scoped by parent + schema: + type: string + - in: query + name: offset + description: How many product categories to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of product categories returned. + schema: + type: integer + default: 100 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in the product + category. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in the product + category. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productCategories.list() + + .then(({ product_categories, limit, offset, count }) => { + console.log(product_categories.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/product-categories' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/product-categories/{id}': + delete: + operationId: DeleteProductCategoriesCategory + summary: Delete a Product Category + description: Deletes a ProductCategory. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productCategories.delete(product_category_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/product-categories/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductCategoriesCategory + summary: Get a Product Category + description: Retrieves a Product Category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetProductCategoryParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productCategories.retrieve(product_category_id) + + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/product-categories/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductCategoriesCategory + summary: Update a Product Category + description: Updates a Product Category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product + category. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be retrieved in each product + category. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductCategoriesCategoryReq' + x-codegen: + method: update + queryParams: AdminPostProductCategoriesCategoryParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productCategories.update(product_category_id, { + name: "Skinny Jeans" + }) + + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/product-categories/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Skinny Jeans" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-tags: + get: + operationId: GetProductTags + summary: List Product Tags + description: Retrieve a list of Product Tags. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of tags to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the tags. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The tag values to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: id + style: form + explode: false + description: The tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product tags were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product tags were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetProductTagsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productTags.list() + + .then(({ product_tags }) => { + console.log(product_tags.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/product-tags' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Tag + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductTagsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product types were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.productTypes.list() + + .then(({ product_types }) => { + console.log(product_types.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/product-types' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Type + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductTypesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}/options': + post: + operationId: PostProductsProductOptions + summary: Add an Option + x-authenticated: true + description: Adds a Product Option to a Product + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductOptionsReq' + x-codegen: + method: addOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.addOption(product_id, { + title: 'Size' + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/options' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products: + post: + operationId: PostProducts + summary: Create a Product + x-authenticated: true + description: Creates a Product + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.create({ + title: 'Shirt', + is_giftcard: false, + discountable: true + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Shirt" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Product + x-authenticated: true + parameters: + - in: query + name: q + description: >- + Query used for searching product title and description, variant + title and sku, and collection title. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by product IDs. + schema: + oneOf: + - type: string + description: ID of the product to search for. + - type: array + items: + type: string + description: ID of a product. + - in: query + name: status + style: form + explode: false + description: Status to search for + schema: + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected + - in: query + name: collection_id + style: form + explode: false + description: Collection ids to search for. + schema: + type: array + items: + type: string + - in: query + name: tags + style: form + explode: false + description: Tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: price_list_id + style: form + explode: false + description: Price List IDs to search for + schema: + type: array + items: + type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: Sales Channel IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: category_id + style: form + explode: false + description: Category IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id + schema: + type: boolean + - in: query + name: title + description: title to search for. + schema: + type: string + - in: query + name: description + description: description to search for. + schema: + type: string + - in: query + name: handle + description: handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: boolean + - in: query + name: created_at + description: Date comparison for when resulting products were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting products were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting products were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. + schema: + type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.list() + + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/products' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}/variants': + post: + operationId: PostProductsProductVariants + summary: Create a Product Variant + description: >- + Creates a Product Variant. Each Product Variant must have a unique + combination of Product Option Values. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductVariantsReq' + x-codegen: + method: createVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.createVariant(product_id, { + title: 'Color', + prices: [ + { + amount: 1000, + currency_code: "eur" + } + ], + options: [ + { + option_id, + value: 'S' + } + ], + inventory_quantity: 100 + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/variants' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Color", + "prices": [ + { + "amount": 1000, + "currency_code": "eur" + } + ], + "options": [ + { + "option_id": "asdasf", + "value": "S" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductsProductVariants + summary: List a Product's Variants + description: Retrieves a list of the Product Variants associated with a Product. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: ID of the product to search for the variants. + schema: + type: string + - in: query + name: fields + description: Comma separated string of the column to select. + schema: + type: string + - in: query + name: expand + description: Comma separated string of the relations to include. + schema: + type: string + - in: query + name: offset + description: How many items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: integer + default: 100 + x-codegen: + method: listVariants + queryParams: AdminGetProductsVariantsParams + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/products/{id}/variants' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListVariantsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}/options/{option_id}': + delete: + operationId: DeleteProductsProductOptionsOption + summary: Delete a Product Option + description: >- + Deletes a Product Option. Before a Product Option can be deleted all + Option Values for the Product Option must be the same. You may, for + example, have to delete some of your variants prior to deleting the + Product Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string + x-codegen: + method: deleteOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.deleteOption(product_id, option_id) + + .then(({ option_id, object, delete, product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsDeleteOptionRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductsProductOptionsOption + summary: Update a Product Option + description: Updates a Product Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductOptionsOption' + x-codegen: + method: updateOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.updateOption(product_id, option_id, { + title: 'Size' + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}': + delete: + operationId: DeleteProductsProduct + summary: Delete a Product + description: Deletes a Product and it's associated Product Variants. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.delete(product_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/products/asfsaf' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductsProduct + summary: Get a Product + description: Retrieves a Product. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.retrieve(product_id) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/products/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductsProduct + summary: Update a Product + description: Updates a Product + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.update(product_id, { + title: 'Shirt', + images: [] + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}/variants/{variant_id}': + delete: + operationId: DeleteProductsProductVariantsVariant + summary: Delete a Product Variant + description: Deletes a Product Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. + schema: + type: string + x-codegen: + method: deleteVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.deleteVariant(product_id, variant_id) + + .then(({ variant_id, object, deleted, product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsDeleteVariantRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductsProductVariantsVariant + summary: Update a Product Variant + description: Update a Product Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductVariantsVariantReq' + x-codegen: + method: updateVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.updateVariant(product_id, variant_id, { + title: 'Color', + prices: [ + { + amount: 1000, + currency_code: "eur" + } + ], + options: [ + { + option_id, + value: 'S' + } + ], + inventory_quantity: 100 + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Color", + "prices": [ + { + "amount": 1000, + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/tag-usage: + get: + operationId: GetProductsTagUsage + summary: List Tags Usage Number + description: Retrieves a list of Product Tags with how many times each is used. + x-authenticated: true + x-codegen: + method: listTags + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.listTags() + + .then(({ tags }) => { + console.log(tags.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/products/tag-usage' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Tag + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListTagsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/types: + get: + deprecated: true + operationId: GetProductsTypes + summary: List Product Types + description: Retrieves a list of Product Types. + x-authenticated: true + x-codegen: + method: listTypes + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.listTypes() + + .then(({ types }) => { + console.log(types.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/products/types' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListTypesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}/metadata': + post: + operationId: PostProductsProductMetadata + summary: Set Product Metadata + description: Set metadata key/value pair for Product + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductMetadataReq' + x-codegen: + method: setMetadata + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.products.setMetadata(product_id, { + + key: 'test', + value: 'true' + }) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/products/{id}/metadata' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "key": "test", + "value": "true" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/publishable-api-keys/{id}/sales-channels/batch': + post: + operationId: PostPublishableApiKeySalesChannelsChannelsBatch + summary: Add SalesChannels + description: Assign a batch of sales channels to a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq + x-codegen: + method: addSalesChannelsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.addSalesChannelsBatch(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys/{pak_id}/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeletePublishableApiKeySalesChannelsChannelsBatch + summary: Delete SalesChannels + description: Remove a batch of sales channels from a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq + x-codegen: + method: deleteSalesChannelsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.deleteSalesChannelsBatch(publishableApiKeyId, + { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /publishable-api-keys: + post: + operationId: PostPublishableApiKeys + summary: Create PublishableApiKey + description: Creates a PublishableApiKey. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPublishableApiKeysReq' + x-authenticated: true + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.create({ + title + }) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "Web API Key" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetPublishableApiKeys + summary: List PublishableApiKeys + description: List PublishableApiKeys. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching publishable api keys by title. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: list + queryParams: GetPublishableApiKeysParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys, count, limit, offset }) => { + console.log(publishable_api_keys) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/publishable-api-keys/{id}': + delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete PublishableApiKey + description: Deletes a PublishableApiKeys + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKeys to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.delete(publishableApiKeyId) + + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeyDeleteRes' + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a PublishableApiKey + description: Retrieve the Publishable Api Key. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.retrieve(publishableApiKeyId) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/publishable-api-keys/{id}/sales-channels': + get: + operationId: GetPublishableApiKeySalesChannels + summary: List SalesChannels + description: List PublishableApiKey's SalesChannels + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + - in: query + name: q + description: Query used for searching sales channels' names and descriptions. + schema: + type: string + x-codegen: + method: listSalesChannels + queryParams: GetPublishableApiKeySalesChannelsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels }) => { + console.log(sales_channels.length) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/sales-channels' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPublishableApiKeysListSalesChannelsRes + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/publishable-api-keys/{id}/revoke': + post: + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke PublishableApiKey + description: Revokes a PublishableApiKey. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codegen: + method: revoke + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.revoke(publishableApiKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/revoke' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/publishable-api-key/{id}': + post: + operationId: PostPublishableApiKysPublishableApiKey + summary: Update PublishableApiKey + description: Updates a PublishableApiKey. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.publishableApiKeys.update(publishableApiKeyId, { + title: "new title" + }) + + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "title": "new title" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}/countries': + post: + operationId: PostRegionsRegionCountries + summary: Add Country + description: Adds a Country to the list of Countries in a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionCountriesReq' + x-codegen: + method: addCountry + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.addCountry(region_id, { + country_code: 'dk' + }) + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/regions/{region_id}/countries' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "country_code": "dk" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}/fulfillment-providers': + post: + operationId: PostRegionsRegionFulfillmentProviders + summary: Add Fulfillment Provider + description: Adds a Fulfillment Provider to a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq + x-codegen: + method: addFulfillmentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.addFulfillmentProvider(region_id, { + provider_id: 'manual' + }) + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "provider_id": "manual" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}/payment-providers': + post: + operationId: PostRegionsRegionPaymentProviders + summary: Add Payment Provider + description: Adds a Payment Provider to a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq' + x-codegen: + method: addPaymentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.addPaymentProvider(region_id, { + provider_id: 'manual' + }) + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/regions/{id}/payment-providers' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "provider_id": "manual" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions: + post: + operationId: PostRegions + summary: Create a Region + description: Creates a Region + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.create({ + name: 'Europe', + currency_code: 'eur', + tax_rate: 0, + payment_providers: [ + 'manual' + ], + fulfillment_providers: [ + 'manual' + ], + countries: [ + 'DK' + ] + }) + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/regions' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Europe", + "currency_code": "eur", + "tax_rate": 0, + "payment_providers": [ + "manual" + ], + "fulfillment_providers": [ + "manual" + ], + "countries": [ + "DK" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + x-authenticated: true + parameters: + - in: query + name: limit + schema: + type: integer + default: 50 + required: false + description: limit the number of regions in response + - in: query + name: offset + schema: + type: integer + default: 0 + required: false + description: Offset of regions in response (used for pagination) + - in: query + name: created_at + schema: + type: object + required: false + description: >- + Date comparison for when resulting region was created, i.e. less + than, greater than etc. + - in: query + name: updated_at + schema: + type: object + required: false + description: >- + Date comparison for when resulting region was updated, i.e. less + than, greater than etc. + - in: query + name: deleted_at + schema: + type: object + required: false + description: >- + Date comparison for when resulting region was deleted, i.e. less + than, greater than etc. + x-codegen: + method: list + queryParams: AdminGetRegionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.list() + + .then(({ regions, limit, offset, count }) => { + console.log(regions.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET 'https://medusa-url.com/admin/regions' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}': + delete: + operationId: DeleteRegionsRegion + summary: Delete a Region + description: Deletes a Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.delete(region_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/regions/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetRegionsRegion + summary: Get a Region + description: Retrieves a Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.retrieve(region_id) + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/regions/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostRegionsRegion + summary: Update a Region + description: Updates a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.update(region_id, { + name: 'Europe' + }) + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/regions/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Europe" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}/fulfillment-options': + get: + operationId: GetRegionsRegionFulfillmentOptions + summary: List Fulfillment Options + description: Gathers all the fulfillment options available to in the Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: retrieveFulfillmentOptions + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.retrieveFulfillmentOptions(region_id) + + .then(({ fulfillment_options }) => { + console.log(fulfillment_options.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}/countries/{country_code}': + delete: + operationId: PostRegionsRegionCountriesCountry + summary: Delete Country + x-authenticated: true + description: Removes a Country from the list of Countries in a Region + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: country_code + description: The 2 character ISO code for the Country. + required: true + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + x-codegen: + method: deleteCountry + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.deleteCountry(region_id, 'dk') + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/regions/{id}/countries/dk' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}/fulfillment-providers/{provider_id}': + delete: + operationId: PostRegionsRegionFulfillmentProvidersProvider + summary: Del. Fulfillment Provider + description: Removes a Fulfillment Provider. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: provider_id + required: true + description: The ID of the Fulfillment Provider. + schema: + type: string + x-codegen: + method: deleteFulfillmentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.deleteFulfillmentProvider(region_id, 'manual') + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/manual' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}/payment-providers/{provider_id}': + delete: + operationId: PostRegionsRegionPaymentProvidersProvider + summary: Delete Payment Provider + description: Removes a Payment Provider. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: provider_id + required: true + description: The ID of the Payment Provider. + schema: + type: string + x-codegen: + method: deletePaymentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.regions.deletePaymentProvider(region_id, 'manual') + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /reservations: + post: + operationId: PostReservations + summary: Creates a Reservation + description: >- + Creates a Reservation which can be associated with any resource as + required. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.reservations.create({ + + }) + + .then(({ reservations }) => { + console.log(reservations.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/reservations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resource_id": "{resource_id}", + "resource_type": "order", + "value": "We delivered this order" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservation + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetReservations + summary: List Reservations + description: Retrieve a list of Reservations. + x-authenticated: true + parameters: + - in: query + name: location_id + style: form + explode: false + description: Location ids to search for. + schema: + type: array + items: + type: string + - in: query + name: inventory_item_id + style: form + explode: false + description: Inventory Item ids to search for. + schema: + type: array + items: + type: string + - in: query + name: line_item_id + style: form + explode: false + description: Line Item ids to search for. + schema: + type: array + items: + type: string + - in: query + name: quantity + description: Filter by reservation quantity + schema: + type: object + properties: + lt: + type: number + description: filter by reservation quantity less than this number + gt: + type: number + description: filter by reservation quantity greater than this number + lte: + type: number + description: >- + filter by reservation quantity less than or equal to this + number + gte: + type: number + description: >- + filter by reservation quantity greater than or equal to this + number + - in: query + name: offset + description: How many Reservations to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of Reservations returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in the product + category. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in the product + category. + schema: + type: string + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/product-categories' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGetReservationReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/reservations/{id}': + delete: + operationId: DeleteReservationsReservation + summary: Delete a Reservation + description: Deletes a Reservation. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Reservation to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.reservations.delete(reservation.id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/reservations/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservation + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Reservation. + object: + type: string + description: The type of the object that was deleted. + default: reservation + deleted: + type: boolean + description: Whether or not the Reservation was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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: GetReservationsReservation + summary: Get a Reservation + description: Retrieves a single reservation using its id + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the reservation to retrieve. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.reservations.retrieve(reservation_id) + + .then(({ reservation }) => { + console.log(reservation.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/reservations/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservation + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostReservationsReservation + summary: Updates a Reservation + description: >- + Updates a Reservation which can be associated with any resource as + required. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Reservation to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReservationReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.reservations.update(reservation.id, { + quantity: 3 + }) + + .then(({ reservations }) => { + console.log(reservations.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/reservations/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 3, + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservation + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /return-reasons: + post: + operationId: PostReturnReasons + summary: Create a Return Reason + description: Creates a Return Reason + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnReasonsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returnReasons.create({ + label: 'Damaged', + value: 'damaged' + }) + + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/return-reasons' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "label": "Damaged", + "value": "damaged" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returnReasons.list() + + .then(({ return_reasons }) => { + console.log(return_reasons.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/return-reasons' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/return-reasons/{id}': + delete: + operationId: DeleteReturnReason + summary: Delete a Return Reason + description: Deletes a return reason. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the return reason + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returnReasons.delete(return_reason_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/return-reasons/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Return Reason. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returnReasons.retrieve(return_reason_id) + + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/return-reasons/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostReturnReasonsReason + summary: Update a Return Reason + description: Updates a Return Reason + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Return Reason. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnReasonsReasonReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returnReasons.update(return_reason_id, { + label: 'Damaged' + }) + + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/return-reasons/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "label": "Damaged" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/returns/{id}/cancel': + post: + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string + x-codegen: + method: cancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returns.cancel(return_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/returns/{id}/cancel' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnsCancelRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /returns: + get: + operationId: GetReturns + summary: List Returns + description: Retrieves a list of Returns + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' + x-codegen: + method: list + queryParams: AdminGetReturnsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returns.list() + + .then(({ returns, limit, offset, count }) => { + console.log(returns.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET 'https://medusa-url.com/admin/returns' + \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/returns/{id}/receive': + post: + operationId: PostReturnsReturnReceive + summary: Receive a Return + description: >- + Registers a Return as received. Updates statuses on Orders and Swaps + accordingly. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnsReturnReceiveReq' + x-codegen: + method: receive + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.returns.receive(return_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then((data) => { + console.log(data.return.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/returns/{id}/receive' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "items": [ + { + "item_id": "asafg", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/sales-channels/{id}/products/batch': + post: + operationId: PostSalesChannelsChannelProductsBatch + summary: Add Products + description: Assign a batch of product to a sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq + x-codegen: + method: addProducts + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.addProducts(sales_channel_id, { + product_ids: [ + { + id: product_id + } + ] + }) + + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/sales-channels/afasf/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteSalesChannelsChannelProductsBatch + summary: Delete Products + description: Remove a list of products from a sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq + x-codegen: + method: removeProducts + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.removeProducts(sales_channel_id, { + product_ids: [ + { + id: product_id + } + ] + }) + + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/sales-channels/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/sales-channels/{id}/stock-locations': + post: + operationId: PostSalesChannelsSalesChannelStockLocation + summary: Associate a stock location to a Sales Channel + description: Associates a stock location to a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostSalesChannelsChannelStockLocationsReq + x-codegen: + method: addLocation + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.addLocation(sales_channel_id, { + location_id: 'App' + }) + + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "locaton_id": "stock_location_id" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteSalesChannelsSalesChannelStockLocation + summary: Remove a stock location from a Sales Channel + description: Removes a stock location from a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminDeleteSalesChannelsChannelStockLocationsReq + x-codegen: + method: removeLocation + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.removeLocation(sales_channel_id, { + location_id: 'App' + }) + + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "locaton_id": "stock_location_id" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsDeleteLocationRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /sales-channels: + post: + operationId: PostSalesChannels + summary: Create a Sales Channel + description: Creates a Sales Channel. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.create({ + name: 'App', + description: 'Mobile app' + }) + + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/sales-channels' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetSalesChannels + summary: List Sales Channels + description: Retrieves a list of sales channels + x-authenticated: true + parameters: + - in: query + name: id + description: ID of the sales channel + schema: + type: string + - in: query + name: name + description: Name of the sales channel + schema: + type: string + - in: query + name: description + description: Description of the sales channel + schema: + type: string + - in: query + name: q + description: Query used for searching sales channels' names and descriptions. + schema: + type: string + - in: query + name: order + description: The field to order the results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many sales channels to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of sales channels returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each sales + channel of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each sales + channel of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetSalesChannelsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.list() + + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/sales-channels' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/sales-channels/{id}': + delete: + operationId: DeleteSalesChannelsSalesChannel + summary: Delete a Sales Channel + description: Deletes the sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.delete(sales_channel_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/sales-channels/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetSalesChannelsSalesChannel + summary: Get a Sales Channel + description: Retrieves the sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.retrieve(sales_channel_id) + + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/sales-channels/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostSalesChannelsSalesChannel + summary: Update a Sales Channel + description: Updates a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsSalesChannelReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.salesChannels.update(sales_channel_id, { + name: 'App' + }) + + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/sales-channels/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingOptions.create({ + name: 'PostFake', + region_id: "saasf", + provider_id: "manual", + data: { + }, + price_type: 'flat_rate' + }) + + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-options' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "PostFake", + "region_id": "afasf", + "provider_id": "manual", + "data": {}, + "price_type": "flat_rate" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingOptions + summary: List Shipping Options + description: Retrieves a list of Shipping Options. + x-authenticated: true + parameters: + - in: query + name: region_id + schema: + type: string + description: Region ID to fetch options from + - in: query + name: is_return + schema: + type: boolean + description: Flag for fetching return options only + - in: query + name: admin_only + schema: + type: boolean + description: Flag for fetching admin specific options + x-codegen: + method: list + queryParams: AdminGetShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingOptions.list() + + .then(({ shipping_options, count }) => { + console.log(shipping_options.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-options' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingOptions.delete(option_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/shipping-options/{option_id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingOptionsOption + summary: Get a Shipping Option + description: Retrieves a Shipping Option. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingOptions.retrieve(option_id) + + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-options/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostShippingOptionsOption + summary: Update Shipping Option + description: Updates a Shipping Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingOptionsOptionReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingOptions.update(option_id, { + name: 'PostFake', + requirements: [ + { + id, + type: 'max_subtotal', + amount: 1000 + } + ] + }) + + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-options/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "requirements": [ + { + "type": "max_subtotal", + "amount": 1000 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.create({ + name: 'Large Products' + }) + + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-profiles' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingProfiles + summary: List Shipping Profiles + description: Retrieves a list of Shipping Profile. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.list() + + .then(({ shipping_profiles }) => { + console.log(shipping_profiles.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.delete(profile_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteShippingProfileRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingProfilesProfile + summary: Get a Shipping Profile + description: Retrieves a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.retrieve(profile_id) + + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostShippingProfilesProfile + summary: Update a Shipping Profile + description: Updates a Shipping Profile + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingProfilesProfileReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.shippingProfiles.update(shipping_profile_id, { + name: 'Large Products' + }) + + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/shipping-profiles/{id} \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /stock-locations: + post: + operationId: PostStockLocations + summary: Create a Stock Location + description: Creates a Stock Location. + x-authenticated: true + parameters: + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStockLocationsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.stockLocations.create({ + name: 'Main Warehouse', + location_id: 'sloc' + }) + + .then(({ stock_location }) => { + console.log(stock_location.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/stock-locations' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Location + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetStockLocations + summary: List Stock Locations + description: Retrieves a list of stock locations + x-authenticated: true + parameters: + - in: query + name: id + description: ID of the stock location + schema: + type: string + - in: query + name: name + description: Name of the stock location + schema: + type: string + - in: query + name: order + description: The field to order the results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many stock locations to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of stock locations returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each stock + location of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each stock + location of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetStockLocationsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.stockLocations.list() + + .then(({ stock_locations, limit, offset, count }) => { + console.log(stock_locations.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/stock-locations' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/stock-locations/{id}': + delete: + operationId: DeleteStockLocationsStockLocation + summary: Delete a Stock Location + description: Delete a Stock Location + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.stockLocations.delete(stock_location_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/stock-locations/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - StockLocation + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + format: stock_location + deleted: + type: boolean + description: Whether or not the Stock Location was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetStockLocationsStockLocation + summary: Get a Stock Location + description: Retrieves the Stock Location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetStockLocationsLocationParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.stockLocations.retrieve(stock_location_id) + + .then(({ stock_location }) => { + console.log(stock_location.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/stock-locations/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Location + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsRes' + post: + operationId: PostStockLocationsStockLocation + summary: Update a Stock Location + description: Updates a Stock Location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStockLocationsLocationReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.stockLocations.update(stock_location_id, { + name: 'App' + }) + + .then(({ stock_location }) => { + console.log(stock_location.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/stock-locations/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Location + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/store/currencies/{code}': + post: + operationId: PostStoreCurrenciesCode + summary: Add a Currency Code + description: Adds a Currency Code to the available currencies. + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The 3 character ISO currency code. + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + x-codegen: + method: addCurrency + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.addCurrency('eur') + + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/store/currencies/eur' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteStoreCurrenciesCode + summary: Delete a Currency Code + description: Removes a Currency Code from the available currencies. + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The 3 character ISO currency code. + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + x-codegen: + method: deleteCurrency + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.deleteCurrency('eur') + + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/store/currencies/eur' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store: + get: + operationId: GetStore + summary: Get Store details + description: Retrieves the Store details + x-authenticated: true + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.retrieve() + + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/store' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostStore + summary: Update Store Details + description: Updates the Store details + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStoreReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.update({ + name: 'Medusa Store' + }) + + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST 'https://medusa-url.com/admin/store' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "Medusa Store" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-providers: + get: + operationId: GetStorePaymentProviders + summary: List Payment Providers + description: Retrieves the configured Payment Providers + x-authenticated: true + x-codegen: + method: listPaymentProviders + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.listPaymentProviders() + + .then(({ payment_providers }) => { + console.log(payment_providers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/store/payment-providers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentProvidersList' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/tax-providers: + get: + operationId: GetStoreTaxProviders + summary: List Tax Providers + description: Retrieves the configured Tax Providers + x-authenticated: true + x-codegen: + method: listTaxProviders + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.store.listTaxProviders() + + .then(({ tax_providers }) => { + console.log(tax_providers.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/store/tax-providers' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxProvidersList' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/swaps/{id}': + get: + operationId: GetSwapsSwap + summary: Get a Swap + description: Retrieves a Swap. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Swap. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.swaps.retrieve(swap_id) + + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/swaps/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSwapsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /swaps: + get: + operationId: GetSwaps + summary: List Swaps + description: Retrieves a list of Swaps. + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' + x-authenticated: true + x-codegen: + method: list + queryParams: AdminGetSwapsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.swaps.list() + + .then(({ swaps }) => { + console.log(swaps.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/swaps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSwapsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/tax-rates/{id}/product-types/batch': + post: + operationId: PostTaxRatesTaxRateProductTypes + summary: Add to Product Types + description: Associates a Tax Rate with a list of Product Types + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq' + x-codegen: + method: addProductTypes + queryParams: AdminPostTaxRatesTaxRateProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.addProductTypes(tax_rate_id, { + product_types: [ + product_type_id + ] + }) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_types": [ + "{product_type_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRateProductTypes + summary: Delete from Product Types + description: Removes a Tax Rate from a list of Product Types + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq' + x-codegen: + method: removeProductTypes + queryParams: AdminDeleteTaxRatesTaxRateProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.removeProductTypes(tax_rate_id, { + product_types: [ + product_type_id + ] + }) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "product_types": [ + "{product_type_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/tax-rates/{id}/products/batch': + post: + operationId: PostTaxRatesTaxRateProducts + summary: Add to Products + description: Associates a Tax Rate with a list of Products + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductsReq' + x-codegen: + method: addProducts + queryParams: AdminPostTaxRatesTaxRateProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.addProducts(tax_rate_id, { + products: [ + product_id + ] + }) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "products": [ + "{product_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRateProducts + summary: Delete from Products + description: Removes a Tax Rate from a list of Products + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq' + x-codegen: + method: removeProducts + queryParams: AdminDeleteTaxRatesTaxRateProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.removeProducts(tax_rate_id, { + products: [ + product_id + ] + }) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "products": [ + "{product_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/tax-rates/{id}/shipping-options/batch': + post: + operationId: PostTaxRatesTaxRateShippingOptions + summary: Add to Shipping Options + description: Associates a Tax Rate with a list of Shipping Options + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq' + x-codegen: + method: addShippingOptions + queryParams: AdminPostTaxRatesTaxRateShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.addShippingOptions(tax_rate_id, { + shipping_options: [ + shipping_option_id + ] + }) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "shipping_options": [ + "{shipping_option_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRateShippingOptions + summary: Del. for Shipping Options + description: Removes a Tax Rate from a list of Shipping Options + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq + x-codegen: + method: removeShippingOptions + queryParams: AdminDeleteTaxRatesTaxRateShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.removeShippingOptions(tax_rate_id, { + shipping_options: [ + shipping_option_id + ] + }) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "shipping_options": [ + "{shipping_option_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /tax-rates: + post: + operationId: PostTaxRates + summary: Create a Tax Rate + description: Creates a Tax Rate + parameters: + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesReq' + x-codegen: + method: create + queryParams: AdminPostTaxRatesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.create({ + code: 'TEST', + name: 'New Tax Rate', + region_id + }) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/tax-rates' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "code": "TEST", + "name": "New Tax Rate", + "region_id": "{region_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetTaxRates + summary: List Tax Rates + description: Retrieves a list of TaxRates + x-authenticated: true + parameters: + - in: query + name: name + description: Name of tax rate to retrieve + schema: + type: string + - in: query + name: region_id + style: form + explode: false + description: Filter by Region ID + schema: + oneOf: + - type: string + - type: array + items: + type: string + - in: query + name: code + description: code to search for. + schema: + type: string + - in: query + name: rate + style: form + explode: false + description: Filter by Rate + schema: + oneOf: + - type: number + - type: object + properties: + lt: + type: number + description: filter by rates less than this number + gt: + type: number + description: filter by rates greater than this number + lte: + type: number + description: filter by rates less than or equal to this number + gte: + type: number + description: filter by rates greater than or equal to this number + - in: query + name: offset + description: How many tax rates to skip before retrieving the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of tax rates returned. + schema: + type: integer + default: 50 + - in: query + name: fields + description: Which fields should be included in each item. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved for each item. + style: form + explode: false + schema: + type: array + items: + type: string + x-codegen: + method: list + queryParams: AdminGetTaxRatesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.list() + + .then(({ tax_rates, limit, offset, count }) => { + console.log(tax_rates.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/tax-rates' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/tax-rates/{id}': + delete: + operationId: DeleteTaxRatesTaxRate + summary: Delete a Tax Rate + description: Deletes a Tax Rate + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.delete(tax_rate_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/tax-rates/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetTaxRatesTaxRate + summary: Get a Tax Rate + description: Retrieves a TaxRate + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + x-codegen: + method: retrieve + queryParams: AdminGetTaxRatesTaxRateParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.retrieve(tax_rate_id) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/tax-rates/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostTaxRatesTaxRate + summary: Update a Tax Rate + description: Updates a Tax Rate + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateReq' + x-codegen: + method: update + queryParams: AdminPostTaxRatesTaxRateParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.taxRates.update(tax_rate_id, { + name: 'New Tax Rate' + }) + + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/tax-rates/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "name": "New Tax Rate" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /uploads/protected: + post: + operationId: PostUploadsProtected + summary: Protected File Upload + description: >- + Uploads at least one file with ACL or a non-public bucket to the + specific fileservice that is installed in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.uploads.createProtected(file) + + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/uploads/protected' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: image/jpeg' \ + + --form 'files=@""' \ + + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUploadsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /uploads: + post: + operationId: PostUploads + summary: Upload files + description: >- + Uploads at least one file to the specific fileservice that is installed + in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.uploads.create(file) + + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/uploads' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: image/jpeg' \ + + --form 'files=@""' \ + + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUploadsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: AdminDeleteUploads + summary: Delete an Uploaded File + description: Removes an uploaded file using the installed fileservice + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteUploadsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.uploads.delete({ + file_key + }) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/uploads' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "file_key": "{file_key}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteUploadsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /uploads/download-url: + post: + operationId: PostUploadsDownloadUrl + summary: Get a File's Download URL + description: Creates a presigned download url for a file + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostUploadsDownloadUrlReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.uploads.getPresignedDownloadUrl({ + file_key + }) + + .then(({ download_url }) => { + console.log(download_url); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/uploads/download-url' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "file_key": "{file_key}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUploadsDownloadUrlRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /users: + post: + operationId: PostUsers + summary: Create a User + description: Creates a User + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCreateUserRequest' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.create({ + email: 'user@example.com', + password: 'supersecret' + }) + + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST 'https://medusa-url.com/admin/users' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetUsers + summary: List Users + description: Retrieves all users. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.list() + + .then(({ users }) => { + console.log(users.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/users' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUsersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/users/{id}': + delete: + operationId: DeleteUsersUser + summary: Delete a User + description: Deletes a User + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.delete(user_id) + + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/users/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetUsersUser + summary: Get a User + description: Retrieves a User. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.retrieve(user_id) + + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/users/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostUsersUser + summary: Update a User + description: Updates a User + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdateUserRequest' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.update(user_id, { + first_name: 'Marcellus' + }) + + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/users/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Marcellus" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /users/password-token: + post: + operationId: PostUsersUserPasswordToken + summary: Request Password Reset + description: Generates a password token for a User with a given email. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminResetPasswordTokenRequest' + x-codegen: + method: sendResetPasswordToken + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.sendResetPasswordToken({ + email: 'user@example.com' + }) + + .then(() => { + // successful + }) + + .catch(() => { + // error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/users/password-token' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /users/reset-password: + post: + operationId: PostUsersUserPassword + summary: Reset Password + description: Sets the password for a User given the correct token. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminResetPasswordRequest' + x-codegen: + method: resetPassword + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.users.resetPassword({ + token: 'supersecrettoken', + password: 'supersecret' + }) + + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/users/reset-password' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "token": "supersecrettoken", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/variants/{id}/inventory': + get: + operationId: GetVariantsVariantInventory + summary: Get inventory of Variant. + description: Returns the available inventory of a Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Product Variant id to get inventory for. + schema: + type: string + x-codegen: + method: getInventory + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.variants.list() + .then(({ variants, limit, offset, count }) => { + console.log(variants.length) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/variants' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + variant: + type: object + $ref: '#/components/schemas/AdminGetVariantsVariantInventoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /variants: + get: + operationId: GetVariants + summary: List Product Variants + description: Retrieves a list of Product Variants + x-authenticated: true + parameters: + - in: query + name: id + description: A Product Variant id to filter by. + schema: + type: string + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: fields + description: A comma separated list of Product Variant fields to include. + schema: + type: string + - in: query + name: offset + description: How many product variants to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Maximum number of Product Variants to return. + schema: + type: number + default: '100' + - in: query + name: cart_id + description: The id of the cart to use for price selection. + schema: + type: string + - in: query + name: region_id + description: The id of the region to use for price selection. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: customer_id + description: The id of the customer to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search using less and greater than comparisons. + properties: + lt: + type: number + description: filter by inventory quantity less than this number + gt: + type: number + description: filter by inventory quantity greater than this number + lte: + type: number + description: >- + filter by inventory quantity less than or equal to this + number + gte: + type: number + description: >- + filter by inventory quantity greater than or equal to this + number + x-codegen: + method: list + queryParams: AdminGetVariantsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.variants.list() + + .then(({ variants, limit, offset, count }) => { + console.log(variants.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/variants' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminVariantsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' +components: + responses: + default_error: + description: Default Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + invalid_state_error: + description: Invalid State Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: >- + The request conflicted with another request. You may retry the + request with the provided Idempotency-Key. + type: QueryRunnerAlreadyReleasedError + invalid_request_error: + description: Invalid Request Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: invalid_request_error + message: Discount with code TEST already exists. + type: duplicate_error + not_found_error: + description: Not Found Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + message: Entity with id 1 was not found + type: not_found + 400_error: + description: Client Error or Multiple Errors + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' + examples: + not_allowed: + $ref: '#/components/examples/not_allowed_error' + invalid_data: + $ref: '#/components/examples/invalid_data_error' + MultipleErrors: + $ref: '#/components/examples/multiple_errors' + 500_error: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + database: + $ref: '#/components/examples/database_error' + unexpected_state: + $ref: '#/components/examples/unexpected_state_error' + invalid_argument: + $ref: '#/components/examples/invalid_argument_error' + default_error: + $ref: '#/components/examples/default_error' + unauthorized: + description: User is not authorized. Must log in first + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + incorrect_credentials: + description: User does not exist or incorrect credentials + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + examples: + not_allowed_error: + summary: Not Allowed Error + value: + message: Discount must be set to dynamic + type: not_allowed + invalid_data_error: + summary: Invalid Data Error + value: + message: first_name must be a string + type: invalid_data + multiple_errors: + summary: Multiple Errors + value: + message: >- + Provided request body contains errors. Please check the data and retry + the request + errors: + - message: first_name must be a string + type: invalid_data + - message: Discount must be set to dynamic + type: not_allowed + database_error: + summary: Database Error + value: + code: api_error + message: An error occured while hashing password + type: database_error + unexpected_state_error: + summary: Unexpected State Error + value: + message: cart.total must be defined + type: unexpected_state + invalid_argument_error: + summary: Invalid Argument Error + value: + message: cart.total must be defined + type: unexpected_state + default_error: + summary: Default Error + value: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + securitySchemes: + api_token: + type: http + x-displayName: API Token + description: > + Use a user's API Token to send authenticated requests. + + + ### How to Add API Token to a User + + + At the moment, there's no direct way of adding an API Token for a user. + The only way it can be done is through directly editing the database. + + + If you're using a PostgreSQL database, you can run the following + commands in your command line to add API token: + + + ```bash + + psql -d -U + + UPDATE public.user SET api_token='' WHERE + email=''; + + ``` + + + Where: + + - `` is the name of the database schema you use for the Medusa + server. + + - `` is the name of the user that has privileges over the + database schema. + + - `` is the API token you want to associate with the user. + You can use [this tool to generate a random + token](https://randomkeygen.com/). + + - `` is the email address of the admin user you want to have + this API token. + + + ### How to Use the API Token + + + The API token can be used for Bearer Authentication. It's passed in the + `Authorization` header as the following: + + + ``` + + Authorization: Bearer {api_token} + + ``` + + + In this API reference, you'll find in the cURL request samples the use + of `{api_token}`. This is where you must pass the API token. + + + If you're following along with the JS Client request samples, you must + provide the `apiKey` option when creating the Medusa client: + + + ```ts + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3, + apiKey: '{api_token}' }) + + ``` + + + If you're using Medusa React, you can pass the `apiKey` prop to + `MedusaProvider`: + + + ```tsx + + + + ``` + scheme: bearer + cookie_auth: + type: apiKey + in: cookie + name: connect.sid + x-displayName: Cookie Session ID + description: > + Use a cookie session to send authenticated requests. + + + ### How to Obtain the Cookie Session + + + If you're sending requests through a browser, using JS Client, or using + tools like Postman, the cookie session should be automatically set when + the admin user is logged in. + + + If you're sending requests using cURL, you must set the Session ID in + the cookie manually. + + + To do that, send a request to [authenticate the + user](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: + + + ```bash + + curl -v --location --request POST 'https://medusa-url.com/admin/auth' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + + ``` + + + The headers will be logged in the terminal as well as the response. You + should find in the headers a Cookie header similar to this: + + + ```bash + + Set-Cookie: + connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; + + ``` + + + Copy the value after `connect.sid` (without the `;` at the end) and pass + it as a cookie in subsequent requests as the following: + + + ```bash + + curl --location --request GET 'https://medusa-url.com/admin/products' \ + + --header 'Cookie: connect.sid={sid}' + + ``` + + + Where `{sid}` is the value of `connect.sid` that you copied. + schemas: + AddressFields: + title: Address Fields + description: Address fields used when creating/updating an address. + type: object + properties: + company: + type: string + description: Company name + example: Acme + first_name: + type: string + description: First name + example: Arno + last_name: + type: string + description: Last name + example: Willms + address_1: + type: string + description: Address line 1 + example: 14433 Kemmer Court + address_2: + type: string + description: Address line 2 + example: Suite 369 + city: + type: string + description: City + example: South Geoffreyview + country_code: + type: string + description: The 2 character ISO code of the country in lower case + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + type: string + description: Province + example: Kentucky + postal_code: + type: string + description: Postal Code + example: 72093 + phone: + type: string + description: Phone Number + example: 16128234334802 + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + Address: + title: Address + description: An address. + type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at + properties: + id: + type: string + description: ID of the address + example: addr_01G8ZC9VS1XVE149MGH2J7QSSH + customer_id: + description: ID of the customer this address belongs to + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + company: + description: Company name + nullable: true + type: string + example: Acme + first_name: + description: First name + nullable: true + type: string + example: Arno + last_name: + description: Last name + nullable: true + type: string + example: Willms + address_1: + description: Address line 1 + nullable: true + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + nullable: true + type: string + example: Suite 369 + city: + description: City + nullable: true + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + nullable: true + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + country: + description: A country object. Available if the relation `country` is expanded. + nullable: true + $ref: '#/components/schemas/Country' + province: + description: Province + nullable: true + type: string + example: Kentucky + postal_code: + description: Postal Code + nullable: true + type: string + example: 72093 + phone: + description: Phone Number + nullable: true + type: string + example: 16128234334802 + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + BatchJob: + title: Batch Job + description: A Batch Job. + type: object + required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status + - type + - updated_at + properties: + id: + description: The unique identifier for the batch job. + type: string + example: batch_01G8T782965PYFG0751G0Z38B4 + type: + description: The type of batch job. + type: string + enum: + - product-import + - product-export + status: + description: The status of the batch job. + type: string + enum: + - created + - pre_processed + - confirmed + - processing + - completed + - canceled + - failed + default: created + created_by: + description: The unique identifier of the user that created the batch job. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + nullable: true + $ref: '#/components/schemas/User' + context: + description: >- + The context of the batch job, the type of the batch job determines + what the context should contain. + nullable: true + type: object + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + nullable: true + allOf: + - type: object + example: {} + - type: object + properties: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: + type: string + file_size: + type: number + example: + errors: + - err: [] + code: unknown + message: Method not implemented. + stat_descriptors: + - key: product-export-count + name: Product count to export + message: There will be 8 products exported by this action + pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true + type: string + format: date-time + processing_at: + description: The date the job is processing at. + nullable: true + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + nullable: true + type: string + format: date-time + completed_at: + description: The date of the completion. + nullable: true + type: string + format: date-time + canceled_at: + description: The date of the concellation. + nullable: true + type: string + format: date-time + failed_at: + description: The date when the job failed. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Cart: + title: Cart + description: Represents a user cart + type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at + properties: + id: + description: The cart's ID + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + email: + description: The email associated with the cart + nullable: true + type: string + format: email + billing_address_id: + description: The billing address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The shipping address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + discounts: + description: Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + customer_id: + description: The customer's ID + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + payment_session: + description: The selected payment session in the cart. + nullable: true + $ref: '#/components/schemas/PaymentSession' + payment_sessions: + description: The payment sessions created on the cart. + type: array + items: + $ref: '#/components/schemas/PaymentSession' + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + $ref: '#/components/schemas/Payment' + shipping_methods: + description: The shipping methods added to the cart. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + type: + description: The cart's type. + type: string + enum: + - default + - swap + - draft_order + - payment_link + - claim + default: default + completed_at: + description: The date with timezone at which the cart was completed. + nullable: true + type: string + format: date-time + payment_authorized_at: + description: The date with timezone at which the payment was authorized. + nullable: true + type: string + format: date-time + idempotency_key: + description: >- + Randomly generated key used to continue the completion of a cart in + case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + context: + description: >- + The context of the cart which can include info like IP or user + agent. + nullable: true + type: object + example: + ip: '::1' + user_agent: PostmanRuntime/7.29.2 + sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + sales_channel: + description: >- + A sales channel object. Available if the relation `sales_channel` is + expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + shipping_total: + description: The total of shipping + type: integer + example: 1000 + discount_total: + description: The total of discount + type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: >- + The total amount refunded if the order associated with this cart is + returned. + type: integer + example: 0 + total: + description: The total amount of the cart + type: integer + example: 8200 + subtotal: + description: The subtotal of the cart + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + ClaimImage: + title: Claim Image + description: Represents photo documentation of a claim. + type: object + required: + - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + description: The claim image's ID + type: string + example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 + claim_item_id: + description: The ID of the claim item associated with the image + type: string + claim_item: + description: >- + A claim item object. Available if the relation `claim_item` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimItem' + url: + description: The URL of the image + type: string + format: uri + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimItem: + title: Claim Item + description: >- + Represents a claimed item along with information about the reasons for + the claim. + type: object + required: + - claim_order_id + - created_at + - deleted_at + - id + - item_id + - metadata + - note + - quantity + - reason + - updated_at + - variant_id + properties: + id: + description: The claim item's ID + type: string + example: citm_01G8ZH853Y6TFXWPG5EYE81X63 + images: + description: Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimImage' + claim_order_id: + description: The ID of the claim this item is associated with. + type: string + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + item_id: + description: The ID of the line item that the claim item refers to. + type: string + example: item_01G8ZM25TN49YV9EQBE2NC27KC + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + variant_id: + description: The ID of the product variant that is claimed. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A variant object. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + reason: + description: The reason for the claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + note: + description: 'An optional note about the claim, for additional information' + nullable: true + type: string + example: I don't like it. + quantity: + description: >- + The quantity of the item that is being claimed; must be less than or + equal to the amount purchased in the original order. + type: integer + example: 1 + tags: + description: >- + User defined tags for easy filtering and grouping. Available if the + relation 'tags' is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimTag' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimOrder: + title: Claim Order + description: >- + Claim Orders represent a group of faulty or missing items. Each claim + order consists of a subset of items associated with an original order, + and can contain additional information about fulfillments and returns. + type: object + required: + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at + properties: + id: + description: The claim's ID + type: string + example: claim_01G8ZH853Y6TFXWPG5EYE81X63 + type: + description: The claim's type + type: string + enum: + - refund + - replace + payment_status: + description: The status of the claim's payment + type: string + enum: + - na + - not_refunded + - refunded + default: na + fulfillment_status: + description: The claim's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + claim_items: + description: The items that have been claimed + type: array + items: + $ref: '#/components/schemas/ClaimItem' + additional_items: + description: >- + Refers to the new items to be shipped when the claim order has the + type `replace` + type: array + items: + $ref: '#/components/schemas/LineItem' + order_id: + description: The ID of the order that the claim comes from. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + return_order: + description: >- + A return object. Holds information about the return if the claim is + to be returned. Available if the relation 'return_order' is expanded + nullable: true + $ref: '#/components/schemas/Return' + shipping_address_id: + description: The ID of the address that the new items should be shipped to + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The shipping methods that the claim order will be shipped with. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + fulfillments: + description: The fulfillments of the new items to be shipped + type: array + items: + $ref: '#/components/schemas/Fulfillment' + refund_amount: + description: The amount that will be refunded in conjunction with the claim + nullable: true + type: integer + example: 1000 + canceled_at: + description: The date with timezone at which the claim was canceled. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the cart + associated with the claim in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + ClaimTag: + title: Claim Tag + description: >- + Claim Tags are user defined tags that can be assigned to claim items for + easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The claim tag's ID + type: string + example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 + value: + description: The value that the claim tag holds + type: string + example: Damaged + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Country: + title: Country + description: Country details + type: object + required: + - display_name + - id + - iso_2 + - iso_3 + - name + - num_code + - region_id + properties: + id: + description: The country's ID + type: string + example: 109 + iso_2: + description: The 2 character ISO code of the country in lower case + type: string + example: it + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + iso_3: + description: The 2 character ISO code of the country in lower case + type: string + example: ita + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements + description: See a list of codes. + num_code: + description: The numerical ISO code for the country. + type: string + example: 380 + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements + description: See a list of codes. + name: + description: The normalized country name in upper case. + type: string + example: ITALY + display_name: + description: The country name appropriate for display. + type: string + example: Italy + region_id: + description: The region ID this country is associated with. + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + Currency: + title: Currency + description: Currency + type: object + required: + - code + - name + - symbol + - symbol_native + properties: + code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + symbol: + description: The symbol used to indicate the currency. + type: string + example: $ + symbol_native: + description: The native symbol used to indicate the currency. + type: string + example: $ + name: + description: The written name of the currency + type: string + example: US Dollar + includes_tax: + description: '[EXPERIMENTAL] Does the currency prices include tax' + type: boolean + default: false + CustomShippingOption: + title: Custom Shipping Option + description: >- + Custom Shipping Options are 'overriden' Shipping Options. Store managers + can attach a Custom Shipping Option to a cart in order to set a custom + price for a particular Shipping Option + type: object + required: + - cart_id + - created_at + - deleted_at + - id + - metadata + - price + - shipping_option_id + - updated_at + properties: + id: + description: The custom shipping option's ID + type: string + example: cso_01G8X99XNB77DMFBJFWX6DN9V9 + price: + description: >- + The custom price set that will override the shipping option's + original price + type: integer + example: 1000 + shipping_option_id: + description: >- + The ID of the Shipping Option that the custom shipping option + overrides + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: >- + A shipping option object. Available if the relation + `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + cart_id: + description: The ID of the Cart that the custom shipping option is attached to + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + CustomerGroup: + title: Customer Group + description: Represents a customer group + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - updated_at + properties: + id: + description: The customer group's ID + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + name: + description: The name of the customer group + type: string + example: VIP + customers: + description: >- + The customers that belong to the customer group. Available if the + relation `customers` is expanded. + type: array + items: + $ref: '#/components/schemas/Customer' + price_lists: + description: >- + The price lists that are associated with the customer group. + Available if the relation `price_lists` is expanded. + type: array + items: + $ref: '#/components/schemas/PriceList' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Customer: + title: Customer + description: Represents a customer + type: object + required: + - billing_address_id + - created_at + - deleted_at + - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at + properties: + id: + description: The customer's ID + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + email: + description: The customer's email + type: string + format: email + first_name: + description: The customer's first name + nullable: true + type: string + example: Arno + last_name: + description: The customer's last name + nullable: true + type: string + example: Willms + billing_address_id: + description: The customer's billing address ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_addresses: + description: Available if the relation `shipping_addresses` is expanded. + type: array + items: + $ref: '#/components/schemas/Address' + phone: + description: The customer's phone number + nullable: true + type: string + example: 16128234334802 + has_account: + description: Whether the customer has an account or not + type: boolean + default: false + orders: + description: Available if the relation `orders` is expanded. + type: array + items: + $ref: '#/components/schemas/Order' + groups: + description: >- + The customer groups the customer belongs to. Available if the + relation `groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionCustomerGroup: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + type: object + required: + - condition_id + - created_at + - customer_group_id + - metadata + - updated_at + properties: + customer_group_id: + description: The ID of the Product Tag + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + customer_group: + description: Available if the relation `customer_group` is expanded. + nullable: true + $ref: '#/components/schemas/CustomerGroup' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductCollection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + type: object + required: + - condition_id + - created_at + - metadata + - product_collection_id + - updated_at + properties: + product_collection_id: + description: The ID of the Product Collection + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_collection: + description: Available if the relation `product_collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductTag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + type: object + required: + - condition_id + - created_at + - metadata + - product_tag_id + - updated_at + properties: + product_tag_id: + description: The ID of the Product Tag + type: string + example: ptag_01F0YESHPZYY3H4SJ3A5918SBN + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_tag: + description: Available if the relation `product_tag` is expanded. + nullable: true + $ref: '#/components/schemas/ProductTag' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductType: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + type: object + required: + - condition_id + - created_at + - metadata + - product_type_id + - updated_at + properties: + product_type_id: + description: The ID of the Product Tag + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProduct: + title: Product Discount Condition + description: Associates a discount condition with a product + type: object + required: + - condition_id + - created_at + - metadata + - product_id + - updated_at + properties: + product_id: + description: The ID of the Product Tag + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountCondition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + type: object + required: + - created_at + - deleted_at + - discount_rule_id + - id + - metadata + - operator + - type + - updated_at + properties: + id: + description: The discount condition's ID + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + operator: + description: The operator of the Condition + type: string + enum: + - in + - not_in + discount_rule_id: + description: The ID of the discount rule associated with the condition + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + discount_rule: + description: Available if the relation `discount_rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + products: + description: >- + products associated with this condition if type = products. + Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: >- + Product types associated with this condition if type = + product_types. Available if the relation `product_types` is + expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + product_tags: + description: >- + Product tags associated with this condition if type = product_tags. + Available if the relation `product_tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + product_collections: + description: >- + Product collections associated with this condition if type = + product_collections. Available if the relation `product_collections` + is expanded. + type: array + items: + $ref: '#/components/schemas/ProductCollection' + customer_groups: + description: >- + Customer groups associated with this condition if type = + customer_groups. Available if the relation `customer_groups` is + expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountRule: + title: Discount Rule + description: >- + Holds the rules that governs how a Discount is calculated when applied + to a Cart. + type: object + required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata + - type + - updated_at + - value + properties: + id: + description: The discount rule's ID + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + type: + description: >- + The type of the Discount, can be `fixed` for discounts that reduce + the price by a fixed amount, `percentage` for percentage reductions + or `free_shipping` for shipping vouchers. + type: string + enum: + - fixed + - percentage + - free_shipping + example: percentage + description: + description: A short description of the discount + nullable: true + type: string + example: 10 Percent + value: + description: >- + The value that the discount represents; this will depend on the type + of the discount + type: integer + example: 10 + allocation: + description: The scope that the discount should apply to. + nullable: true + type: string + enum: + - total + - item + example: total + conditions: + description: >- + A set of conditions that can be used to limit when the discount can + be used. Available if the relation `conditions` is expanded. + type: array + items: + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Discount: + title: Discount + description: >- + Represents a discount that can be applied to a cart for promotional + purposes. + type: object + required: + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration + properties: + id: + description: The discount's ID + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + code: + description: >- + A unique code for the discount - this will be used by the customer + to apply the discount + type: string + example: 10DISC + is_dynamic: + description: >- + A flag to indicate if multiple instances of the discount can be + generated. I.e. for newsletter discounts + type: boolean + example: false + rule_id: + description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + rule: + description: Available if the relation `rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + is_disabled: + description: >- + Whether the Discount has been disabled. Disabled discounts cannot be + applied to carts + type: boolean + example: false + parent_discount_id: + description: >- + The Discount that the discount was created from. This will always be + a dynamic discount + nullable: true + type: string + example: disc_01G8ZH853YPY9B94857DY91YGW + parent_discount: + description: Available if the relation `parent_discount` is expanded. + nullable: true + $ref: '#/components/schemas/Discount' + starts_at: + description: The time at which the discount can be used. + type: string + format: date-time + ends_at: + description: The time at which the discount can no longer be used. + nullable: true + type: string + format: date-time + valid_duration: + description: Duration the discount runs between + nullable: true + type: string + example: P3Y6M4DT12H30M5S + regions: + description: >- + The Regions in which the Discount can be used. Available if the + relation `regions` is expanded. + type: array + items: + $ref: '#/components/schemas/Region' + usage_limit: + description: The maximum number of times that a discount can be used. + nullable: true + type: integer + example: 100 + usage_count: + description: The number of times a discount has been used. + type: integer + example: 50 + default: 0 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DraftOrder: + title: DraftOrder + description: Represents a draft order + type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at + properties: + id: + description: The draft order's ID + type: string + example: dorder_01G8TJFKBG38YYFQ035MSVG03C + status: + description: The status of the draft order + type: string + enum: + - open + - completed + default: open + display_id: + description: The draft order's display ID + type: string + example: 2 + cart_id: + description: The ID of the cart associated with the draft order. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + order_id: + description: The ID of the order associated with the draft order. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + canceled_at: + description: The date the draft order was canceled at. + nullable: true + type: string + format: date-time + completed_at: + description: The date the draft order was completed at. + nullable: true + type: string + format: date-time + no_notification_order: + description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean + example: false + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the cart + associated with the draft order in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + FulfillmentItem: + title: Fulfillment Item + description: >- + Correlates a Line Item with a Fulfillment, keeping track of the quantity + of the Line Item. + type: object + required: + - fulfillment_id + - item_id + - quantity + properties: + fulfillment_id: + description: The id of the Fulfillment that the Fulfillment Item belongs to. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + item_id: + description: The id of the Line Item that the Fulfillment Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + fulfillment: + description: >- + A fulfillment object. Available if the relation `fulfillment` is + expanded. + nullable: true + $ref: '#/components/schemas/Fulfillment' + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Fulfillment. + type: integer + example: 1 + FulfillmentProvider: + title: Fulfillment Provider + description: >- + Represents a fulfillment provider plugin and holds its installation + status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the fulfillment provider as given by the plugin. + type: string + example: manual + is_installed: + description: >- + Whether the plugin is installed in the current version. Plugins that + are no longer installed are not deleted by will have this field set + to `false`. + type: boolean + default: true + Fulfillment: + title: Fulfillment + description: >- + Fulfillments are created once store operators can prepare the purchased + goods. Fulfillments will eventually be shipped and hold information + about how to track shipments. Fulfillments are created through a + provider, which is typically an external shipping aggregator, shipping + partner og 3PL, most plugins will have asynchronous communications with + these providers through webhooks in order to automatically update and + synchronize the state of Fulfillments. + type: object + required: + - canceled_at + - claim_order_id + - created_at + - data + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - provider_id + - shipped_at + - swap_id + - tracking_numbers + - updated_at + properties: + id: + description: The fulfillment's ID + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + claim_order_id: + description: The id of the Claim that the Fulfillment belongs to. + nullable: true + type: string + example: null + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + swap_id: + description: The id of the Swap that the Fulfillment belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + order_id: + description: The id of the Order that the Fulfillment belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + provider_id: + description: >- + The id of the Fulfillment Provider responsible for handling the + fulfillment + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + location_id: + description: The id of the stock location the fulfillment will be shipped from + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + items: + description: >- + The Fulfillment Items in the Fulfillment - these hold information + about how many of each Line Item has been fulfilled. Available if + the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentItem' + tracking_links: + description: >- + The Tracking Links that can be used to track the status of the + Fulfillment, these will usually be provided by the Fulfillment + Provider. Available if the relation `tracking_links` is expanded. + type: array + items: + $ref: '#/components/schemas/TrackingLink' + tracking_numbers: + description: >- + The tracking numbers that can be used to track the status of the + fulfillment. + deprecated: true + type: array + items: + type: string + data: + description: >- + This contains all the data necessary for the Fulfillment provider to + handle the fulfillment. + type: object + example: {} + shipped_at: + description: The date with timezone at which the Fulfillment was shipped. + nullable: true + type: string + format: date-time + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be sent. + nullable: true + type: boolean + example: false + canceled_at: + description: The date with timezone at which the Fulfillment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the + fulfillment in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + GiftCardTransaction: + title: Gift Card Transaction + description: >- + Gift Card Transactions are created once a Customer uses a Gift Card to + pay for their Order + type: object + required: + - amount + - created_at + - gift_card_id + - id + - is_taxable + - order_id + - tax_rate + properties: + id: + description: The gift card transaction's ID + type: string + example: gct_01G8X9A7ESKAJXG2H0E6F1MW7A + gift_card_id: + description: The ID of the Gift Card that was used in the transaction. + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + gift_card: + description: >- + A gift card object. Available if the relation `gift_card` is + expanded. + nullable: true + $ref: '#/components/schemas/GiftCard' + order_id: + description: The ID of the Order that the Gift Card was used to pay for. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + amount: + description: The amount that was used from the Gift Card. + type: integer + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + is_taxable: + description: Whether the transaction is taxable or not. + nullable: true + type: boolean + example: false + tax_rate: + description: The tax rate of the transaction + nullable: true + type: number + example: 0 + GiftCard: + title: Gift Card + description: >- + Gift Cards are redeemable and represent a value that can be used towards + the payment of an Order. + type: object + required: + - balance + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - metadata + - order_id + - region_id + - tax_rate + - updated_at + - value + properties: + id: + description: The gift card's ID + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + code: + description: >- + The unique code that identifies the Gift Card. This is used by the + Customer to redeem the value of the Gift Card. + type: string + example: 3RFT-MH2C-Y4YZ-XMN4 + value: + description: The value that the Gift Card represents. + type: integer + example: 10 + balance: + description: The remaining value on the Gift Card. + type: integer + example: 10 + region_id: + description: The id of the Region in which the Gift Card is available. + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + order_id: + description: The id of the Order that the Gift Card was purchased in. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + is_disabled: + description: >- + Whether the Gift Card has been disabled. Disabled Gift Cards cannot + be applied to carts. + type: boolean + default: false + ends_at: + description: The time at which the Gift Card can no longer be used. + nullable: true + type: string + format: date-time + tax_rate: + description: The gift card's tax rate that will be applied on calculating totals + nullable: true + type: number + example: 0 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + IdempotencyKey: + title: Idempotency Key + description: >- + Idempotency Key is used to continue a process in case of any failure + that might occur. + type: object + required: + - created_at + - id + - idempotency_key + - locked_at + - recovery_point + - response_code + - response_body + - request_method + - request_params + - request_path + properties: + id: + description: The idempotency key's ID + type: string + example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A + idempotency_key: + description: >- + The unique randomly generated key used to determine the state of a + process. + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: Date which the idempotency key was locked. + type: string + format: date-time + locked_at: + description: Date which the idempotency key was locked. + nullable: true + type: string + format: date-time + request_method: + description: The method of the request + nullable: true + type: string + example: POST + request_params: + description: The parameters passed to the request + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + request_path: + description: The request's path + nullable: true + type: string + example: /store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete + response_code: + description: The response's code. + nullable: true + type: string + example: 200 + response_body: + description: The response's body + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + recovery_point: + description: Where to continue from. + type: string + default: started + Image: + title: Image + description: Images holds a reference to a URL at which the image file can be found. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + type: string + description: The image's ID + example: img_01G749BFYR6T8JTVW6SGW3K3E6 + url: + description: The URL at which the image file can be found. + type: string + format: uri + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Invite: + title: Invite + description: Represents an invite + type: object + required: + - accepted + - created_at + - deleted_at + - expires_at + - id + - metadata + - role + - token + - updated_at + - user_email + properties: + id: + type: string + description: The invite's ID + example: invite_01G8TKE4XYCTHSCK2GDEP47RE1 + user_email: + description: The email of the user being invited. + type: string + format: email + role: + description: The user's role. + nullable: true + type: string + enum: + - admin + - member + - developer + default: member + accepted: + description: Whether the invite was accepted or not. + type: boolean + default: false + token: + description: The token used to accept the invite. + type: string + expires_at: + description: The date the invite expires at. + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemAdjustment: + title: Line Item Adjustment + description: Represents a Line Item Adjustment + type: object + required: + - amount + - description + - discount_id + - id + - item_id + - metadata + properties: + id: + description: The Line Item Adjustment's ID + type: string + example: lia_01G8TKE4XYCTHSCK2GDEP47RE1 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + description: + description: The line item's adjustment description + type: string + example: Adjusted item's price. + discount_id: + description: The ID of the discount associated with the adjustment + nullable: true + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + discount: + description: Available if the relation `discount` is expanded. + nullable: true + $ref: '#/components/schemas/Discount' + amount: + description: The adjustment amount + type: integer + example: 1000 + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemTaxLine: + title: Line Item Tax Line + description: Represents a Line Item Tax Line + type: object + required: + - code + - created_at + - id + - item_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItem: + title: Line Item + description: >- + Line Items represent purchasable units that can be added to a Cart for + checkout. When Line Items are purchased they will get copied to the + resulting order and can eventually be referenced in Fulfillments and + Returns. Line Items may also be created when processing Swaps and + Claims. + type: object + required: + - allow_discounts + - cart_id + - claim_order_id + - created_at + - description + - fulfilled_quantity + - has_shipping + - id + - is_giftcard + - is_return + - metadata + - order_edit_id + - order_id + - original_item_id + - quantity + - returned_quantity + - shipped_quantity + - should_merge + - swap_id + - thumbnail + - title + - unit_price + - updated_at + - variant_id + properties: + id: + description: The line item's ID + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + cart_id: + description: The ID of the Cart that the Line Item belongs to. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + order_id: + description: The ID of the Order that the Line Item belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + swap_id: + description: The id of the Swap that the Line Item belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + claim_order_id: + description: The id of the Claim that the Line Item belongs to. + nullable: true + type: string + example: null + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemTaxLine' + adjustments: + description: Available if the relation `adjustments` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemAdjustment' + original_item_id: + description: The id of the original line item + nullable: true + type: string + order_edit_id: + description: The ID of the order edit to which a cloned item belongs + nullable: true + type: string + order_edit: + description: >- + The order edit joined. Available if the relation `order_edit` is + expanded. + nullable: true + $ref: '#/components/schemas/OrderEdit' + title: + description: >- + The title of the Line Item, this should be easily identifiable by + the Customer. + type: string + example: Medusa Coffee Mug + description: + description: A more detailed description of the contents of the Line Item. + nullable: true + type: string + example: One Size + thumbnail: + description: A URL string to a small image of the contents of the Line Item. + nullable: true + type: string + format: uri + example: >- + https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png + is_return: + description: Is the item being returned + type: boolean + default: false + is_giftcard: + description: Flag to indicate if the Line Item is a Gift Card. + type: boolean + default: false + should_merge: + description: >- + Flag to indicate if new Line Items with the same variant should be + merged or added as an additional Line Item. + type: boolean + default: true + allow_discounts: + description: >- + Flag to indicate if the Line Item should be included when doing + discount calculations. + type: boolean + default: true + has_shipping: + description: >- + Flag to indicate if the Line Item has fulfillment associated with + it. + nullable: true + type: boolean + example: false + unit_price: + description: >- + The price of one unit of the content in the Line Item. This should + be in the currency defined by the Cart/Order/Swap/Claim that the + Line Item belongs to. + type: integer + example: 8000 + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: >- + A product variant object. The Product Variant contained in the Line + Item. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + quantity: + description: The quantity of the content in the Line Item. + type: integer + example: 1 + fulfilled_quantity: + description: The quantity of the Line Item that has been fulfilled. + nullable: true + type: integer + example: 0 + returned_quantity: + description: The quantity of the Line Item that has been returned. + nullable: true + type: integer + example: 0 + shipped_quantity: + description: The quantity of the Line Item that has been shipped. + nullable: true + type: integer + example: 0 + refundable: + description: >- + The amount that can be refunded from the given Line Item. Takes + taxes and discounts into consideration. + type: integer + example: 0 + subtotal: + description: The subtotal of the line item + type: integer + example: 8000 + tax_total: + description: The total of tax of the line item + type: integer + example: 0 + total: + description: The total amount of the line item + type: integer + example: 8000 + original_total: + description: The original total amount of the line item + type: integer + example: 8000 + original_tax_total: + description: The original tax total amount of the line item + type: integer + example: 0 + discount_total: + description: The total of discount of the line item + type: integer + example: 0 + gift_card_total: + description: The total of the gift card of the line item + type: integer + example: 0 + includes_tax: + description: '[EXPERIMENTAL] Indicates if the line item unit_price include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + MoneyAmount: + title: Money Amount + description: >- + Money Amounts represents an amount that a given Product Variant can be + purcased for. Each Money Amount either has a Currency or Region + associated with it to indicate the pricing in a given Currency or, for + fully region-based pricing, the given price in a specific Region. If + region-based pricing is used the amount will be in the currency defined + for the Reigon. + type: object + required: + - amount + - created_at + - currency_code + - deleted_at + - id + - max_quantity + - min_quantity + - price_list_id + - region_id + - updated_at + - variant_id + properties: + id: + description: The money amount's ID + type: string + example: ma_01F0YESHRFQNH5S8Q0PK84YYZN + currency_code: + description: The 3 character currency code that the Money Amount is given in. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount: + description: >- + The amount in the smallest currecny unit (e.g. cents 100 cents to + charge $1) that the Product Variant will cost. + type: integer + example: 100 + min_quantity: + description: >- + The minimum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. + nullable: true + type: integer + example: 1 + max_quantity: + description: >- + The maximum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. + nullable: true + type: integer + example: 1 + price_list_id: + description: The ID of the price list associated with the money amount + nullable: true + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + price_list: + description: Available if the relation `price_list` is expanded. + nullable: true + $ref: '#/components/schemas/PriceList' + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: >- + The Product Variant contained in the Line Item. Available if the + relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + region_id: + description: The region's ID + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Note: + title: Note + description: >- + Notes are elements which we can use in association with different + resources to allow users to describe additional information in relation + to these. + type: object + required: + - author_id + - created_at + - deleted_at + - id + - metadata + - resource_id + - resource_type + - updated_at + - value + properties: + id: + description: The note's ID + type: string + example: note_01G8TM8ENBMC7R90XRR1G6H26Q + resource_type: + description: The type of resource that the Note refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Note refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + value: + description: The contents of the note. + type: string + example: This order must be fulfilled on Monday + author_id: + description: The ID of the author (user) + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + author: + description: Available if the relation `author` is expanded. + nullable: true + $ref: '#/components/schemas/User' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + NotificationProvider: + title: Notification Provider + description: >- + Represents a notification provider plugin and holds its installation + status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the notification provider as given by the plugin. + type: string + example: sendgrid + is_installed: + description: >- + Whether the plugin is installed in the current version. Plugins that + are no longer installed are not deleted by will have this field set + to `false`. + type: boolean + default: true + Notification: + title: Notification + description: >- + Notifications a communications sent via Notification Providers as a + reaction to internal events such as `order.placed`. Notifications can be + used to show a chronological timeline for communications sent to a + Customer regarding an Order, and enables resends. + type: object + required: + - created_at + - customer_id + - data + - event_name + - id + - parent_id + - provider_id + - resource_type + - resource_id + - to + - updated_at + properties: + id: + description: The notification's ID + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + event_name: + description: The name of the event that the notification was sent for. + nullable: true + type: string + example: order.placed + resource_type: + description: The type of resource that the Notification refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Notification refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + customer_id: + description: The ID of the Customer that the Notification was sent to. + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + to: + description: >- + The address that the Notification was sent to. This will usually be + an email address, but represent other addresses such as a chat bot + user id + type: string + example: user@example.com + data: + description: >- + The data that the Notification was sent with. This contains all the + data necessary for the Notification Provider to initiate a resend. + type: object + example: {} + parent_id: + description: The notification's parent ID + nullable: true + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + parent_notification: + description: Available if the relation `parent_notification` is expanded. + nullable: true + $ref: '#/components/schemas/Notification' + resends: + description: >- + The resends that have been completed after the original + Notification. Available if the relation `resends` is expanded. + type: array + items: + $ref: '#/components/schemas/Notification' + provider_id: + description: The id of the Notification Provider that handles the Notification. + nullable: true + type: string + example: sengrid + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/NotificationProvider' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + OAuth: + title: OAuth + description: Represent an OAuth app + type: object + required: + - application_name + - data + - display_name + - id + - install_url + - uninstall_url + properties: + id: + description: The app's ID + type: string + example: example_app + display_name: + description: The app's display name + type: string + example: Example app + application_name: + description: The app's name + type: string + example: example + install_url: + description: The URL to install the app + nullable: true + type: string + format: uri + uninstall_url: + description: The URL to uninstall the app + nullable: true + type: string + format: uri + data: + description: Any data necessary to the app. + nullable: true + type: object + example: {} + OrderEdit: + title: Order Edit + description: Order edit keeps track of order items changes. + type: object + required: + - canceled_at + - canceled_by + - confirmed_by + - confirmed_at + - created_at + - created_by + - declined_at + - declined_by + - declined_reason + - id + - internal_note + - order_id + - payment_collection_id + - requested_at + - requested_by + - status + - updated_at + properties: + id: + description: The order edit's ID + type: string + example: oe_01G8TJSYT9M6AVS5N4EMNFS1EK + order_id: + description: The ID of the order that is edited + type: string + example: order_01G2SG30J8C85S4A5CHM2S1NS2 + order: + description: Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + changes: + description: Available if the relation `changes` is expanded. + type: array + items: + $ref: '#/components/schemas/OrderItemChange' + internal_note: + description: An optional note with additional details about the order edit. + nullable: true + type: string + example: Included two more items B to the order. + created_by: + description: >- + The unique identifier of the user or customer who created the order + edit. + type: string + requested_by: + description: >- + The unique identifier of the user or customer who requested the + order edit. + nullable: true + type: string + requested_at: + description: The date with timezone at which the edit was requested. + nullable: true + type: string + format: date-time + confirmed_by: + description: >- + The unique identifier of the user or customer who confirmed the + order edit. + nullable: true + type: string + confirmed_at: + description: The date with timezone at which the edit was confirmed. + nullable: true + type: string + format: date-time + declined_by: + description: >- + The unique identifier of the user or customer who declined the order + edit. + nullable: true + type: string + declined_at: + description: The date with timezone at which the edit was declined. + nullable: true + type: string + format: date-time + declined_reason: + description: An optional note why the order edit is declined. + nullable: true + type: string + canceled_by: + description: >- + The unique identifier of the user or customer who cancelled the + order edit. + nullable: true + type: string + canceled_at: + description: The date with timezone at which the edit was cancelled. + nullable: true + type: string + format: date-time + subtotal: + description: The total of subtotal + type: integer + example: 8000 + discount_total: + description: The total of discount + type: integer + example: 800 + shipping_total: + description: The total of the shipping amount + type: integer + example: 800 + gift_card_total: + description: The total of the gift card amount + type: integer + example: 800 + gift_card_tax_total: + description: The total of the gift card tax amount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + total: + description: The total amount of the edited order. + type: integer + example: 8200 + difference_due: + description: >- + The difference between the total amount of the order and total + amount of edited order. + type: integer + example: 8200 + status: + description: The status of the order edit. + type: string + enum: + - confirmed + - declined + - requested + - created + - canceled + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + payment_collection_id: + description: The ID of the payment collection + nullable: true + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + nullable: true + $ref: '#/components/schemas/PaymentCollection' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + OrderItemChange: + title: Order Item Change + description: Represents an order edit item change + type: object + required: + - created_at + - deleted_at + - id + - line_item_id + - order_edit_id + - original_line_item_id + - type + - updated_at + properties: + id: + description: The order item change's ID + type: string + example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The order item change's status + type: string + enum: + - item_add + - item_remove + - item_update + order_edit_id: + description: The ID of the order edit + type: string + example: oe_01G2SG30J8C85S4A5CHM2S1NS2 + order_edit: + description: Available if the relation `order_edit` is expanded. + nullable: true + $ref: '#/components/schemas/OrderEdit' + original_line_item_id: + description: The ID of the original line item in the order + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + original_line_item: + description: Available if the relation `original_line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + line_item_id: + description: The ID of the cloned line item. + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + line_item: + description: Available if the relation `line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Order: + title: Order + description: Represents an order + type: object + required: + - billing_address_id + - canceled_at + - cart_id + - created_at + - currency_code + - customer_id + - draft_order_id + - display_id + - email + - external_id + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - object + - payment_status + - region_id + - shipping_address_id + - status + - tax_rate + - updated_at + properties: + id: + description: The order's ID + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + status: + description: The order's status + type: string + enum: + - pending + - completed + - archived + - canceled + - requires_action + default: pending + fulfillment_status: + description: The order's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + payment_status: + description: The order's payment status + type: string + enum: + - not_paid + - awaiting + - captured + - partially_refunded + - refunded + - canceled + - requires_action + default: not_paid + display_id: + description: The order's display ID + type: integer + example: 2 + cart_id: + description: The ID of the cart associated with the order + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + customer_id: + description: The ID of the customer associated with the order + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + email: + description: The email associated with the order + type: string + format: email + billing_address_id: + description: The ID of the billing address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The ID of the shipping address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character currency code that is used in the order + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The order's tax rate + nullable: true + type: number + example: 0 + discounts: + description: >- + The discounts used in the order. Available if the relation + `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: >- + The gift cards used in the order. Available if the relation + `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + shipping_methods: + description: >- + The shipping methods used in the order. Available if the relation + `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + payments: + description: >- + The payments used in the order. Available if the relation `payments` + is expanded. + type: array + items: + $ref: '#/components/schemas/Payment' + fulfillments: + description: >- + The fulfillments used in the order. Available if the relation + `fulfillments` is expanded. + type: array + items: + $ref: '#/components/schemas/Fulfillment' + returns: + description: >- + The returns associated with the order. Available if the relation + `returns` is expanded. + type: array + items: + $ref: '#/components/schemas/Return' + claims: + description: >- + The claims associated with the order. Available if the relation + `claims` is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimOrder' + refunds: + description: >- + The refunds associated with the order. Available if the relation + `refunds` is expanded. + type: array + items: + $ref: '#/components/schemas/Refund' + swaps: + description: >- + The swaps associated with the order. Available if the relation + `swaps` is expanded. + type: array + items: + $ref: '#/components/schemas/Swap' + draft_order_id: + description: The ID of the draft order this order is associated with. + nullable: true + type: string + example: null + draft_order: + description: >- + A draft order object. Available if the relation `draft_order` is + expanded. + nullable: true + $ref: '#/components/schemas/DraftOrder' + items: + description: >- + The line items that belong to the order. Available if the relation + `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + edits: + description: >- + Order edits done on the order. Available if the relation `edits` is + expanded. + type: array + items: + $ref: '#/components/schemas/OrderEdit' + gift_card_transactions: + description: >- + The gift card transactions used in the order. Available if the + relation `gift_card_transactions` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCardTransaction' + canceled_at: + description: The date the order was canceled on. + nullable: true + type: string + format: date-time + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: >- + Randomly generated key used to continue the processing of the order + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + external_id: + description: The ID of an external order. + nullable: true + type: string + example: null + sales_channel_id: + description: The ID of the sales channel this order is associated with. + nullable: true + type: string + example: null + sales_channel: + description: >- + A sales channel object. Available if the relation `sales_channel` is + expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + shipping_total: + type: integer + description: The total of shipping + example: 1000 + discount_total: + description: The total of discount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order is returned. + type: integer + example: 0 + total: + description: The total amount of the order + type: integer + example: 8200 + subtotal: + description: The subtotal of the order + type: integer + example: 8000 + paid_total: + description: The total amount paid + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + returnable_items: + description: >- + The items that are returnable as part of the order, order swaps or + order claims + type: array + items: + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentCollection: + title: Payment Collection + description: Payment Collection + type: object + required: + - amount + - authorized_amount + - created_at + - created_by + - currency_code + - deleted_at + - description + - id + - metadata + - region_id + - status + - type + - updated_at + properties: + id: + description: The payment collection's ID + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The type of the payment collection + type: string + enum: + - order_edit + status: + description: The type of the payment collection + type: string + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - canceled + description: + description: Description of the payment collection + nullable: true + type: string + amount: + description: Amount of the payment collection. + type: integer + authorized_amount: + description: Authorized amount of the payment collection. + nullable: true + type: integer + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + payment_sessions: + description: Available if the relation `payment_sessions` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentSession' + payments: + description: Available if the relation `payments` is expanded. + type: array + items: + $ref: '#/components/schemas/Payment' + created_by: + description: The ID of the user that created the payment collection. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentProvider: + title: Payment Provider + description: Represents a Payment Provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the payment provider as given by the plugin. + type: string + example: manual + is_installed: + description: >- + Whether the plugin is installed in the current version. Plugins that + are no longer installed are not deleted by will have this field set + to `false`. + type: boolean + default: true + PaymentSession: + title: Payment Session + description: >- + Payment Sessions are created when a Customer initilizes the checkout + flow, and can be used to hold the state of a payment flow. Each Payment + Session is controlled by a Payment Provider, who is responsible for the + communication with external payment services. Authorized Payment + Sessions will eventually get promoted to Payments to indicate that they + are authorized for capture/refunds/etc. + type: object + required: + - amount + - cart_id + - created_at + - data + - id + - is_initiated + - is_selected + - idempotency_key + - payment_authorized_at + - provider_id + - status + - updated_at + properties: + id: + description: The payment session's ID + type: string + example: ps_01G901XNSRM2YS3ASN9H5KG3FZ + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + provider_id: + description: >- + The id of the Payment Provider that is responsible for the Payment + Session + type: string + example: manual + is_selected: + description: >- + A flag to indicate if the Payment Session has been selected as the + method that will be used to complete the purchase. + nullable: true + type: boolean + example: true + is_initiated: + description: >- + A flag to indicate if a communication with the third party provider + has been initiated. + type: boolean + default: false + example: true + status: + description: >- + Indicates the status of the Payment Session. Will default to + `pending`, and will eventually become `authorized`. Payment Sessions + may have the status of `requires_more` to indicate that further + actions are to be completed by the Customer. + type: string + enum: + - authorized + - pending + - requires_more + - error + - canceled + example: pending + data: + description: >- + The data required for the Payment Provider to identify, modify and + process the Payment Session. Typically this will be an object that + holds an id to the external payment session, but can be an empty + object if the Payment Provider doesn't hold any state. + type: object + example: {} + idempotency_key: + description: >- + Randomly generated key used to continue the completion of a cart in + case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + amount: + description: The amount that the Payment Session has been authorized for. + nullable: true + type: integer + example: 100 + payment_authorized_at: + description: The date with timezone at which the Payment Session was authorized. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + Payment: + title: Payment + description: >- + Payments represent an amount authorized with a given payment method, + Payments can be captured, canceled or refunded. + type: object + required: + - amount + - amount_refunded + - canceled_at + - captured_at + - cart_id + - created_at + - currency_code + - data + - id + - idempotency_key + - metadata + - order_id + - provider_id + - swap_id + - updated_at + properties: + id: + description: The payment's ID + type: string + example: pay_01G2SJNT6DEEWDFNAJ4XWDTHKE + swap_id: + description: The ID of the Swap that the Payment is used for. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + order_id: + description: The ID of the Order that the Payment is used for. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + amount: + description: The amount that the Payment has been authorized for. + type: integer + example: 100 + currency_code: + description: The 3 character ISO currency code that the Payment is completed in. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount_refunded: + description: >- + The amount of the original Payment amount that has been refunded + back to the Customer. + type: integer + default: 0 + example: 0 + provider_id: + description: The id of the Payment Provider that is responsible for the Payment + type: string + example: manual + data: + description: >- + The data required for the Payment Provider to identify, modify and + process the Payment. Typically this will be an object that holds an + id to the external payment session, but can be an empty object if + the Payment Provider doesn't hold any state. + type: object + example: {} + captured_at: + description: The date with timezone at which the Payment was captured. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Payment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: >- + Randomly generated key used to continue the completion of a payment + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PriceList: + title: Price List + description: >- + Price Lists represents a set of prices that overrides the default price + for one or more product variants. + type: object + required: + - created_at + - deleted_at + - description + - ends_at + - id + - name + - starts_at + - status + - type + - updated_at + properties: + id: + description: The price list's ID + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + name: + description: The price list's name + type: string + example: VIP Prices + description: + description: The price list's description + type: string + example: Prices for VIP customers + type: + description: >- + The type of Price List. This can be one of either `sale` or + `override`. + type: string + enum: + - sale + - override + default: sale + status: + description: The status of the Price List + type: string + enum: + - active + - draft + default: draft + starts_at: + description: The date with timezone that the Price List starts being valid. + nullable: true + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + nullable: true + type: string + format: date-time + customer_groups: + description: >- + The Customer Groups that the Price List applies to. Available if the + relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + prices: + description: >- + The Money Amounts that are associated with the Price List. Available + if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + includes_tax: + description: '[EXPERIMENTAL] Does the price list prices include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductCategory: + title: ProductCategory + description: Represents a product category + x-resourceId: ProductCategory + type: object + required: + - category_children + - created_at + - deleted_at + - handle + - id + - is_active + - is_internal + - mpath + - name + - parent_category_id + - updated_at + properties: + id: + description: The product category's ID + type: string + example: pcat_01G2SG30J8C85S4A5CHM2S1NS2 + name: + description: The product category's name + type: string + example: Regular Fit + handle: + description: >- + A unique string that identifies the Product Category - can for + example be used in slug structures. + type: string + example: regular-fit + mpath: + description: >- + A string for Materialized Paths - used for finding ancestors and + descendents + nullable: true + type: string + example: pcat_id1.pcat_id2.pcat_id3 + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + default: false + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + default: false + category_children: + description: Available if the relation `category_children` are expanded. + type: array + items: + $ref: '#/components/schemas/ProductCategory' + parent_category_id: + description: The ID of the parent category. + nullable: true + type: string + default: null + parent_category: + description: >- + A product category object. Available if the relation + `parent_category` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCategory' + products: + description: >- + Products associated with category. Available if the relation + `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductCollection: + title: Product Collection + description: Product Collections represents a group of Products that are related. + type: object + required: + - created_at + - deleted_at + - handle + - id + - metadata + - title + - updated_at + properties: + id: + description: The product collection's ID + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + title: + description: The title that the Product Collection is identified by. + type: string + example: Summer Collection + handle: + description: >- + A unique string that identifies the Product Collection - can for + example be used in slug structures. + nullable: true + type: string + example: summer-collection + products: + description: >- + The Products contained in the Product Collection. Available if the + relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOptionValue: + title: Product Option Value + description: >- + A value given to a Product Variant's option set. Product Variant have a + Product Option Value for each of the Product Options defined on the + Product. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - option_id + - updated_at + - value + - variant_id + properties: + id: + description: The product option value's ID + type: string + example: optval_01F0YESHR7S6ECD03RF6W12DSJ + value: + description: >- + The value that the Product Variant has defined for the specific + Product Option (e.g. if the Product Option is \"Size\" this value + could be `Small`, `Medium` or `Large`). + type: string + example: large + option_id: + description: >- + The ID of the Product Option that the Product Option Value is + defined for. + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + option: + description: Available if the relation `option` is expanded. + nullable: true + $ref: '#/components/schemas/ProductOption' + variant_id: + description: >- + The ID of the Product Variant that the Product Option Value is + defined for. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOption: + title: Product Option + description: >- + Product Options define properties that may vary between different + variants of a Product. Common Product Options are "Size" and "Color", + but Medusa doesn't limit what Product Options that can be defined. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - product_id + - title + - updated_at + properties: + id: + description: The product option's ID + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + title: + description: The title that the Product Option is defined by (e.g. `Size`). + type: string + example: Size + values: + description: >- + The Product Option Values that are defined for the Product Option. + Available if the relation `values` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + product_id: + description: The ID of the Product that the Product Option is defined for. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTag: + title: Product Tag + description: Product Tags can be added to Products for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product tag's ID + type: string + example: ptag_01G8K2MTMG9168F2B70S1TAVK3 + value: + description: The value that the Product Tag represents + type: string + example: Pants + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTaxRate: + title: Product Tax Rate + description: >- + Associates a tax rate with a product to indicate that the product is + taxed in a certain way + type: object + required: + - created_at + - metadata + - product_id + - rate_id + - updated_at + properties: + product_id: + description: The ID of the Product + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTypeTaxRate: + title: Product Type Tax Rate + description: >- + Associates a tax rate with a product type to indicate that the product + type is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_type_id + - rate_id + - updated_at + properties: + product_type_id: + description: The ID of the Product type + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + rate_id: + description: The id of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductType: + title: Product Type + description: >- + Product Type can be added to Products for filtering and reporting + purposes. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product type's ID + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + value: + description: The value that the Product Type represents. + type: string + example: Clothing + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductVariantInventoryItem: + title: Product Variant Inventory Item + description: >- + Product Variant Inventory Items link variants with inventory items and + denote the number of inventory items constituting a variant. + type: object + required: + - created_at + - deleted_at + - id + - inventory_item_id + - required_quantity + - updated_at + - variant_id + properties: + id: + description: The product variant inventory item's ID + type: string + example: pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A + inventory_item_id: + description: The id of the inventory item + type: string + variant_id: + description: The id of the variant. + type: string + variant: + description: >- + A ProductVariant object. Available if the relation `variant` is + expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + required_quantity: + description: >- + The quantity of an inventory item required for one quantity of the + variant. + type: integer + default: 1 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductVariant: + title: Product Variant + description: >- + Product Variants represent a Product with a specific set of Product + Option configurations. The maximum number of Product Variants that a + Product can have is given by the number of available Product Option + combinations. + type: object + required: + - allow_backorder + - barcode + - created_at + - deleted_at + - ean + - height + - hs_code + - id + - inventory_quantity + - length + - manage_inventory + - material + - metadata + - mid_code + - origin_country + - product_id + - sku + - title + - upc + - updated_at + - weight + - width + properties: + id: + description: The product variant's ID + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + title: + description: >- + A title that can be displayed for easy identification of the Product + Variant. + type: string + example: Small + product_id: + description: The ID of the Product that the Product Variant belongs to. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + prices: + description: >- + The Money Amounts defined for the Product Variant. Each Money Amount + represents a price in a given currency or a price in a specific + Region. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + sku: + description: >- + The unique stock keeping unit used to identify the Product Variant. + This will usually be a unqiue identifer for the item that is to be + shipped, and can be referenced across multiple systems. + nullable: true + type: string + example: shirt-123 + barcode: + description: >- + A generic field for a GTIN number that can be used to identify the + Product Variant. + nullable: true + type: string + example: null + ean: + description: >- + An EAN barcode number that can be used to identify the Product + Variant. + nullable: true + type: string + example: null + upc: + description: >- + A UPC barcode number that can be used to identify the Product + Variant. + nullable: true + type: string + example: null + variant_rank: + description: The ranking of this variant + nullable: true + type: number + default: 0 + inventory_quantity: + description: The current quantity of the item that is stocked. + type: integer + example: 100 + allow_backorder: + description: >- + Whether the Product Variant should be purchasable when + `inventory_quantity` is 0. + type: boolean + default: false + manage_inventory: + description: Whether Medusa should manage inventory for the Product Variant. + type: boolean + default: true + hs_code: + description: >- + The Harmonized System code of the Product Variant. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + nullable: true + type: string + example: null + origin_country: + description: >- + The country in which the Product Variant was produced. May be used + by Fulfillment Providers to pass customs information to shipping + carriers. + nullable: true + type: string + example: null + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Product Variant. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: >- + The material and composition that the Product Variant is made of, + May be used by Fulfillment Providers to pass customs information to + shipping carriers. + nullable: true + type: string + example: null + weight: + description: >- + The weight of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + length: + description: >- + The length of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + height: + description: >- + The height of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + width: + description: >- + The width of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + options: + description: >- + The Product Option Values specified for the Product Variant. + Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + inventory_items: + description: >- + The Inventory Items related to the product variant. Available if the + relation `inventory_items` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariantInventoryItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Product: + title: Product + description: >- + Products are a grouping of Product Variants that have common properties + such as images and descriptions. Products can have multiple options + which define the properties that Product Variants differ by. + type: object + required: + - collection_id + - created_at + - deleted_at + - description + - discountable + - external_id + - handle + - height + - hs_code + - id + - is_giftcard + - length + - material + - metadata + - mid_code + - origin_country + - profile_id + - status + - subtitle + - type_id + - thumbnail + - title + - updated_at + - weight + - width + properties: + id: + description: The product's ID + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + title: + description: >- + A title that can be displayed for easy identification of the + Product. + type: string + example: Medusa Coffee Mug + subtitle: + description: >- + An optional subtitle that can be used to further specify the + Product. + nullable: true + type: string + description: + description: A short description of the Product. + nullable: true + type: string + example: Every programmer's best friend. + handle: + description: A unique identifier for the Product (e.g. for slug structure). + nullable: true + type: string + example: coffee-mug + is_giftcard: + description: >- + Whether the Product represents a Gift Card. Products that represent + Gift Cards will automatically generate a redeemable Gift Card code + once they are purchased. + type: boolean + default: false + status: + description: The status of the product + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + images: + description: >- + Images of the Product. Available if the relation `images` is + expanded. + type: array + items: + $ref: '#/components/schemas/Image' + thumbnail: + description: A URL to an image file that can be used to identify the Product. + nullable: true + type: string + format: uri + options: + description: >- + The Product Options that are defined for the Product. Product + Variants of the Product will have a unique combination of Product + Option Values. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOption' + variants: + description: >- + The Product Variants that belong to the Product. Each will have a + unique combination of Product Option Values. Available if the + relation `variants` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariant' + categories: + description: >- + The product's associated categories. Available if the relation + `categories` are expanded. + type: array + items: + $ref: '#/components/schemas/ProductCategory' + profile_id: + description: >- + The ID of the Shipping Profile that the Product belongs to. Shipping + Profiles have a set of defined Shipping Options that can be used to + Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + weight: + description: >- + The weight of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + length: + description: >- + The length of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + height: + description: >- + The height of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + width: + description: >- + The width of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + hs_code: + description: >- + The Harmonized System code of the Product Variant. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + nullable: true + type: string + example: null + origin_country: + description: >- + The country in which the Product Variant was produced. May be used + by Fulfillment Providers to pass customs information to shipping + carriers. + nullable: true + type: string + example: null + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Product Variant. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: >- + The material and composition that the Product Variant is made of, + May be used by Fulfillment Providers to pass customs information to + shipping carriers. + nullable: true + type: string + example: null + collection_id: + description: The Product Collection that the Product belongs to + nullable: true + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + collection: + description: >- + A product collection object. Available if the relation `collection` + is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + type_id: + description: The Product type that the Product belongs to + nullable: true + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: Available if the relation `type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + tags: + description: >- + The Product Tags assigned to the Product. Available if the relation + `tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + discountable: + description: >- + Whether the Product can be discounted. Discounts will not apply to + Line Items of this Product when this flag is set to `false`. + type: boolean + default: true + external_id: + description: The external ID of the product + nullable: true + type: string + example: null + sales_channels: + description: >- + The sales channels the product is associated with. Available if the + relation `sales_channels` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PublishableApiKeySalesChannel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + type: object + required: + - publishable_key_id + - sales_channel_id + properties: + sales_channel_id: + description: The sales channel's ID + type: string + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + description: The publishable API key's ID + type: string + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + PublishableApiKey: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + type: object + required: + - created_at + - created_by + - id + - revoked_by + - revoked_at + - title + - updated_at + properties: + id: + description: The key's ID + type: string + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + description: The unique identifier of the user that created the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by: + description: The unique identifier of the user that revoked the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_at: + description: The date with timezone at which the key was revoked. + nullable: true + type: string + format: date-time + title: + description: The key's title. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + Refund: + title: Refund + description: >- + Refund represent an amount of money transfered back to the Customer for + a given reason. Refunds may occur in relation to Returns, Swaps and + Claims, but can also be initiated by a store operator. + type: object + required: + - amount + - created_at + - id + - idempotency_key + - metadata + - note + - order_id + - payment_id + - reason + - updated_at + properties: + id: + description: The refund's ID + type: string + example: ref_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Refund is related to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + $ref: '#/components/schemas/Payment' + amount: + description: The amount that has be refunded to the Customer. + type: integer + example: 1000 + note: + description: An optional note explaining why the amount was refunded. + nullable: true + type: string + example: I didn't like it + reason: + description: >- + The reason given for the Refund, will automatically be set when + processed as part of a Swap, Claim or Return. + type: string + enum: + - discount + - return + - swap + - claim + - other + example: return + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the refund + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Region: + title: Region + description: >- + Regions hold settings for how Customers in a given geographical location + shop. The is, for example, where currencies and tax rates are defined. A + Region can consist of multiple countries to accomodate common shopping + settings across countries. + type: object + required: + - automatic_taxes + - created_at + - currency_code + - deleted_at + - gift_cards_taxable + - id + - metadata + - name + - tax_code + - tax_provider_id + - tax_rate + - updated_at + properties: + id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + name: + description: >- + The name of the region as displayed to the customer. If the Region + only has one country it is recommended to write the country name. + type: string + example: EU + currency_code: + description: The 3 character currency code that the Region uses. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The tax rate that should be charged on purchases in the Region. + type: number + example: 0 + tax_rates: + description: >- + The tax rates that are included in the Region. Available if the + relation `tax_rates` is expanded. + type: array + items: + $ref: '#/components/schemas/TaxRate' + tax_code: + description: >- + The tax code used on purchases in the Region. This may be used by + other systems for accounting purposes. + nullable: true + type: string + example: null + gift_cards_taxable: + description: Whether the gift cards are taxable or not in this region. + type: boolean + default: true + automatic_taxes: + description: Whether taxes should be automated in this region. + type: boolean + default: true + countries: + description: >- + The countries that are included in the Region. Available if the + relation `countries` is expanded. + type: array + items: + $ref: '#/components/schemas/Country' + tax_provider_id: + description: The ID of the tax provider used in this region + nullable: true + type: string + example: null + tax_provider: + description: Available if the relation `tax_provider` is expanded. + nullable: true + $ref: '#/components/schemas/TaxProvider' + payment_providers: + description: >- + The Payment Providers that can be used to process Payments in the + Region. Available if the relation `payment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + fulfillment_providers: + description: >- + The Fulfillment Providers that can be used to fulfill orders in the + Region. Available if the relation `fulfillment_providers` is + expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentProvider' + includes_tax: + description: '[EXPERIMENTAL] Does the prices for the region include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnItem: + title: Return Item + description: >- + Correlates a Line Item with a Return, keeping track of the quantity of + the Line Item that will be returned. + type: object + required: + - is_requested + - item_id + - metadata + - note + - quantity + - reason_id + - received_quantity + - requested_quantity + - return_id + properties: + return_id: + description: The id of the Return that the Return Item belongs to. + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + item_id: + description: The id of the Line Item that the Return Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + return_order: + description: Available if the relation `return_order` is expanded. + nullable: true + $ref: '#/components/schemas/Return' + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Return. + type: integer + example: 1 + is_requested: + description: >- + Whether the Return Item was requested initially or received + unexpectedly in the warehouse. + type: boolean + default: true + requested_quantity: + description: The quantity that was originally requested to be returned. + nullable: true + type: integer + example: 1 + received_quantity: + description: The quantity that was received in the warehouse. + nullable: true + type: integer + example: 1 + reason_id: + description: The ID of the reason for returning the item. + nullable: true + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + reason: + description: Available if the relation `reason` is expanded. + nullable: true + $ref: '#/components/schemas/ReturnReason' + note: + description: An optional note with additional details about the Return. + nullable: true + type: string + example: I didn't like it. + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnReason: + title: Return Reason + description: >- + A Reason for why a given product is returned. A Return Reason can be + used on Return Items in order to indicate why a Line Item was returned. + type: object + required: + - created_at + - deleted_at + - description + - id + - label + - metadata + - parent_return_reason_id + - updated_at + - value + properties: + id: + description: The return reason's ID + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + value: + description: The value to identify the reason by. + type: string + example: damaged + label: + description: A text that can be displayed to the Customer as a reason. + type: string + example: Damaged goods + description: + description: A description of the Reason. + nullable: true + type: string + example: Items that are damaged + parent_return_reason_id: + description: The ID of the parent reason. + nullable: true + type: string + example: null + parent_return_reason: + description: Available if the relation `parent_return_reason` is expanded. + nullable: true + $ref: '#/components/schemas/ReturnReason' + return_reason_children: + description: Available if the relation `return_reason_children` is expanded. + $ref: '#/components/schemas/ReturnReason' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Return: + title: Return + description: >- + Return orders hold information about Line Items that a Customer wishes + to send back, along with how the items will be returned. Returns can be + used as part of a Swap. + type: object + required: + - claim_order_id + - created_at + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - received_at + - refund_amount + - shipping_data + - status + - swap_id + - updated_at + properties: + id: + description: The return's ID + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + status: + description: Status of the Return. + type: string + enum: + - requested + - received + - requires_action + - canceled + default: requested + items: + description: >- + The Return Items that will be shipped back to the warehouse. + Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/ReturnItem' + swap_id: + description: The ID of the Swap that the Return is a part of. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + claim_order_id: + description: The ID of the Claim that the Return is a part of. + nullable: true + type: string + example: null + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + order_id: + description: The ID of the Order that the Return is made from. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + shipping_method: + description: >- + The Shipping Method that will be used to send the Return back. Can + be null if the Customer facilitates the return shipment themselves. + Available if the relation `shipping_method` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingMethod' + shipping_data: + description: >- + Data about the return shipment as provided by the Fulfilment + Provider that handles the return shipment. + nullable: true + type: object + example: {} + location_id: + description: The id of the stock location the return will be added back. + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + refund_amount: + description: The amount that should be refunded as a result of the return. + type: integer + example: 1000 + no_notification: + description: >- + When set to true, no notification will be sent related to this + return. + nullable: true + type: boolean + example: false + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the return + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + received_at: + description: The date with timezone at which the return was received. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + SalesChannelLocation: + title: Sales Channel Stock Location + description: Sales Channel Stock Location link sales channels with stock locations. + type: object + required: + - created_at + - deleted_at + - id + - location_id + - sales_channel_id + - updated_at + properties: + id: + description: The Sales Channel Stock Location's ID + type: string + example: scloc_01G8X9A7ESKAJXG2H0E6F1MW7A + sales_channel_id: + description: The id of the Sales Channel + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + location_id: + description: The id of the Location Stock. + type: string + sales_channel: + description: >- + The sales channel the location is associated with. Available if the + relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + SalesChannel: + title: Sales Channel + description: A Sales Channel + type: object + required: + - created_at + - deleted_at + - description + - id + - is_disabled + - name + - updated_at + properties: + id: + description: The sales channel's ID + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + name: + description: The name of the sales channel. + type: string + example: Market + description: + description: The description of the sales channel. + nullable: true + type: string + example: Multi-vendor market + is_disabled: + description: Specify if the sales channel is enabled or disabled. + type: boolean + default: false + locations: + description: >- + The Stock Locations related to the sales channel. Available if the + relation `locations` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannelLocation' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingMethodTaxLine: + title: Shipping Method Tax Line + description: Shipping Method Tax Line + type: object + required: + - code + - created_at + - id + - shipping_method_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + shipping_method_id: + description: The ID of the line item + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_method: + description: Available if the relation `shipping_method` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingMethod' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingMethod: + title: Shipping Method + description: >- + Shipping Methods represent a way in which an Order or Return can be + shipped. Shipping Methods are built from a Shipping Option, but may + contain additional details, that can be necessary for the Fulfillment + Provider to handle the shipment. + type: object + required: + - cart_id + - claim_order_id + - data + - id + - order_id + - price + - return_id + - shipping_option_id + - swap_id + properties: + id: + description: The shipping method's ID + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_option_id: + description: >- + The id of the Shipping Option that the Shipping Method is built + from. + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Shipping Method is used on. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + claim_order_id: + description: The id of the Claim that the Shipping Method is used on. + nullable: true + type: string + example: null + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + cart_id: + description: The id of the Cart that the Shipping Method is used on. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + swap_id: + description: The id of the Swap that the Shipping Method is used on. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + return_id: + description: The id of the Return that the Shipping Method is used on. + nullable: true + type: string + example: null + return_order: + description: >- + A return object. Available if the relation `return_order` is + expanded. + nullable: true + $ref: '#/components/schemas/Return' + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethodTaxLine' + price: + description: >- + The amount to charge for the Shipping Method. The currency of the + price is defined by the Region that the Order that the Shipping + Method belongs to is a part of. + type: integer + example: 200 + data: + description: >- + Additional data that the Fulfillment Provider needs to fulfill the + shipment. This is used in combination with the Shipping Options + data, and may contain information such as a drop point id. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' + type: boolean + default: false + subtotal: + description: The subtotal of the shipping + type: integer + example: 8000 + total: + description: The total amount of the shipping + type: integer + example: 8200 + tax_total: + description: The total of tax + type: integer + example: 0 + ShippingOptionRequirement: + title: Shipping Option Requirement + description: >- + A requirement that a Cart must satisfy for the Shipping Option to be + available to the Cart. + type: object + required: + - amount + - deleted_at + - id + - shipping_option_id + - type + properties: + id: + description: The shipping option requirement's ID + type: string + example: sor_01G1G5V29AB4CTNDRFSRWSRKWD + shipping_option_id: + description: >- + The id of the Shipping Option that the hipping option requirement + belongs to + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + type: + description: >- + The type of the requirement, this defines how the value will be + compared to the Cart's total. `min_subtotal` requirements define the + minimum subtotal that is needed for the Shipping Option to be + available, while the `max_subtotal` defines the maximum subtotal + that the Cart can have for the Shipping Option to be available. + type: string + enum: + - min_subtotal + - max_subtotal + example: min_subtotal + amount: + description: The amount to compare the Cart subtotal to. + type: integer + example: 100 + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingOption: + title: Shipping Option + description: >- + Shipping Options represent a way in which an Order or Return can be + shipped. Shipping Options have an associated Fulfillment Provider that + will be used when the fulfillment of an Order is initiated. Shipping + Options themselves cannot be added to Carts, but serve as a template for + Shipping Methods. This distinction makes it possible to customize + individual Shipping Methods with additional information. + type: object + required: + - admin_only + - amount + - created_at + - data + - deleted_at + - id + - is_return + - metadata + - name + - price_type + - profile_id + - provider_id + - region_id + - updated_at + properties: + id: + description: The shipping option's ID + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + name: + description: >- + The name given to the Shipping Option - this may be displayed to the + Customer. + type: string + example: PostFake Standard + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + profile_id: + description: >- + The ID of the Shipping Profile that the shipping option belongs to. + Shipping Profiles have a set of defined Shipping Options that can be + used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + provider_id: + description: >- + The id of the Fulfillment Provider, that will be used to process + Fulfillments from the Shipping Option. + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + price_type: + description: >- + The type of pricing calculation that is used when creatin Shipping + Methods from the Shipping Option. Can be `flat_rate` for fixed + prices or `calculated` if the Fulfillment Provider can provide price + calulations. + type: string + enum: + - flat_rate + - calculated + example: flat_rate + amount: + description: >- + The amount to charge for shipping when the Shipping Option price + type is `flat_rate`. + nullable: true + type: integer + example: 200 + is_return: + description: >- + Flag to indicate if the Shipping Option can be used for Return + shipments. + type: boolean + default: false + admin_only: + description: >- + Flag to indicate if the Shipping Option usage is restricted to admin + users. + type: boolean + default: false + requirements: + description: >- + The requirements that must be satisfied for the Shipping Option to + be available for a Cart. Available if the relation `requirements` is + expanded. + type: array + items: + $ref: '#/components/schemas/ShippingOptionRequirement' + data: + description: >- + The data needed for the Fulfillment Provider to identify the + Shipping Option. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Does the shipping option price include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingProfile: + title: Shipping Profile + description: >- + Shipping Profiles have a set of defined Shipping Options that can be + used to fulfill a given set of Products. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - type + - updated_at + properties: + id: + description: The shipping profile's ID + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + name: + description: >- + The name given to the Shipping profile - this may be displayed to + the Customer. + type: string + example: Default Shipping Profile + type: + description: >- + The type of the Shipping Profile, may be `default`, `gift_card` or + `custom`. + type: string + enum: + - default + - gift_card + - custom + example: default + products: + description: >- + The Products that the Shipping Profile defines Shipping Options for. + Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + shipping_options: + description: >- + The Shipping Options that can be used to fulfill the Products in the + Shipping Profile. Available if the relation `shipping_options` is + expanded. + type: array + items: + $ref: '#/components/schemas/ShippingOption' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingTaxRate: + title: Shipping Tax Rate + description: >- + Associates a tax rate with a shipping option to indicate that the + shipping option is taxed in a certain way + type: object + required: + - created_at + - metadata + - rate_id + - shipping_option_id + - updated_at + properties: + shipping_option_id: + description: The ID of the Shipping Option + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + StagedJob: + title: Staged Job + description: A staged job resource + type: object + required: + - data + - event_name + - id + - options + properties: + id: + description: The staged job's ID + type: string + example: job_01F0YET7BZTARY9MKN1SJ7AAXF + event_name: + description: The name of the event + type: string + example: order.placed + data: + description: Data necessary for the job + type: object + example: {} + option: + description: The staged job's option + type: object + example: {} + Store: + title: Store + description: 'Holds settings for the Store, such as name, currencies, etc.' + type: object + required: + - created_at + - default_currency_code + - default_location_id + - id + - invite_link_template + - metadata + - name + - payment_link_template + - swap_link_template + - updated_at + properties: + id: + description: The store's ID + type: string + example: store_01G1G5V21KADXNGH29BJMAJ4B4 + name: + description: The name of the Store - this may be displayed to the Customer. + type: string + example: Medusa Store + default_currency_code: + description: The 3 character currency code that is the default of the store. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + default_currency: + description: Available if the relation `default_currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + currencies: + description: >- + The currencies that are enabled for the Store. Available if the + relation `currencies` is expanded. + type: array + items: + $ref: '#/components/schemas/Currency' + swap_link_template: + description: >- + A template to generate Swap links from. Use {{cart_id}} to include + the Swap's `cart_id` in the link. + nullable: true + type: string + example: null + payment_link_template: + description: >- + A template to generate Payment links from. Use {{cart_id}} to + include the payment's `cart_id` in the link. + nullable: true + type: string + example: null + invite_link_template: + description: A template to generate Invite links from + nullable: true + type: string + example: null + default_location_id: + description: The location ID the store is associated with. + nullable: true + type: string + example: null + default_sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + default_sales_channel: + description: >- + A sales channel object. Available if the relation + `default_sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Swap: + title: Swap + description: >- + Swaps can be created when a Customer wishes to exchange Products that + they have purchased to different Products. Swaps consist of a Return of + previously purchased Products and a Fulfillment of new Products, the + amount paid for the Products being returned will be used towards payment + for the new Products. In the case where the amount paid for the the + Products being returned exceed the amount to be paid for the new + Products, a Refund will be issued for the difference. + type: object + required: + - allow_backorder + - canceled_at + - cart_id + - confirmed_at + - created_at + - deleted_at + - difference_due + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - shipping_address_id + - updated_at + properties: + id: + description: The swap's ID + type: string + example: swap_01F0YET86Y9G92D3YDR9Y6V676 + fulfillment_status: + description: The status of the Fulfillment of the Swap. + type: string + enum: + - not_fulfilled + - fulfilled + - shipped + - partially_shipped + - canceled + - requires_action + example: not_fulfilled + payment_status: + description: >- + The status of the Payment of the Swap. The payment may either refer + to the refund of an amount or the authorization of a new amount. + type: string + enum: + - not_paid + - awaiting + - captured + - confirmed + - canceled + - difference_refunded + - partially_refunded + - refunded + - requires_action + example: not_paid + order_id: + description: >- + The ID of the Order where the Line Items to be returned where + purchased. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + additional_items: + description: >- + The new Line Items to ship to the Customer. Available if the + relation `additional_items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + return_order: + description: >- + A return order object. The Return that is issued for the return part + of the Swap. Available if the relation `return_order` is expanded. + nullable: true + $ref: '#/components/schemas/Return' + fulfillments: + description: >- + The Fulfillments used to send the new Line Items. Available if the + relation `fulfillments` is expanded. + type: array + items: + $ref: '#/components/schemas/Fulfillment' + payment: + description: >- + The Payment authorized when the Swap requires an additional amount + to be charged from the Customer. Available if the relation `payment` + is expanded. + nullable: true + $ref: '#/components/schemas/Payment' + difference_due: + description: >- + The difference that is paid or refunded as a result of the Swap. May + be negative when the amount paid for the returned items exceed the + total of the new Products. + nullable: true + type: integer + example: 0 + shipping_address_id: + description: >- + The Address to send the new Line Items to - in most cases this will + be the same as the shipping address on the Order. + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: >- + The Shipping Methods used to fulfill the additional items purchased. + Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + cart_id: + description: The id of the Cart that the Customer will use to confirm the Swap. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + confirmed_at: + description: >- + The date with timezone at which the Swap was confirmed by the + Customer. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + nullable: true + type: string + format: date-time + no_notification: + description: 'If set to true, no notification will be sent related to this swap' + nullable: true + type: boolean + example: false + allow_backorder: + description: 'If true, swaps can be completed with items out of stock' + type: boolean + default: false + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the swap + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxLine: + title: Tax Line + description: Line item that specifies an amount of tax to add to a line item. + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The tax line's ID + type: string + example: tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxProvider: + title: Tax Provider + description: The tax service used to calculate taxes + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the tax provider as given by the plugin. + type: string + example: manual + is_installed: + description: >- + Whether the plugin is installed in the current version. Plugins that + are no longer installed are not deleted by will have this field set + to `false`. + type: boolean + default: true + TaxRate: + title: Tax Rate + description: >- + A Tax Rate can be used to associate a certain rate to charge on products + within a given Region + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - region_id + - updated_at + properties: + id: + description: The tax rate's ID + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + rate: + description: The numeric rate to charge + nullable: true + type: number + example: 10 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + region_id: + description: The id of the Region that the rate belongs to + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + products: + description: >- + The products that belong to this tax rate. Available if the relation + `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: >- + The product types that belong to this tax rate. Available if the + relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + shipping_options: + type: array + description: >- + The shipping options that belong to this tax rate. Available if the + relation `shipping_options` is expanded. + items: + $ref: '#/components/schemas/ShippingOption' + product_count: + description: The count of products + type: integer + example: 10 + product_type_count: + description: The count of product types + type: integer + example: 2 + shipping_option_count: + description: The count of shipping options + type: integer + example: 1 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TrackingLink: + title: Tracking Link + description: >- + Tracking Link holds information about tracking numbers for a + Fulfillment. Tracking Links can optionally contain a URL that can be + visited to see the status of the shipment. + type: object + required: + - created_at + - deleted_at + - fulfillment_id + - id + - idempotency_key + - metadata + - tracking_number + - updated_at + - url + properties: + id: + description: The tracking link's ID + type: string + example: tlink_01G8ZH853Y6TFXWPG5EYE81X63 + url: + description: The URL at which the status of the shipment can be tracked. + nullable: true + type: string + format: uri + tracking_number: + description: The tracking number given by the shipping carrier. + type: string + format: RH370168054CN + fulfillment_id: + description: The id of the Fulfillment that the Tracking Link references. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + fulfillment: + description: Available if the relation `fulfillment` is expanded. + nullable: true + $ref: '#/components/schemas/Fulfillment' + idempotency_key: + description: >- + Randomly generated key used to continue the completion of a process + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + User: + title: User + description: Represents a User who can manage store settings. + type: object + required: + - api_token + - created_at + - deleted_at + - email + - first_name + - id + - last_name + - metadata + - role + - updated_at + properties: + id: + description: The user's ID + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + role: + description: The user's role + type: string + enum: + - admin + - member + - developer + default: member + email: + description: The email of the User + type: string + format: email + first_name: + description: The first name of the User + nullable: true + type: string + example: Levi + last_name: + description: The last name of the User + nullable: true + type: string + example: Bogan + api_token: + description: An API token associated with the user. + nullable: true + type: string + example: null + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: >- + The Harmonized System code of the Inventory Item. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + origin_country: + description: >- + The country in which the Inventory Item was produced. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Inventory Item. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + type: string + material: + description: >- + The material and composition that the Inventory Item is made of, May + be used by Fulfillment Providers to pass customs information to + shipping carriers. + type: string + weight: + description: >- + The weight of the Inventory Item. May be used in shipping rate + calculations. + type: number + height: + description: >- + The height of the Inventory Item. May be used in shipping rate + calculations. + type: number + width: + description: >- + The width of the Inventory Item. May be used in shipping rate + calculations. + type: number + length: + description: >- + The length of the Inventory Item. May be used in shipping rate + calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + ReservationItemDTO: + title: Reservation item + description: Represents a reservation of an inventory item at a stock location + type: object + required: + - id + - location_id + - inventory_item_id + - quantity + properties: + id: + description: The id of the reservation item + type: string + location_id: + description: The id of the location of the reservation + type: string + inventory_item_id: + description: The id of the inventory item the reservation relates to + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: >- + the total stock quantity of an inventory item at the given location + ID + type: number + reserved_quantity: + description: >- + the reserved stock quantity of an inventory item at the given + location ID + type: number + incoming_quantity: + description: >- + the incoming stock quantity of an inventory item at the given + location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + PricedVariant: + title: Priced Product Variant + type: object + allOf: + - $ref: '#/components/schemas/ProductVariant' + - type: object + properties: + original_price: + type: number + description: >- + The original price of the variant without any discounted prices + applied. + calculated_price: + type: number + description: The calculated price of the variant. Can be a discounted price. + original_price_incl_tax: + type: number + description: The original price of the variant including taxes. + calculated_price_incl_tax: + type: number + description: The calculated price of the variant including taxes. + original_tax: + type: number + description: The taxes applied on the original price. + calculated_tax: + type: number + description: The taxes applied on the calculated price. + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + PricedProduct: + title: Priced Product + type: object + allOf: + - $ref: '#/components/schemas/Product' + - type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + StockLocationAddressDTO: + title: Stock Location Address + description: Represents a Stock Location Address + type: object + required: + - address_1 + - country_code + - created_at + - updated_at + properties: + id: + type: string + description: The stock location address' ID + example: laddr_51G4ZW853Y6TFXWPG5ENJ81X42 + address_1: + type: string + description: Stock location address + example: '35, Jhon Doe Ave' + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + StockLocationDTO: + title: Stock Location + description: Represents a Stock Location + type: object + required: + - id + - name + - address_id + - created_at + - updated_at + properties: + id: + type: string + description: The stock location's ID + example: sloc_51G4ZW853Y6TFXWPG5ENJ81X42 + address_id: + type: string + description: Stock location address' ID + example: laddr_05B2ZE853Y6FTXWPW85NJ81A44 + name: + type: string + description: The name of the stock location + example: Main Warehouse + address: + description: The Address of the Stock Location + allOf: + - $ref: '#/components/schemas/StockLocationAddressDTO' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + StockLocationAddressInput: + title: Stock Location Address Input + description: Represents a Stock Location Address Input + type: object + required: + - address_1 + - country_code + properties: + address_1: + type: string + description: Stock location address + example: '35, Jhon Doe Ave' + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + CreateStockLocationInput: + title: Create Stock Location Input + description: Represents the Input to create a Stock Location + type: object + required: + - name + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + UpdateStockLocationInput: + title: Update Stock Location Input + description: Represents the Input to update a Stock Location + type: object + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + MultipleErrors: + title: Multiple Errors + type: object + properties: + errors: + type: array + description: Array of errors + items: + $ref: '#/components/schemas/Error' + message: + type: string + default: >- + Provided request body contains errors. Please check the data and + retry the request + Error: + title: Response Error + type: object + properties: + code: + type: string + description: A slug code to indicate the type of the error. + message: + type: string + description: Description of the error that occurred. + type: + type: string + description: A slug indicating the type of the error. + 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. + AdminAppsRes: + type: object + properties: + apps: + $ref: '#/components/schemas/OAuth' + AdminAppsListRes: + type: object + properties: + apps: + type: array + items: + $ref: '#/components/schemas/OAuth' + 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 + AdminAuthRes: + type: object + properties: + user: + $ref: '#/components/schemas/User' + 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 + AdminBatchJobRes: + type: object + properties: + batch_job: + $ref: '#/components/schemas/BatchJob' + AdminBatchJobListRes: + type: object + properties: + batch_jobs: + type: array + items: + $ref: '#/components/schemas/BatchJob' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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 + AdminCollectionsListRes: + 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 + AdminCollectionsDeleteRes: + 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 + AdminDeleteProductsFromCollectionRes: + 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 + AdminCollectionsRes: + type: object + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + 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 + AdminCurrenciesListRes: + 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 + AdminCurrenciesRes: + type: object + properties: + currency: + $ref: '#/components/schemas/Currency' + AdminPostCurrenciesCurrencyReq: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + AdminPostCustomerGroupsGroupCustomersBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + type: object + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminPostCustomerGroupsReq: + type: object + required: + - name + properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. + AdminDeleteCustomerGroupsGroupCustomerBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + type: object + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminCustomerGroupsRes: + type: object + properties: + customer_group: + $ref: '#/components/schemas/CustomerGroup' + AdminCustomerGroupsDeleteRes: + 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 + AdminCustomerGroupsListRes: + 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 + AdminPostCustomerGroupsGroupReq: + type: object + properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object + AdminPostCustomersReq: + type: object + required: + - email + - first_name + - last_name + - password + properties: + email: + type: string + description: The customer's email. + format: email + first_name: + type: string + description: The customer's first name. + last_name: + type: string + description: The customer's last name. + password: + type: string + description: The customer's password. + format: password + phone: + type: string + description: The customer's phone number. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminCustomersRes: + type: object + properties: + customer: + $ref: '#/components/schemas/Customer' + AdminCustomersListRes: + 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 + AdminPostCustomersCustomerReq: + type: object + properties: + email: + type: string + description: The Customer's email. + format: email + first_name: + type: string + description: The Customer's first name. + last_name: + type: string + description: The Customer's last name. + phone: + type: string + description: The Customer's phone number. + password: + type: string + description: The Customer's password. + format: password + groups: + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a customer group + type: string + description: A list of customer groups to which the customer belongs. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + type: object + required: + - id + properties: + id: + description: The id of the item + type: string + 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 + AdminPostDiscountsDiscountDynamicCodesReq: + type: object + required: + - code + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + usage_limit: + type: number + description: Maximum times the discount can be used + default: 1 + metadata: + type: object + description: An optional set of key-value pairs to hold additional information. + AdminDeleteDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + type: object + required: + - id + properties: + id: + description: The id of the item + type: string + AdminDiscountsRes: + type: object + properties: + discount: + $ref: '#/components/schemas/Discount' + AdminDiscountConditionsRes: + type: object + properties: + discount_condition: + $ref: '#/components/schemas/DiscountCondition' + AdminDiscountsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Discount + object: + type: string + description: The type of the object that was deleted. + default: discount + deleted: + type: boolean + description: Whether the discount was deleted successfully or not. + default: true + AdminDiscountConditionsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted DiscountCondition + object: + type: string + description: The type of the object that was deleted. + default: discount-condition + deleted: + type: boolean + description: Whether the discount condition was deleted successfully or not. + default: true + discount: + description: The Discount to which the condition used to belong + $ref: '#/components/schemas/Discount' + AdminDiscountsListRes: + type: object + properties: + discounts: + type: array + items: + $ref: '#/components/schemas/Discount' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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 + AdminPostDraftOrdersDraftOrderRegisterPaymentRes: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + AdminDraftOrdersRes: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + AdminDraftOrdersDeleteRes: + 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 + AdminDraftOrdersListRes: + 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 + 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 + AdminGiftCardsRes: + type: object + properties: + gift_card: + $ref: '#/components/schemas/GiftCard' + AdminGiftCardsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Gift Card + object: + type: string + description: The type of the object that was deleted. + default: gift-card + deleted: + type: boolean + description: Whether the gift card was deleted successfully or not. + default: true + AdminGiftCardsListRes: + type: object + properties: + gift_cards: + type: array + items: + $ref: '#/components/schemas/GiftCard' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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 + AdminPostInventoryItemsItemLocationLevelsReq: + type: object + required: + - location_id + - stocked_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: >- + the incoming stock quantity of an inventory item at the given + location ID + type: number + AdminInventoryItemsRes: + type: object + properties: + inventory_item: + $ref: '#/components/schemas/InventoryItemDTO' + AdminInventoryItemsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Inventory Item. + object: + type: string + description: The type of the object that was deleted. + format: inventory_item + deleted: + type: boolean + description: Whether or not the Inventory Item was deleted. + default: true + AdminInventoryItemsListRes: + type: object + properties: + inventory_items: + type: array + items: + $ref: '#/components/schemas/InventoryItemDTO' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsListWithVariantsAndLocationLevelsRes: + type: object + properties: + inventory_items: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryItemDTO' + - type: object + properties: + location_levels: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryLevelDTO' + variants: + type: array + items: + allOf: + - $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsLocationLevelsRes: + type: object + properties: + id: + description: The id of the location + location_levels: + description: List of stock levels at a given location + type: array + items: + $ref: '#/components/schemas/InventoryLevelDTO' + AdminPostInventoryItemsInventoryItemReq: + type: object + properties: + hs_code: + description: >- + The Harmonized System code of the Inventory Item. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + origin_country: + description: >- + The country in which the Inventory Item was produced. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Inventory Item. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + type: string + material: + description: >- + The material and composition that the Inventory Item is made of, May + be used by Fulfillment Providers to pass customs information to + shipping carriers. + type: string + weight: + description: >- + The weight of the Inventory Item. May be used in shipping rate + calculations. + type: number + height: + description: >- + The height of the Inventory Item. May be used in shipping rate + calculations. + type: number + width: + description: >- + The width of the Inventory Item. May be used in shipping rate + calculations. + type: number + length: + description: >- + The length of the Inventory Item. May be used in shipping rate + calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + AdminPostInventoryItemsItemLocationLevelsLevelReq: + type: object + properties: + stocked_quantity: + description: >- + the total stock quantity of an inventory item at the given location + ID + type: number + incoming_quantity: + description: >- + the incoming stock quantity of an inventory item at the given + location ID + type: number + 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 + AdminInviteDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Invite. + object: + type: string + description: The type of the object that was deleted. + default: invite + deleted: + type: boolean + description: Whether or not the Invite was deleted. + default: true + AdminListInvitesRes: + type: object + properties: + invites: + type: array + items: + $ref: '#/components/schemas/Invite' + 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. + AdminNotesRes: + type: object + properties: + note: + $ref: '#/components/schemas/Note' + AdminNotesDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Note. + object: + type: string + description: The type of the object that was deleted. + default: note + deleted: + type: boolean + description: Whether or not the Note was deleted. + default: true + AdminNotesListRes: + type: object + properties: + notes: + type: array + items: + $ref: '#/components/schemas/Note' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPostNotesNoteReq: + type: object + required: + - value + properties: + value: + type: string + description: The updated description of the Note. + AdminNotificationsListRes: + type: object + properties: + notifications: + type: array + items: + $ref: '#/components/schemas/Notification' + AdminNotificationsRes: + type: object + properties: + notification: + $ref: '#/components/schemas/Notification' + 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 + AdminOrderEditsRes: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + AdminOrderEditsListRes: + type: object + properties: + order_edits: + type: array + items: + $ref: '#/components/schemas/OrderEdit' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminOrderEditDeleteRes: + 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. + default: order_edit + deleted: + type: boolean + description: Whether or not the Order Edit was deleted. + default: true + AdminOrderEditItemChangeDeleteRes: + 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. + default: item_change + deleted: + type: boolean + description: Whether or not the Order Edit Item Change was deleted. + default: true + 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 + AdminPostOrdersOrderShippingMethodsReq: + type: object + required: + - price + - option_id + properties: + price: + type: number + description: >- + The price (excluding VAT) that should be charged for the Shipping + Method + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + date: + type: object + description: >- + The data required for the Shipping Option to create a Shipping + Method. This will depend on the Fulfillment Provider. + AdminPostOrdersOrderClaimsClaimShipmentsReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + AdminPostOrdersOrderClaimsReq: + type: object + required: + - type + - claim_items + properties: + type: + description: >- + The type of the Claim. This will determine how the Claim is treated: + `replace` Claims will result in a Fulfillment with new items being + created, while a `refund` Claim will refund the amount paid for the + claimed items. + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: A list of image URL's that will be associated with the Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the items are to + be sent back. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: >- + The new items to send to the Customer when the Claim type is + Replace. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + type: object + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + data: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + shipping_address: + 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: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminOrdersOrderLineItemReservationReq: + type: object + required: + - location_id + properties: + location_id: + description: The id of the location of the reservation + type: string + quantity: + description: The quantity to reserve + type: number + 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: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: >- + The custom shipping options to potentially create a Shipping Method + from. + type: array + items: + type: object + required: + - option_id + - price + properties: + option_id: + description: The ID of the Shipping Option to override with a custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + allow_backorder: + description: 'If true, swaps can be completed with items out of stock' + type: boolean + default: true + 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 + AdminOrdersRes: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + AdminOrdersListRes: + type: object + properties: + orders: + type: array + items: + $ref: '#/components/schemas/Order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: The Shipping Method to be used to handle the return shipment. + type: object + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + type: string + receive_now: + description: >- + A flag to indicate if the Return should be registerd as received + immediately. + type: boolean + default: false + no_notification: + description: >- + A flag to indicate if no notifications should be emitted related to + the requested Return. + type: boolean + refund: + description: The amount to refund. + type: integer + AdminPostOrdersOrderClaimsClaimReq: + type: object + properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + type: object + required: + - id + - images + - tags + properties: + id: + description: The ID of the Claim Item. + type: string + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: A list of image URL's that will be associated with the Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + type: object + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + data: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + 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 + AdminPaymentCollectionsRes: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + AdminPaymentCollectionDeleteRes: + 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. + default: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true + 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 + AdminPaymentRes: + type: object + properties: + payment: + $ref: '#/components/schemas/Payment' + AdminRefundRes: + type: object + properties: + refund: + $ref: '#/components/schemas/Refund' + AdminPostPaymentRefundsReq: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + AdminPostPriceListPricesPricesReq: + type: object + properties: + prices: + description: The prices to update or add. + type: array + items: + type: object + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: + description: >- + If true the prices will replace all existing prices associated with + the Price List. + type: boolean + AdminPostPriceListsPriceListReq: + type: object + required: + - name + - description + - type + - prices + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + type: object + required: + - amount + - variant_id + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + type: object + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminDeletePriceListPricesPricesReq: + type: object + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string + AdminPriceListRes: + type: object + properties: + price_list: + $ref: '#/components/schemas/PriceList' + AdminPriceListDeleteBatchRes: + type: object + properties: + ids: + type: array + items: + type: string + description: The IDs of the deleted Money Amounts (Prices). + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListDeleteProductPricesRes: + type: object + properties: + ids: + type: array + description: The price ids that have been deleted. + items: + type: string + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListDeleteVariantPricesRes: + type: object + properties: + ids: + type: array + description: The price ids that have been deleted. + items: + type: string + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Price List. + object: + type: string + description: The type of the object that was deleted. + default: price-list + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListsListRes: + type: object + properties: + price_lists: + type: array + items: + $ref: '#/components/schemas/PriceList' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPriceListsProductsListRes: + type: object + properties: + products: + type: array + items: + $ref: '#/components/schemas/Product' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPostPriceListsPriceListPriceListReq: + type: object + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + type: object + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currecny_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + type: object + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminPostProductCategoriesCategoryProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to add to the Product Category + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the product + AdminPostProductCategoriesReq: + type: object + required: + - name + properties: + name: + type: string + description: The name to identify the Product Category by. + handle: + type: string + description: >- + An optional handle to be used in slugs, if none is provided we will + kebab-case the title. + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + parent_category_id: + type: string + description: The ID of the parent product category + AdminDeleteProductCategoriesCategoryProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to delete from the Product Category. + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a product + type: string + AdminProductCategoriesCategoryRes: + type: object + properties: + product_category: + $ref: '#/components/schemas/ProductCategory' + AdminProductCategoriesCategoryDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted product category + object: + type: string + description: The type of the object that was deleted. + default: product-category + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminProductCategoriesListRes: + type: object + properties: + product_categories: + type: array + items: + $ref: '#/components/schemas/ProductCategory' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPostProductCategoriesCategoryReq: + type: object + properties: + name: + type: string + description: The name to identify the Product Category by. + handle: + type: string + description: A handle to be used in slugs. + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + parent_category_id: + type: string + description: The ID of the parent product category + AdminProductTagsListRes: + type: object + properties: + product_tags: + type: array + items: + $ref: '#/components/schemas/ProductTag' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductTypesListRes: + type: object + properties: + product_types: + type: array + items: + $ref: '#/components/schemas/ProductType' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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: + type: object + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string + options: + description: >- + The Options that the Product should have. These define on which + properties the Product's Product Variants will differ. + type: array + items: + type: object + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + type: object + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - value + properties: + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsProductVariantsReq: + type: object + required: + - title + - prices + - options + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + default: true + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + AdminProductsDeleteOptionRes: + type: object + properties: + option_id: + type: string + description: The ID of the deleted Product Option + object: + type: string + description: The type of the object that was deleted. + default: option + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + product: + $ref: '#/components/schemas/Product' + AdminProductsDeleteVariantRes: + type: object + properties: + variant_id: + type: string + description: The ID of the deleted Product Variant. + object: + type: string + description: The type of the object that was deleted. + default: product-variant + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + product: + $ref: '#/components/schemas/Product' + AdminProductsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Product. + object: + type: string + description: The type of the object that was deleted. + default: product + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminProductsListRes: + type: object + properties: + products: + type: array + items: + oneOf: + - $ref: '#/components/schemas/Product' + - $ref: '#/components/schemas/PricedProduct' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductsListVariantsRes: + type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductsListTypesRes: + type: object + properties: + types: + type: array + items: + $ref: '#/components/schemas/ProductType' + AdminProductsListTagsRes: + type: object + properties: + tags: + type: array + items: + type: object + properties: + id: + description: The ID of the tag. + type: string + usage_count: + description: The number of products that use this tag. + type: string + value: + description: The value of the tag. + type: string + AdminProductsRes: + type: object + properties: + product: + $ref: '#/components/schemas/Product' + 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: + type: object + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: 'The value of the Tag, these will be upserted.' + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + type: object + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: >- + Whether the Product Variant can be purchased when out of + stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this + Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: >- + An optional set of key-value pairs with additional + information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. Only required if region_id is not + provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: >- + The value to give for the Product Option at the same + index in the Product's `options` field. + type: string + weight: + description: The wieght of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsProductVariantsVariantReq: + type: object + required: + - prices + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: >- + Whether Medusa should keep track of the inventory for this Product + Variant. + type: boolean + weight: + description: The weight of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: >- + The ID of the Region for which the price is used. Only + required if currency_code is not provided. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price will be + used. Only required if region_id is not provided. + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + 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 + AdminPublishableApiKeysRes: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/PublishableApiKey' + AdminPublishableApiKeysListRes: + type: object + properties: + publishable_api_keys: + type: array + items: + $ref: '#/components/schemas/PublishableApiKey' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPublishableApiKeyDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted PublishableApiKey. + object: + type: string + description: The type of the object that was deleted. + default: publishable_api_key + deleted: + type: boolean + description: Whether the PublishableApiKeys was deleted. + default: true + AdminPublishableApiKeysListSalesChannelsRes: + type: object + properties: + sales_channels: + type: array + items: + $ref: '#/components/schemas/SalesChannel' + 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 + AdminRegionsRes: + type: object + properties: + region: + $ref: '#/components/schemas/Region' + AdminRegionsListRes: + type: object + properties: + regions: + type: array + items: + $ref: '#/components/schemas/Region' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminRegionsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Region. + object: + type: string + description: The type of the object that was deleted. + default: region + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminGetRegionsRegionFulfillmentOptionsRes: + type: object + properties: + fulfillment_options: + type: array + items: + type: object + properties: + provider_id: + type: string + description: ID of the fulfillment provider + options: + type: array + description: fulfillment provider options + example: + - id: manual-fulfillment + - id: manual-fulfillment-return + is_return: true + 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 + AdminPostReservationsReq: + type: object + required: + - reservation + properties: + reservation: + $ref: '#/components/schemas/ReservationItemDTO' + AdminGetReservationReservationsReq: + type: object + properties: + reservations: + type: array + items: + $ref: '#/components/schemas/ReservationItemDTO' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPostReservationsReservationReq: + type: object + properties: + location_id: + description: The id of the location of the reservation + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + description: An optional set of key-value pairs with additional information. + type: object + 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 + AdminReturnReasonsRes: + type: object + properties: + return_reason: + $ref: '#/components/schemas/ReturnReason' + AdminReturnReasonsListRes: + type: object + properties: + return_reasons: + type: array + items: + $ref: '#/components/schemas/ReturnReason' + AdminReturnReasonsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted return reason + object: + type: string + description: The type of the object that was deleted. + default: return_reason + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + 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 + AdminReturnsCancelRes: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + AdminReturnsListRes: + type: object + properties: + returns: + type: array + items: + $ref: '#/components/schemas/Return' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminReturnsRes: + type: object + properties: + return: + $ref: '#/components/schemas/Return' + AdminPostReturnsReturnReceiveReq: + type: object + required: + - items + properties: + items: + description: The Line Items that have been received. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number + AdminPostSalesChannelsChannelProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to add to the Sales Channel + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the product + AdminPostSalesChannelsChannelStockLocationsReq: + type: object + required: + - location_id + properties: + location_id: + description: The ID of the stock location + type: string + AdminPostSalesChannelsReq: + type: object + required: + - name + properties: + name: + description: The name of the Sales Channel + type: string + description: + description: The description of the Sales Channel + type: string + is_disabled: + description: Whether the Sales Channel is disabled or not. + type: boolean + 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 + AdminSalesChannelsRes: + type: object + properties: + sales_channel: + $ref: '#/components/schemas/SalesChannel' + AdminSalesChannelsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted sales channel + object: + type: string + description: The type of the object that was deleted. + default: sales-channel + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminSalesChannelsDeleteLocationRes: + type: object + properties: + id: + type: string + description: The ID of the removed stock location from a sales channel + object: + type: string + description: The type of the object that was removed. + default: stock-location + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminSalesChannelsListRes: + type: object + properties: + sales_channels: + type: array + items: + $ref: '#/components/schemas/SalesChannel' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminDeleteSalesChannelsChannelStockLocationsReq: + type: object + required: + - location_id + properties: + location_id: + description: The ID of the stock location + 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. + AdminPostShippingOptionsReq: + type: object + required: + - name + - region_id + - provider_id + - data + - price_type + properties: + name: + description: The name of the Shipping Option + type: string + region_id: + description: The ID of the Region in which the Shipping Option will be available. + type: string + provider_id: + description: The ID of the Fulfillment Provider that handles the Shipping Option. + type: string + profile_id: + description: The ID of the Shipping Profile to add the Shipping Option to. + type: number + data: + description: >- + The data needed for the Fulfillment Provider to handle shipping with + this Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. + type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: >- + The requirements that must be satisfied for the Shipping Option to + be available. + type: array + items: + type: object + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean + default: false + metadata: + description: An optional set of key-value pairs with additional information. + type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminShippingOptionsListRes: + type: object + properties: + shipping_options: + type: array + items: + $ref: '#/components/schemas/ShippingOption' + count: + type: integer + description: The total number of items available + AdminShippingOptionsRes: + type: object + properties: + shipping_option: + $ref: '#/components/schemas/ShippingOption' + AdminShippingOptionsDeleteRes: + 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 + AdminPostShippingOptionsOptionReq: + type: object + required: + - requirements + properties: + name: + description: The name of the Shipping Option + type: string + amount: + description: The amount to charge for the Shipping Option. + type: integer + admin_only: + description: 'If true, the option can be used for draft orders' + type: boolean + metadata: + description: An optional set of key-value pairs with additional information. + type: object + requirements: + description: >- + The requirements that must be satisfied for the Shipping Option to + be available. + type: array + items: + type: object + required: + - type + - amount + properties: + id: + description: The ID of the requirement + type: string + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminPostShippingProfilesReq: + type: object + required: + - name + - type + properties: + name: + description: The name of the Shipping Profile + type: string + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom + AdminDeleteShippingProfileRes: + 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 + AdminShippingProfilesRes: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + AdminShippingProfilesListRes: + type: object + properties: + shipping_profiles: + type: array + items: + $ref: '#/components/schemas/ShippingProfile' + AdminPostShippingProfilesProfileReq: + type: object + properties: + name: + description: The name of the Shipping Profile + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom + products: + description: >- + An optional array of product ids to associate with the Shipping + Profile + type: array + shipping_options: + description: >- + An optional array of shipping option ids to associate with the + Shipping Profile + type: array + AdminPostStockLocationsReq: + type: object + required: + - name + properties: + name: + description: the name of the stock location + type: string + address_id: + description: the stock location address ID + type: string + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + address: + $ref: '#/components/schemas/StockLocationAddressInput' + AdminStockLocationsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + default: stock_location + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminStockLocationsRes: + type: object + properties: + stock_location: + $ref: '#/components/schemas/StockLocationDTO' + AdminStockLocationsListRes: + type: object + properties: + stock_locations: + type: array + items: + $ref: '#/components/schemas/StockLocationDTO' + 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 + AdminPostStockLocationsLocationReq: + type: object + properties: + name: + description: the name of the stock location + type: string + address_id: + description: the stock location address ID + type: string + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + address: + $ref: '#/components/schemas/StockLocationAddressInput' + AdminStoresRes: + type: object + properties: + store: + $ref: '#/components/schemas/Store' + AdminTaxProvidersList: + type: object + properties: + tax_providers: + type: array + items: + $ref: '#/components/schemas/TaxProvider' + AdminPaymentProvidersList: + type: object + properties: + payment_providers: + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + 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 + AdminSwapsListRes: + type: object + properties: + swaps: + type: array + items: + $ref: '#/components/schemas/Swap' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminSwapsRes: + type: object + properties: + swap: + $ref: '#/components/schemas/Swap' + 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 + AdminTaxRatesDeleteRes: + 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: tax-rate + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminTaxRatesListRes: + type: object + properties: + tax_rates: + type: array + items: + $ref: '#/components/schemas/TaxRate' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminTaxRatesRes: + type: object + properties: + tax_rate: + $ref: '#/components/schemas/TaxRate' + 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 + AdminUploadsRes: + type: object + properties: + uploads: + type: array + items: + type: object + properties: + url: + type: string + description: The URL of the uploaded file. + format: uri + AdminDeleteUploadsRes: + type: object + properties: + id: + type: string + description: The file key of the upload deleted + object: + type: string + description: The type of the object that was deleted. + default: file + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminUploadsDownloadUrlRes: + type: object + properties: + download_url: + type: string + description: The Download URL of the file + 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 + AdminUserRes: + type: object + properties: + user: + $ref: '#/components/schemas/User' + AdminUsersListRes: + type: object + properties: + users: + type: array + items: + $ref: '#/components/schemas/User' + AdminDeleteUserRes: + type: object + properties: + id: + type: string + description: The ID of the deleted user. + object: + type: string + description: The type of the object that was deleted. + default: user + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + 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 + AdminGetVariantsVariantInventoryRes: + type: object + properties: + id: + description: the id of the variant + type: string + inventory: + description: the stock location address ID + type: string + sales_channel_availability: + type: object + description: An optional key-value map with additional details + properties: + channel_name: + description: Sales channel name + type: string + channel_id: + description: Sales channel id + type: string + available_quantity: + description: Available quantity in sales channel + type: number + AdminVariantsListRes: + type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml new file mode 100644 index 0000000000..e9e89a984d --- /dev/null +++ b/docs/api/admin-spec3.yaml @@ -0,0 +1,29010 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Medusa Admin API + description: | + API reference for Medusa's Admin endpoints. All endpoints are prefixed with `/admin`. + + ## Authentication + + There are two ways to send authenticated requests to the Medusa server: Using a user's API token, or using a Cookie Session ID. + + + + ## Expanding Fields + + In many endpoints you'll find an `expand` query parameter that can be passed to the endpoint. You can use the `expand` query parameter to unpack an entity's relations and return them in the response. + + For example, when you list customers you can also retrieve their groups by passing to the `expand` query parameter the value `groups`. + + You can expand more than one relation by separating the relations in the `expand` query parameter with a comma. For example, to retrieve both the orders and the groups of a customer, pass to the `expand` query parameter the value `groups,orders`. + + Please note that the parameters you pass to `expand` replace any relations that are expanded by default. + + ## Selecting Fields + + In many endpoints you'll find a `fields` query parameter that can be passed to the endpoint. You can use the `fields` query parameter to specify which fields in the entity should be returned in the response. + + You can pass more than one field by seperating the field names in the `fields` query parameter with a comma. + + Only the fields you pass to `field` will be retrieved and returned in the response. Any fields that are returned by default will not be returned in this case. This does not affect relations. + + For example, to only select the `title` and `description` fields of a product, pass to the `fields` query parameter the value `title,description`. + + ## Pagination + + ### Query Parameters + + In listing endpoints, such as list customers or list products, you can control the pagination using the query parameters `limit` and `offset`. + + `limit` is used to specify the maximum number of items that can be return in the response. `offset` is used to specify how many items to skip before returning the resulting entities. + + You can use the `offset` query parameter to change between pages. For example, if the limit is 50, at page 1 the offset should be 0; at page 2 the offset should be 50, and so on. + + ### Response Fields + + In listing fields, aside from the entities retrieved, there are three pagination-related fields returned: `count`, `limit`, and `offset`. + + Similarly to the query parameters, `limit` is the maximum number of items that can be returned in the response, and `field` is the number of items that were skipped before the entities in the result. + + `count` is the total number of available items of this entity. It can be used to determine how many pages are there. + + For example, if the `count` is 100 and the `limit` is 50, you can divide the `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. + license: + name: MIT + url: https://github.com/medusajs/medusa/blob/master/LICENSE +tags: + - name: Auth + description: Auth endpoints that allow authorization of admin Users and manages their sessions. + - name: App + description: App endpoints that allow handling apps in Medusa. + - name: Batch Job + description: Batch Job endpoints that allow handling batch jobs in Medusa. + - name: Claim + description: Claim endpoints that allow handling claims in Medusa. + - name: Collection + description: Collection endpoints that allow handling collections in Medusa. + - name: Customer + description: Customer endpoints that allow handling customers in Medusa. + - name: Customer Group + description: Customer Group endpoints that allow handling customer groups in Medusa. + - name: Discount + description: Discount endpoints that allow handling discounts in Medusa. + - name: Discount Condition + description: Discount Condition endpoints that allow handling discount conditions in Medusa. + - name: Draft Order + description: Draft Order endpoints that allow handling draft orders in Medusa. + - name: Gift Card + description: Gift Card endpoints that allow handling gift cards in Medusa. + - name: Invite + description: Invite endpoints that allow handling invites in Medusa. + - name: Note + description: Note endpoints that allow handling notes in Medusa. + - name: Notification + description: Notification endpoints that allow handling notifications in Medusa. + - name: Order + description: Order endpoints that allow handling orders in Medusa. + - name: Price List + description: Price List endpoints that allow handling price lists in Medusa. + - name: Product + description: Product endpoints that allow handling products in Medusa. + - name: Product Tag + description: Product Tag endpoints that allow handling product tags in Medusa. + - name: Product Type + description: Product Types endpoints that allow handling product types in Medusa. + - name: Product Variant + description: Product Variant endpoints that allow handling product variants in Medusa. + - name: Region + description: Region endpoints that allow handling regions in Medusa. + - name: Return Reason + description: Return Reason endpoints that allow handling return reasons in Medusa. + - name: Return + description: Return endpoints that allow handling returns in Medusa. + - name: Sales Channel + description: Sales Channel endpoints that allow handling sales channels in Medusa. + - name: Shipping Option + description: Shipping Option endpoints that allow handling shipping options in Medusa. + - name: Shipping Profile + description: Shipping Profile endpoints that allow handling shipping profiles in Medusa. + - name: Store + description: Store endpoints that allow handling stores in Medusa. + - name: Swap + description: Swap endpoints that allow handling swaps in Medusa. + - name: Tax Rate + description: Tax Rate endpoints that allow handling tax rates in Medusa. + - name: Upload + description: Upload endpoints that allow handling uploads in Medusa. + - name: User + description: User endpoints that allow handling users in Medusa. +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-codegen: + method: authorize + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/apps/authorizations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "application_name": "example", + "state": "ready", + "code": "token" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAppsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /apps: + get: + operationId: GetApps + summary: List Applications + description: Retrieve a list of applications. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/apps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - App + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAppsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /auth: + post: + operationId: PostAuth + summary: User Login + x-authenticated: false + description: Logs a User in and authorizes them to manage Store settings. + parameters: [] + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - password + properties: + email: + type: string + description: The User's email. + password: + type: string + description: The User's password. + x-codegen: + method: createSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.admin.auth.createSession({ + email: 'user@example.com', + password: 'supersecret' + }).then((({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/incorrect_credentials' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteAuth + summary: User Logout + x-authenticated: true + description: Deletes the current session for the logged in user. + x-codegen: + method: deleteSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.auth.deleteSession() + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/auth' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetAuth + summary: Get Current User + x-authenticated: true + description: Gets the currently logged in User. + x-codegen: + method: getSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.auth.getSession() + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/auth' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /batch-jobs/{id}/cancel: + post: + operationId: PostBatchJobsBatchJobCancel + summary: Cancel a Batch Job + description: Marks a batch job as canceled + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the batch job. + schema: + type: string + x-codegen: + method: cancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.cancel(batch_job_id) + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /batch-jobs/{id}/confirm: + post: + operationId: PostBatchJobsBatchJobConfirmProcessing + summary: Confirm a Batch Job + description: Confirms that a previously requested batch job should be executed. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the batch job. + schema: + type: string + x-codegen: + method: confirm + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.confirm(batch_job_id) + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /batch-jobs: + post: + operationId: PostBatchJobs + summary: Create a Batch Job + description: Creates a Batch Job. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostBatchesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.create({ + type: 'product-export', + context: {}, + dry_run: false + }).then((({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/batch-jobs' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer {api_token}' \ + --data-raw '{ + "type": "product-export", + "context": { } + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '201': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetBatchJobs + summary: List Batch Jobs + description: Retrieve a list of Batch Jobs. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of batch jobs to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of batch jobs to skip before results. + schema: + type: integer + default: 0 + - in: query + name: id + style: form + explode: false + description: Filter by the batch ID + schema: + oneOf: + - type: string + description: batch job ID + - type: array + description: multiple batch job IDs + items: + type: string + - in: query + name: type + style: form + explode: false + description: Filter by the batch type + schema: + type: array + items: + type: string + - in: query + name: confirmed_at + style: form + explode: false + description: Date comparison for when resulting collections was confirmed, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: pre_processed_at + style: form + explode: false + description: Date comparison for when resulting collections was pre processed, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: completed_at + style: form + explode: false + description: Date comparison for when resulting collections was completed, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: failed_at + style: form + explode: false + description: Date comparison for when resulting collections was failed, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: canceled_at + style: form + explode: false + description: Date comparison for when resulting collections was canceled, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: order + description: Field used to order retrieved batch jobs + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each order of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each order of the result. + schema: + type: string + - in: query + name: created_at + style: form + explode: false + description: Date comparison for when resulting collections was created, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + style: form + explode: false + description: Date comparison for when resulting collections was updated, i.e. less than, greater than etc. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.list() + .then(({ batch_jobs, limit, offset, count }) => { + console.log(batch_jobs.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/batch-jobs' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /batch-jobs/{id}: + get: + operationId: GetBatchJobsBatchJob + summary: Get a Batch Job + description: Retrieves a Batch Job. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Batch Job + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.batchJobs.retrieve(batch_job_id) + .then(({ batch_job }) => { + console.log(batch_job.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/batch-jobs/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminBatchJobRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /collections/{id}/products/batch: + post: + operationId: PostProductsToCollection + summary: Update Products + description: Updates products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsToCollectionReq' + x-codegen: + method: addProducts + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductsFromCollection + summary: Remove Product + description: Removes products associated with a Product Collection + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteProductsFromCollectionReq' + x-codegen: + method: removeProducts + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteProductsFromCollectionRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.create({ + title: 'New Collection' + }) + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/collections' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of collections to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of collections to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: title + description: The title of collections to return. + schema: + type: string + - in: query + name: handle + description: The handle of collections to return. + schema: + type: string + - in: query + name: q + description: a search term to search titles and handles. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product collections. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.list() + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/collections' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.delete(collection_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Collection + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.retrieve(collection_id) + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/collections/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCollectionsCollection + summary: Update a Collection + description: Updates a Product Collection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCollectionsCollectionReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.collections.update(collection_id, { + title: 'New Collection' + }) + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/collections/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "New Collection" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /currencies: + get: + operationId: GetCurrencies + summary: List Currency + description: Retrieves a list of Currency + x-authenticated: true + parameters: + - in: query + name: code + description: Code of the currency to search for. + schema: + type: string + - in: query + name: includes_tax + description: Search for tax inclusive currencies. + schema: + type: boolean + - in: query + name: order + description: order to retrieve products in. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: number + default: '20' + x-codegen: + method: list + queryParams: AdminGetCurrenciesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.currencies.list() + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/currencies' \ + --header 'Authorization: Bearer {api_token}' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCurrenciesListRes' + /currencies/{code}: + post: + operationId: PostCurrenciesCurrency + summary: Update a Currency + description: Update a Currency + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Currency. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCurrenciesCurrencyReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.currencies.update(code, { + includes_tax: true + }) + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/currencies/{code}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "includes_tax": true + }' + tags: + - Currency + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCurrenciesRes' + /customer-groups/{id}/customers/batch: + post: + operationId: PostCustomerGroupsGroupCustomersBatch + summary: Add Customers + description: Adds a list of customers, represented by id's, to a customer group. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq' + x-codegen: + method: addCustomers + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.addCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: Remove Customers + description: Removes a list of customers, represented by id's, from a customer group. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq' + x-codegen: + method: removeCustomers + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.removeCustomers(customer_group_id, { + customer_ids: [ + { + id: customer_id + } + ] + }) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "customer_ids": [ + { + "id": "cus_01G2Q4BS9GAHDBMDEN4ZQZCJB2" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customer-groups: + post: + operationId: PostCustomerGroups + summary: Create a Customer Group + description: Creates a CustomerGroup. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.create({ + name: 'VIP' + }) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customer-groups' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCustomerGroups + summary: List Customer Groups + description: Retrieve a list of customer groups. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching customer group names. + schema: + type: string + - in: query + name: offset + description: How many groups to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: order + description: the field used to order the customer groups. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by the customer group ID + schema: + oneOf: + - type: string + description: customer group ID + - type: array + description: multiple customer group IDs + items: + type: string + - type: object + properties: + lt: + type: string + description: filter by IDs less than this ID + gt: + type: string + description: filter by IDs greater than this ID + lte: + type: string + description: filter by IDs less than or equal to this ID + gte: + type: string + description: filter by IDs greater than or equal to this ID + - in: query + name: name + style: form + explode: false + description: Filter by the customer group name + schema: + type: array + description: multiple customer group names + items: + type: string + description: customer group name + - in: query + name: created_at + description: Date comparison for when resulting customer groups were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting customer groups were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: limit + description: Limit the number of customer groups returned. + schema: + type: integer + default: 10 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer groups of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetCustomerGroupsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.list() + .then(({ customer_groups, limit, offset, count }) => { + console.log(customer_groups.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customer-groups' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.delete(customer_group_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCustomerGroupsGroup + summary: Get a Customer Group + description: Retrieves a Customer Group. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer Group. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the customer group. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the customer group. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetCustomerGroupsGroupParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.retrieve(customer_group_id) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomerGroupsGroup + summary: Update a Customer Group + description: Update a CustomerGroup. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsGroupReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.update(customer_group_id, { + name: 'VIP' + }) + .then(({ customer_group }) => { + console.log(customer_group.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "VIP" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomerGroupsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customer-groups/{id}/customers: + get: + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of customers in a customer group + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the customer group. + schema: + type: string + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: a search term to search email, first_name, and last_name. + schema: + type: string + x-codegen: + method: listCustomers + queryParams: AdminGetGroupsGroupCustomersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customerGroups.listCustomers(customer_group_id) + .then(({ customers }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer Group + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers: + post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomersReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customers.create({ + email: 'user@example.com', + first_name: 'Caterina', + last_name: 'Yost', + password: 'supersecret' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customers' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "first_name": "Caterina", + "last_name": "Yost", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '201': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetCustomers + summary: List Customers + description: Retrieves a list of Customers. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: a search term to search email, first_name, and last_name. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetCustomersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customers.list() + .then(({ customers, limit, offset, count }) => { + console.log(customers.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customers' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/{id}: + get: + operationId: GetCustomersCustomer + summary: Get a Customer + description: Retrieves a Customer. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the customer. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the customer. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customers.retrieve(customer_id) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/customers/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomer + summary: Update a Customer + description: Updates a Customer. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Customer. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in each customer. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomersCustomerReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.customers.update(customer_id, { + first_name: 'Dolly' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/customers/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Dolly" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts/{id}/regions/{region_id}: + post: + operationId: PostDiscountsDiscountRegionsRegion + summary: Add Region + description: Adds a Region to the list of Regions that a Discount can be used in. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: addRegion + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.addRegion(discount_id, region_id) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountRegionsRegion + summary: Remove Region + x-authenticated: true + description: Removes a Region from the list of Regions that a Discount can be used in. + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: removeRegion + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.removeRegion(discount_id, region_id) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts/{discount_id}/conditions/{condition_id}/batch: + post: + operationId: PostDiscountsDiscountConditionsConditionBatch + summary: Add Batch Resources + description: Add a batch of resources to a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which relations should be expanded in each discount of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each discount of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq' + x-codegen: + method: addConditionResourceBatch + queryParams: AdminPostDiscountsDiscountConditionsConditionBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.addConditionResourceBatch(discount_id, condition_id, { + resources: [{ id: item_id }] + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountConditionsConditionBatch + summary: Delete Batch Resources + description: Delete a batch of resources from a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which relations should be expanded in each discount of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each discount of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq' + x-codegen: + method: deleteConditionResourceBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.deleteConditionResourceBatch(discount_id, condition_id, { + resources: [{ id: item_id }] + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts/{discount_id}/conditions: + post: + operationId: PostDiscountsDiscountConditions + summary: Create a Condition + description: Creates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each product of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditions' + x-codegen: + method: createCondition + queryParams: AdminPostDiscountsDiscountConditionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + import { DiscountConditionOperator } from "@medusajs/medusa" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.createCondition(discount_id, { + operator: DiscountConditionOperator.IN + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "operator": "in" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts: + post: + operationId: PostDiscounts + summary: Creates a Discount + x-authenticated: true + description: Creates a Discount with a given set of rules that define how the Discount behaves. + parameters: + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsReq' + x-codegen: + method: create + queryParams: AdminPostDiscountsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + import { AllocationType, DiscountRuleType } from "@medusajs/medusa" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.create({ + code: 'TEST', + rule: { + type: DiscountRuleType.FIXED, + value: 10, + allocation: AllocationType.ITEM + }, + regions: ["reg_XXXXXXXX"], + is_dynamic: false, + is_disabled: false + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "code": "TEST", + "rule": { + "type": "fixed", + "value": 10, + "allocation": "item" + }, + "regions": ["reg_XXXXXXXX"] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDiscounts + summary: List Discounts + x-authenticated: true + description: Retrieves a list of Discounts + parameters: + - in: query + name: q + description: Search query applied on the code field. + schema: + type: string + - in: query + name: rule + description: Discount Rules filters to apply on the search + schema: + type: object + properties: + type: + type: string + enum: + - fixed + - percentage + - free_shipping + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. + allocation: + type: string + enum: + - total + - item + description: The value that the discount represents; this will depend on the type of the discount + - in: query + name: is_dynamic + description: Return only dynamic discounts. + schema: + type: boolean + - in: query + name: is_disabled + description: Return only disabled discounts. + schema: + type: boolean + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetDiscountsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.list() + .then(({ discounts, limit, offset, count }) => { + console.log(discounts.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts/{id}/dynamic-codes: + post: + operationId: PostDiscountsDiscountDynamicCodes + summary: Create a Dynamic Code + description: Creates a dynamic unique code that can map to a parent Discount. This is useful if you want to automatically generate codes with the same behaviour. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount to create the dynamic code from." + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountDynamicCodesReq' + x-codegen: + method: createDynamicCode + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.createDynamicCode(discount_id, { + code: 'TEST', + usage_limit: 1 + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "code": "TEST" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts/{discount_id}/conditions/{condition_id}: + delete: + operationId: DeleteDiscountsDiscountConditionsCondition + summary: Delete a Condition + description: Deletes a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Discount + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: deleteCondition + queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.deleteCondition(discount_id, condition_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountConditionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDiscountsDiscountConditionsCondition + summary: Get a Condition + description: Gets a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Discount. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: getCondition + queryParams: AdminGetDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.getCondition(discount_id, condition_id) + .then(({ discount_condition }) => { + console.log(discount_condition.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountConditionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDiscountsDiscountConditionsCondition + summary: Update a Condition + description: Updates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each item of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each item of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditionsCondition' + x-codegen: + method: updateCondition + queryParams: AdminPostDiscountsDiscountConditionsConditionParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.updateCondition(discount_id, condition_id, { + products: [ + product_id + ] + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "products": [ + "prod_01G1G5V2MBA328390B5AXJ610F" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts/{id}: + delete: + operationId: DeleteDiscountsDiscount + summary: Delete a Discount + description: Deletes a Discount. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.delete(discount_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDiscountsDiscount + summary: Get a Discount + description: Retrieves a Discount + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetDiscountParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.retrieve(discount_id) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDiscountsDiscount + summary: Update a Discount + description: Updates a Discount with a given set of rules that define how the Discount behaves. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each item of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each item of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountReq' + x-codegen: + method: update + queryParams: AdminPostDiscountsDiscountParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.update(discount_id, { + code: 'TEST' + }) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "code": "TEST" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts/{id}/dynamic-codes/{code}: + delete: + operationId: DeleteDiscountsDiscountDynamicCodesCode + summary: Delete a Dynamic Code + description: Deletes a dynamic code from a Discount. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Discount + schema: + type: string + - in: path + name: code + required: true + description: The ID of the Discount + schema: + type: string + x-codegen: + method: deleteDynamicCode + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.deleteDynamicCode(discount_id, code) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /discounts/code/{code}: + get: + operationId: GetDiscountsDiscountCode + summary: Get Discount by Code + description: Retrieves a Discount by its discount code + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The code of the Discount + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieveByCode + queryParams: AdminGetDiscountsDiscountCodeParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.discounts.retrieveByCode(code) + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts/code/{code}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDiscountsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.create({ + email: 'user@example.com', + region_id, + items: [ + { + quantity: 1 + } + ], + shipping_methods: [ + { + option_id + } + ], + }) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "region_id": "{region_id}" + "items": [ + { + "quantity": 1 + } + ], + "shipping_methods": [ + { + "option_id": "{option_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDraftOrders + summary: List Draft Orders + description: Retrieves an list of Draft Orders + x-authenticated: true + parameters: + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: number + default: '50' + - in: query + name: q + description: a search term to search emails in carts associated with draft orders and display IDs of draft orders + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetDraftOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.list() + .then(({ draft_orders, limit, offset, count }) => { + console.log(draft_orders.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/draft-orders' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /draft-orders/{id}/line-items: + post: + operationId: PostDraftOrdersDraftOrderLineItems + summary: Create a Line Item + description: Creates a Line Item for the Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq' + x-codegen: + method: addLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.addLineItem(draft_order_id, { + quantity: 1 + }) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 1 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.delete(draft_order_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetDraftOrdersDraftOrder + summary: Get a Draft Order + description: Retrieves a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.retrieve(draft_order_id) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/draft-orders/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: removeLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostDraftOrdersDraftOrderLineItemsItem + summary: Update a Line Item + description: Updates a Line Item for a Draft Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The ID of the Line Item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq' + x-codegen: + method: updateLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { + quantity: 1 + }) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 1 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /draft-orders/{id}/pay: + post: + summary: Registers a Payment + operationId: PostDraftOrdersDraftOrderRegisterPayment + description: Registers a payment for a Draft Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Draft Order id. + schema: + type: string + x-codegen: + method: markPaid + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.markPaid(draft_order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /admin/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-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.draftOrders.update(draft_order_id, { + email: "user@example.com" + }) + .then(({ draft_order }) => { + console.log(draft_order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDraftOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /gift-cards: + post: + operationId: PostGiftCards + summary: Create a Gift Card + description: Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostGiftCardsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.create({ + region_id + }) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/gift-cards' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "region_id": "{region_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetGiftCards + summary: List Gift Cards + description: Retrieves a list of Gift Cards. + x-authenticated: true + parameters: + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: number + default: '0' + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: number + default: '50' + - in: query + name: q + description: a search term to search by code or display ID + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetGiftCardsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.list() + .then(({ gift_cards, limit, offset, count }) => { + console.log(gift_cards.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/gift-cards' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /gift-cards/{id}: + delete: + operationId: DeleteGiftCardsGiftCard + summary: Delete a Gift Card + description: Deletes a Gift Card + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.delete(gift_card_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/gift-cards/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetGiftCardsGiftCard + summary: Get a Gift Card + description: Retrieves a Gift Card. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.retrieve(gift_card_id) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/gift-cards/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostGiftCardsGiftCard + summary: Update a Gift Card + description: Update a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Gift Card. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.giftCards.update(gift_card_id, { + region_id + }) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/gift-cards/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "region_id": "{region_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /inventory-items/{id}/location-levels: + post: + operationId: PostInventoryItemsInventoryItemLocationLevels + summary: Create an Inventory Location Level for a given Inventory Item. + description: Creates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsItemLocationLevelsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, { + location_id: 'sloc', + stocked_quantity: 10, + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "location_id": "sloc", + "stocked_quantity": 10 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetInventoryItemsInventoryItemLocationLevels + summary: List stock levels of a given location. + description: Lists stock levels of a given location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: offset + description: How many stock locations levels to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of stock locations levels returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.listLocationLevels(inventoryItemId) + .then(({ inventory_item }) => { + console.log(inventory_item.location_levels); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsLocationLevelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /inventory-items/{id}: + delete: + operationId: DeleteInventoryItemsInventoryItem + summary: Delete an Inventory Item + description: Delete an Inventory Item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.delete(inventoryItemId) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - InventoryItem + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetInventoryItemsInventoryItem + summary: Retrive an Inventory Item. + description: Retrives an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.retrieve(inventoryItemId) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItem + summary: Update an Inventory Item. + description: Updates an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsInventoryItemReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.update(inventoryItemId, { + origin_country: "US", + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "origin_country": "US" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /inventory-items/{id}/location-levels/{location_id}: + delete: + operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation + summary: Delete a location level of an Inventory Item. + description: Delete a location level of an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, locationId) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel + summary: Update an Inventory Location Level for a given Inventory Item. + description: Updates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.updateLocationLevel(inventoryItemId, locationId, { + stocked_quantity: 15, + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "stocked_quantity": 15 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /inventory-items: + get: + operationId: GetInventoryItems + summary: List inventory items. + description: Lists inventory items. + x-authenticated: true + parameters: + - in: query + name: offset + description: How many inventory items to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of inventory items returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + - in: query + name: q + description: Query used for searching product inventory items and their properties. + schema: + type: string + - in: query + name: location_id + style: form + explode: false + description: Locations ids to search for. + schema: + type: array + items: + type: string + - in: query + name: id + description: id to search for. + schema: + type: string + - in: query + name: sku + description: sku to search for. + schema: + type: string + - in: query + name: origin_country + description: origin_country to search for. + schema: + type: string + - in: query + name: mid_code + description: mid_code to search for. + schema: + type: string + - in: query + name: material + description: material to search for. + schema: + type: string + - in: query + name: hs_code + description: hs_code to search for. + schema: + type: string + - in: query + name: weight + description: weight to search for. + schema: + type: string + - in: query + name: length + description: length to search for. + schema: + type: string + - in: query + name: height + description: height to search for. + schema: + type: string + - in: query + name: width + description: width to search for. + schema: + type: string + - in: query + name: requires_shipping + description: requires_shipping to search for. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.list() + .then(({ inventory_items }) => { + console.log(inventory_items.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /invites/accept: + post: + operationId: PostInvitesInviteAccept + summary: Accept an Invite + description: Accepts an Invite and creates a corresponding user + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInvitesInviteAcceptReq' + x-codegen: + method: accept + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.accept({ + token, + user: { + first_name: 'Brigitte', + last_name: 'Collier', + password: 'supersecret' + } + }) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/invites/accept' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "token": "{token}", + "user": { + "first_name": "Brigitte", + "last_name": "Collier", + "password": "supersecret" + } + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /invites: + post: + operationId: PostInvites + summary: Create an Invite + description: Creates an Invite and triggers an 'invite' created event + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInvitesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.create({ + user: "user@example.com", + role: "admin" + }) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/invites' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "user": "user@example.com", + "role": "admin" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetInvites + summary: Lists Invites + description: Lists all Invites + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.list() + .then(({ invites }) => { + console.log(invites.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/invites' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminListInvitesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /invites/{invite_id}: + delete: + operationId: DeleteInvitesInvite + summary: Delete an Invite + description: Deletes an Invite + x-authenticated: true + parameters: + - in: path + name: invite_id + required: true + description: The ID of the Invite + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.delete(invite_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/invites/{invite_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInviteDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /invites/{invite_id}/resend: + post: + operationId: PostInvitesInviteResend + summary: Resend an Invite + description: Resends an Invite by triggering the 'invite' created event again + x-authenticated: true + parameters: + - in: path + name: invite_id + required: true + description: The ID of the Invite + schema: + type: string + x-codegen: + method: resend + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.invites.resend(invite_id) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/invites/{invite_id}/resend' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /notes: + post: + operationId: PostNotes + summary: Creates a Note + description: Creates a Note which can be associated with any resource as required. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotesReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.create({ + resource_id, + resource_type: 'order', + value: 'We delivered this order' + }) + .then(({ note }) => { + console.log(note.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/notes' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "resource_id": "{resource_id}", + "resource_type": "order", + "value": "We delivered this order" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetNotes + summary: List Notes + x-authenticated: true + description: Retrieves a list of notes + parameters: + - in: query + name: limit + description: The number of notes to get + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset at which to get notes + schema: + type: number + default: '0' + - in: query + name: resource_id + description: The ID which the notes belongs to + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetNotesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.list() + .then(({ notes, limit, offset, count }) => { + console.log(notes.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/notes' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /notes/{id}: + delete: + operationId: DeleteNotesNote + summary: Delete a Note + description: Deletes a Note. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Note to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.delete(note_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/notes/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetNotesNote + summary: Get a Note + description: Retrieves a single note using its id + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the note to retrieve. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.retrieve(note_id) + .then(({ note }) => { + console.log(note.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/notes/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostNotesNote + summary: Update a Note + x-authenticated: true + description: Updates a Note associated with some resource + parameters: + - in: path + name: id + required: true + description: The ID of the Note to update + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotesNoteReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notes.update(note_id, { + value: 'We delivered this order' + }) + .then(({ note }) => { + console.log(note.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/notes/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "value": "We delivered this order" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Note + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /notifications: + get: + operationId: GetNotifications + summary: List Notifications + description: Retrieves a list of Notifications. + x-authenticated: true + parameters: + - in: query + name: offset + description: The number of notifications to skip before starting to collect the notifications set + schema: + type: integer + default: 0 + - in: query + name: limit + description: The number of notifications to return + schema: + type: integer + default: 50 + - in: query + name: fields + description: Comma separated fields to include in the result set + schema: + type: string + - in: query + name: expand + description: Comma separated fields to populate + schema: + type: string + - in: query + name: event_name + description: The name of the event that the notification was sent for. + schema: + type: string + - in: query + name: resource_type + description: The type of resource that the Notification refers to. + schema: + type: string + - in: query + name: resource_id + description: The ID of the resource that the Notification refers to. + schema: + type: string + - in: query + name: to + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id + schema: + type: string + - in: query + name: include_resends + description: A boolean indicating whether the result set should include resent notifications or not + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetNotificationsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notifications.list() + .then(({ notifications }) => { + console.log(notifications.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/notifications' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notification + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotificationsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /notifications/{id}/resend: + post: + operationId: PostNotificationsNotificationResend + summary: Resend Notification + description: Resends a previously sent notifications, with the same data but optionally to a different address + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Notification + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' + x-codegen: + method: resend + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.notifications.resend(notification_id) + .then(({ notification }) => { + console.log(notification.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/notifications/{id}/resend' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Notification + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotificationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits/{id}/items: + post: + operationId: PostOrderEditsEditLineItems + summary: Add a Line Item + description: Create an OrderEdit LineItem. + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsReq' + x-authenticated: true + x-codegen: + method: addLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.addLineItem(order_edit_id, { + variant_id, + quantity + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", "quantity": 3 }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits/{id}/cancel: + post: + operationId: PostOrderEditsOrderEditCancel + summary: Cancel an OrderEdit + description: Cancels an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + x-codegen: + method: cancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.cancel(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits/{id}/confirm: + post: + operationId: PostOrderEditsOrderEditConfirm + summary: Confirms an OrderEdit + description: Confirms an OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the order edit. + schema: + type: string + x-codegen: + method: confirm + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.confirm(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.create({ order_id }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ "order_id": "my_order_id", "internal_note": "my_optional_note" }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetOrderEdits + summary: List OrderEdits + description: List OrderEdits. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching order edit internal note. + schema: + type: string + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: list + queryParams: GetOrderEditsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.list() + .then(({ order_edits, count, limit, offset }) => { + console.log(order_edits.length) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/order-edits' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: removeLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEditsEditLineItemsLineItem + summary: Upsert Line Item Change + description: Create or update the order edit change holding the line item changes + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to update. + schema: + type: string + - in: path + name: item_id + required: true + description: The ID of the order edit item to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq' + x-codegen: + method: updateLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, { + quantity: 5 + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ "quantity": 5 }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits/{id}/changes/{change_id}: + delete: + operationId: DeleteOrderEditsOrderEditItemChange + summary: Delete a Line Item Change + description: Deletes an Order Edit Item Change + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to delete. + schema: + type: string + - in: path + name: change_id + required: true + description: The ID of the Order Edit Item Change to delete. + schema: + type: string + x-codegen: + method: deleteItemChange + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.deleteItemChange(order_edit_id, item_change_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditItemChangeDeleteRes' + '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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.delete(order_edit_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditDeleteRes' + '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-codegen: + method: retrieve + queryParams: GetOrderEditsOrderEditParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.retrieve(orderEditId) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/order-edits/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrderEditsOrderEdit + summary: Update an OrderEdit + description: Updates a OrderEdit. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrderEditsOrderEditReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.update(order_edit_id, { + internal_note: "internal reason XY" + }) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "internal_note": "internal reason XY" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits/{id}/request: + post: + operationId: PostOrderEditsOrderEditRequest + summary: Request Confirmation + description: Request customer confirmation of an Order Edit + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit to request confirmation from. + schema: + type: string + x-codegen: + method: requestConfirmation + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orderEdits.requestConfirmation(order_edit_id) + .then({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/request' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/shipping-methods: + post: + operationId: PostOrdersOrderShippingMethods + summary: Add a Shipping Method + description: Adds a Shipping Method to an Order. If another Shipping Method exists with the same Shipping Profile, the previous Shipping Method will be replaced. + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderShippingMethodsReq' + x-authenticated: true + x-codegen: + method: addShippingMethod + params: AdminPostOrdersOrderShippingMethodsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.addShippingMethod(order_id, { + price: 1000, + option_id + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "price": 1000, + "option_id": "{option_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/archive: + post: + operationId: PostOrdersOrderArchive + summary: Archive Order + description: Archives the order with the given id. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: archive + params: AdminPostOrdersOrderArchiveParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.archive(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/archive' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/claims/{claim_id}/cancel: + post: + operationId: PostOrdersClaimCancel + summary: Cancel a Claim + description: Cancels a Claim + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelClaim + params: AdminPostOrdersClaimCancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelClaim(order_id, claim_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Claim + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel: + post: + operationId: PostOrdersClaimFulfillmentsCancel + summary: Cancel Claim Fulfillment + description: Registers a claim's fulfillment as canceled. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Claim relates to. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelClaimFulfillment + params: AdminPostOrdersClaimFulfillmentsCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, fulfillment_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel: + post: + operationId: PostOrdersSwapFulfillmentsCancel + summary: Cancel Swap's Fulfilmment + description: Registers a Swap's Fulfillment as canceled. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Swap relates to. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelSwapFulfillment + params: AdminPostOrdersSwapFulfillementsCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, fulfillment_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/fulfillments/{fulfillment_id}/cancel: + post: + operationId: PostOrdersOrderFulfillmentsCancel + summary: Cancels a Fulfilmment + description: Registers a Fulfillment as canceled. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order which the Fulfillment relates to. + schema: + type: string + - in: path + name: fulfillment_id + required: true + description: The ID of the Fulfillment + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelFulfillment + params: AdminPostOrdersOrderFulfillementsCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelFulfillment(order_id, fulfillment_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/cancel: + post: + operationId: PostOrdersOrderCancel + summary: Cancel an Order + description: Registers an Order as canceled. This triggers a flow that will cancel any created Fulfillments and Payments, may fail if the Payment or Fulfillment Provider is unable to cancel the Payment/Fulfillment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancel + params: AdminPostOrdersOrderCancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancel(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/swaps/{swap_id}/cancel: + post: + operationId: PostOrdersSwapCancel + summary: Cancels a Swap + description: Cancels a Swap + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: cancelSwap + params: AdminPostOrdersSwapCancelParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.cancelSwap(order_id, swap_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/capture: + post: + operationId: PostOrdersOrderCapture + summary: Capture Order's Payment + description: Captures all the Payments associated with an Order. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: capturePayment + params: AdminPostOrdersOrderCaptureParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.capturePayment(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/capture' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/complete: + post: + operationId: PostOrdersOrderComplete + summary: Complete an Order + description: Completes an Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: complete + params: AdminPostOrdersOrderCompleteParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.complete(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/complete' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/claims/{claim_id}/shipments: + post: + operationId: PostOrdersOrderClaimsClaimShipments + summary: Create Claim Shipment + description: Registers a Claim Fulfillment as shipped. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq' + x-codegen: + method: createClaimShipment + params: AdminPostOrdersOrderClaimsClaimShipmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createClaimShipment(order_id, claim_id, { + fulfillment_id + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Claim + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /order/{id}/claims: + post: + operationId: PostOrdersOrderClaims + summary: Create a Claim + description: Creates a Claim. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsReq' + x-codegen: + method: createClaim + params: AdminPostOrdersOrderClaimsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createClaim(order_id, { + type: 'refund', + claim_items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "type": "refund", + "claim_items": [ + { + "item_id": "asdsd", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Claim + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/fulfillment: + post: + operationId: PostOrdersOrderFulfillments + summary: Create a Fulfillment + description: Creates a Fulfillment of an Order - will notify Fulfillment Providers to prepare a shipment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderFulfillmentsReq' + x-codegen: + method: createFulfillment + params: AdminPostOrdersOrderFulfillmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createFulfillment(order_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "items": [ + { + "item_id": "{item_id}", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/line-items/{line_item_id}/reserve: + post: + operationId: PostOrdersOrderLineItemReservations + summary: Create a Reservation for a line item + description: Creates a Reservation for a line item at a specified location, optionally for a partial quantity. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: line_item_id + required: true + description: The ID of the Line item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersOrderLineItemReservationReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createReservation(order_id, line_item_id, { + location_id + }) + .then(({ reservation }) => { + console.log(reservation.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "location_id": "loc_1" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/shipment: + post: + operationId: PostOrdersOrderShipment + summary: Create a Shipment + description: Registers a Fulfillment as shipped. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderShipmentReq' + x-codegen: + method: createShipment + params: AdminPostOrdersOrderShipmentParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createShipment(order_id, { + fulfillment_id + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipment' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/swaps/{swap_id}/shipments: + post: + operationId: PostOrdersOrderSwapsSwapShipments + summary: Create Swap Shipment + description: Registers a Swap Fulfillment as shipped. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq' + x-codegen: + method: createSwapShipment + params: AdminPostOrdersOrderSwapsSwapShipmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createSwapShipment(order_id, swap_id, { + fulfillment_id + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "fulfillment_id": "{fulfillment_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /order/{id}/swaps: + post: + operationId: PostOrdersOrderSwaps + summary: Create a Swap + description: Creates a Swap. Swaps are used to handle Return of previously purchased goods and Fulfillment of replacements simultaneously. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded the order of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included the order of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsReq' + x-codegen: + method: createSwap + queryParams: AdminPostOrdersOrderSwapsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.createSwap(order_id, { + return_items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "return_items": [ + { + "item_id": "asfasf", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/claims/{claim_id}/fulfillments: + post: + operationId: PostOrdersOrderClaimsClaimFulfillments + summary: Create Claim Fulfillment + description: Creates a Fulfillment for a Claim. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq' + x-codegen: + method: fulfillClaim + params: AdminPostOrdersOrderClaimsClaimFulfillmentsReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.fulfillClaim(order_id, claim_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/swaps/{swap_id}/fulfillments: + post: + operationId: PostOrdersOrderSwapsSwapFulfillments + summary: Create Swap Fulfillment + description: Creates a Fulfillment for a Swap. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq' + x-codegen: + method: fulfillSwap + params: AdminPostOrdersOrderSwapsSwapFulfillmentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.fulfillSwap(order_id, swap_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Fulfillment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}: + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetOrdersOrderParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.retrieve(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/orders/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostOrdersOrder + summary: Update an Order + description: Updates and order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderReq' + x-codegen: + method: update + params: AdminPostOrdersOrderParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.update(order_id, { + email: 'user@example.com' + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/adasda' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/reservations: + get: + operationId: GetOrdersOrderReservations + summary: Get reservations for an Order + description: Retrieves reservations for an Order + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: offset + description: How many reservations to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of reservations returned. + schema: + type: integer + default: 20 + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.retrieveReservations(order_id) + .then(({ reservations }) => { + console.log(reservations[0].id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/orders/{id}/reservations' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGetReservationReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders: + get: + operationId: GetOrders + summary: List Orders + description: Retrieves a list of Orders + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching orders by shipping address first name, orders' email, and orders' display ID + schema: + type: string + - in: query + name: id + description: ID of the order to search for. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for + schema: + type: array + items: + type: string + enum: + - pending + - completed + - archived + - canceled + - requires_action + - in: query + name: fulfillment_status + style: form + explode: false + description: Fulfillment status to search for. + schema: + type: array + items: + type: string + enum: + - not_fulfilled + - fulfilled + - partially_fulfilled + - shipped + - partially_shipped + - canceled + - returned + - partially_returned + - requires_action + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + enum: + - captured + - awaiting + - not_paid + - refunded + - partially_refunded + - canceled + - requires_action + - in: query + name: display_id + description: Display ID to search for. + schema: + type: string + - in: query + name: cart_id + description: to search for. + schema: + type: string + - in: query + name: customer_id + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + style: form + explode: false + description: Regions to search orders by + schema: + oneOf: + - type: string + description: ID of a Region. + - type: array + items: + type: string + description: ID of a Region. + - in: query + name: currency_code + style: form + explode: false + description: Currency code to search for + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + - in: query + name: tax_rate + description: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting orders were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting orders were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: canceled_at + description: Date comparison for when resulting orders were canceled. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: sales_channel_id + style: form + explode: false + description: Filter by Sales Channels + schema: + type: array + items: + type: string + description: The ID of a Sales Channel + - in: query + name: offset + description: How many orders to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of orders returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each order of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each order of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.list() + .then(({ orders, limit, offset, count }) => { + console.log(orders.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/orders' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/swaps/{swap_id}/process-payment: + post: + operationId: PostOrdersOrderSwapsSwapProcessPayment + summary: Process Swap Payment + description: When there are differences between the returned and shipped Products in a Swap, the difference must be processed. Either a Refund will be issued or a Payment will be captured. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The ID of the Swap. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + x-codegen: + method: processSwapPayment + params: AdminPostOrdersOrderSwapsSwapProcessPaymentParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.processSwapPayment(order_id, swap_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/refund: + post: + operationId: PostOrdersOrderRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderRefundsReq' + x-codegen: + method: refundPayment + params: AdminPostOrdersOrderRefundsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.refundPayment(order_id, { + amount: 1000, + reason: 'Do not like it' + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/adasda/refund' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "amount": 1000, + "reason": "Do not like it" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}/return: + post: + operationId: PostOrdersOrderReturns + summary: Request a Return + description: Requests a Return. If applicable a return label will be created and other plugins notified. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderReturnsReq' + x-codegen: + method: requestReturn + params: AdminPostOrdersOrderReturnsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.requestReturn(order_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/return' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "items": [ + { + "item_id": "{item_id}", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /order/{id}/claims/{claim_id}: + post: + operationId: PostOrdersOrderClaimsClaim + summary: Update a Claim + description: Updates a Claim. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The ID of the Claim. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimReq' + x-codegen: + method: updateClaim + params: AdminPostOrdersOrderClaimsClaimParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.orders.updateClaim(order_id, claim_id, { + no_notification: true + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "no_notification": true + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Claim + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.paymentCollections.delete(payment_collection_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/payment-collections/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionDeleteRes' + '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-codegen: + method: retrieve + queryParams: GetPaymentCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@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: + $ref: '#/components/schemas/AdminPaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostPaymentCollectionsPaymentCollection + summary: Update PaymentCollection + description: Updates a PaymentCollection. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdatePaymentCollectionsReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.paymentCollections.update(payment_collection_id, { + description: "Description of payCol" + }) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "description": "Description of payCol" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payment-collections/{id}/authorize: + post: + operationId: PostPaymentCollectionsPaymentCollectionAuthorize + summary: Mark Authorized + description: Sets the status of PaymentCollection as Authorized. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + x-codegen: + method: markAsAuthorized + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.paymentCollections.markAsAuthorized(payment_collection_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payments/{id}/capture: + post: + operationId: PostPaymentsPaymentCapture + summary: Capture a Payment + description: Captures a Payment. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codegen: + method: capturePayment + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.payments.capturePayment(payment_id) + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/payments/{id}/capture' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payments/{id}: + get: + operationId: GetPaymentsPayment + summary: Get Payment details + description: Retrieves the Payment details + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + x-codegen: + method: retrieve + queryParams: GetPaymentsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.payments.retrieve(payment_id) + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/payments/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payments/{id}/refund: + post: + operationId: PostPaymentsPaymentRefunds + summary: Create a Refund + description: Issues a Refund. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Payment. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPaymentRefundsReq' + x-codegen: + method: refundPayment + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.payments.refundPayment(payment_id, { + amount: 1000, + reason: 'return', + note: 'Do not like it', + }) + .then(({ payment }) => { + console.log(payment.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/payments/pay_123/refund' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "amount": 1000, + "reason": "return", + "note": "Do not like it" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Payment + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRefundRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /price-lists/{id}/prices/batch: + post: + operationId: PostPriceListsPriceListPricesBatch + summary: Update Prices + description: Batch update prices for a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List to update prices for. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPriceListPricesPricesReq' + x-codegen: + method: addPrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.addPrices(price_list_id, { + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] + }) + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "prices": [ + { + "amount": 100, + "variant_id": "afasfa", + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeletePriceListsPriceListPricesBatch + summary: Delete Prices + description: Batch delete prices that belong to a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List that the Money Amounts (Prices) that will be deleted belongs to. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeletePriceListPricesPricesReq' + x-codegen: + method: deletePrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.deletePrices(price_list_id, { + price_ids: [ + price_id + ] + }) + .then(({ ids, object, deleted }) => { + console.log(ids.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "price_ids": [ + "adasfa" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteBatchRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /price-lists: + post: + operationId: PostPriceListsPriceList + summary: Create a Price List + description: Creates a Price List + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPriceListsPriceListReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + import { PriceListType } from "@medusajs/medusa" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.create({ + name: 'New Price List', + description: 'A new price list', + type: PriceListType.SALE, + prices: [ + { + amount: 1000, + variant_id, + currency_code: 'eur' + } + ] + }) + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/price-lists' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "New Price List", + "description": "A new price list", + "type": "sale", + "prices": [ + { + "amount": 1000, + "variant_id": "afafa", + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetPriceLists + summary: List Price Lists + description: Retrieves a list of Price Lists. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of items to get + schema: + type: number + default: '10' + - in: query + name: offset + description: The offset at which to get items + schema: + type: number + default: '0' + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each item of the result. + schema: + type: string + - in: query + name: order + description: field to order results by. + schema: + type: string + - in: query + name: id + description: ID to search for. + schema: + type: string + - in: query + name: q + description: query to search in price list description, price list name, and customer group name fields. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for. + schema: + type: array + items: + type: string + enum: + - active + - draft + - in: query + name: name + description: price list name to search for. + schema: + type: string + - in: query + name: customer_groups + style: form + explode: false + description: Customer Group IDs to search for. + schema: + type: array + items: + type: string + - in: query + name: type + style: form + explode: false + description: Type to search for. + schema: + type: array + items: + type: string + enum: + - sale + - override + - in: query + name: created_at + description: Date comparison for when resulting price lists were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting price lists were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting price lists were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetPriceListPaginationParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.list() + .then(({ price_lists, limit, offset, count }) => { + console.log(price_lists.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/price-lists' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /price-lists/{id}: + delete: + operationId: DeletePriceListsPriceList + summary: Delete a Price List + description: Deletes a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.delete(price_list_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetPriceListsPriceList + summary: Get a Price List + description: Retrieves a Price List. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.retrieve(price_list_id) + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostPriceListsPriceListPriceList + summary: Update a Price List + description: Updates a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPriceListsPriceListPriceListReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.update(price_list_id, { + name: 'New Price List' + }) + .then(({ price_list }) => { + console.log(price_list.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "New Price List" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /price-lists/{id}/products/{product_id}/prices: + delete: + operationId: DeletePriceListsPriceListProductsProductPrices + summary: Delete Product's Prices + description: Delete all the prices related to a specific product in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List that the Money Amounts that will be deleted belongs to. + schema: + type: string + - in: path + name: product_id + required: true + description: The ID of the product from which the money amount will be deleted. + schema: + type: string + x-codegen: + method: deleteProductPrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.deleteProductPrices(price_list_id, product_id) + .then(({ ids, object, deleted }) => { + console.log(ids.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteProductPricesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /price-lists/{id}/variants/{variant_id}/prices: + delete: + operationId: DeletePriceListsPriceListVariantsVariantPrices + summary: Delete Variant's Prices + description: Delete all the prices related to a specific variant in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Price List that the Money Amounts that will be deleted belongs to. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the variant from which the money amount will be deleted. + schema: + type: string + x-codegen: + method: deleteVariantPrices + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.deleteVariantPrices(price_list_id, variant_id) + .then(({ ids, object, deleted }) => { + console.log(ids); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListDeleteVariantPricesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /price-lists/{id}/products: + get: + operationId: GetPriceListsPriceListProducts + summary: List Products + description: Retrieves a list of Product that are part of a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: ID of the price list. + schema: + type: string + - in: query + name: q + description: Query used for searching product title and description, variant title and sku, and collection title. + schema: + type: string + - in: query + name: id + description: ID of the product to search for. + schema: + type: string + - in: query + name: status + description: Product status to search for + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected + - in: query + name: collection_id + description: Collection IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: tags + description: Tag IDs to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: title + description: product title to search for. + schema: + type: string + - in: query + name: description + description: product description to search for. + schema: + type: string + - in: query + name: handle + description: product handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: string + - in: query + name: type + description: to search for. + schema: + type: string + - in: query + name: order + description: field to sort results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting products were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting products were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting products were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each product of the result. + schema: + type: string + x-codegen: + method: listProducts + queryParams: AdminGetPriceListsPriceListProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.priceLists.listProducts(price_list_id) + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}/products' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPriceListsProductsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-categories/{id}/products/batch: + post: + operationId: PostProductCategoriesCategoryProductsBatch + summary: Add Products to a category + description: Assign a batch of products to a product category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Category fields to be expanded in the response. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Category fields to be retrieved in the response. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductCategoriesCategoryProductsBatchReq' + x-codegen: + method: addProducts + queryParams: AdminPostProductCategoriesCategoryProductsBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.addProducts(product_category_id, { + product_ids: [ + { + id: product_id + } + ] + }) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location \ + --request POST 'https://medusa-url.com/admin/product-categories/{product_category_id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteProductCategoriesCategoryProductsBatch + summary: Delete Products + description: Remove a list of products from a product category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Category fields to be expanded in the response. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Category fields to be retrieved in the response. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteProductCategoriesCategoryProductsBatchReq' + x-codegen: + method: removeProducts + queryParams: AdminDeleteProductCategoriesCategoryProductsBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.removeProducts(product_category_id, { + product_ids: [ + { + id: product_id + } + ] + }) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-categories: + post: + operationId: PostProductCategories + summary: Create a Product Category + description: Creates a Product Category. + x-authenticated: true + parameters: + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductCategoriesReq' + x-codegen: + method: create + queryParams: AdminPostProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.create({ + name: "Skinny Jeans", + }) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/product-categories' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Skinny Jeans", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductCategories + summary: List Product Categories + description: Retrieve a list of product categories. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching product category names orhandles. + schema: + type: string + - in: query + name: is_internal + description: Search for only internal categories. + schema: + type: boolean + - in: query + name: is_active + description: Search for only active categories + schema: + type: boolean + - in: query + name: parent_category_id + description: Returns categories scoped by parent + schema: + type: string + - in: query + name: offset + description: How many product categories to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of product categories returned. + schema: + type: integer + default: 100 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the product category. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the product category. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.list() + .then(({ product_categories, limit, offset, count }) => { + console.log(product_categories.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-categories' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-categories/{id}: + delete: + operationId: DeleteProductCategoriesCategory + summary: Delete a Product Category + description: Deletes a ProductCategory. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.delete(product_category_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductCategoriesCategory + summary: Get a Product Category + description: Retrieves a Product Category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the results. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetProductCategoryParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.retrieve(product_category_id) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-categories/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductCategoriesCategory + summary: Update a Product Category + description: Updates a Product Category. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product category. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in each product category. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductCategoriesCategoryReq' + x-codegen: + method: update + queryParams: AdminPostProductCategoriesCategoryParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productCategories.update(product_category_id, { + name: "Skinny Jeans" + }) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/product-categories/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Skinny Jeans" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-tags: + get: + operationId: GetProductTags + summary: List Product Tags + description: Retrieve a list of Product Tags. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of tags to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the tags. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The tag values to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: id + style: form + explode: false + description: The tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product tags were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product tags were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetProductTagsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productTags.list() + .then(({ product_tags }) => { + console.log(product_tags.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-tags' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Tag + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductTagsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product types were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: AdminGetProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.productTypes.list() + .then(({ product_types }) => { + console.log(product_types.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-types' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Type + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductTypesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/{id}/options: + post: + operationId: PostProductsProductOptions + summary: Add an Option + x-authenticated: true + description: Adds a Product Option to a Product + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductOptionsReq' + x-codegen: + method: addOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.addOption(product_id, { + title: 'Size' + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products: + post: + operationId: PostProducts + summary: Create a Product + x-authenticated: true + description: Creates a Product + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.create({ + title: 'Shirt', + is_giftcard: false, + discountable: true + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Shirt" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Product + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching product title and description, variant title and sku, and collection title. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product. + schema: + type: string + - in: query + name: id + style: form + explode: false + description: Filter by product IDs. + schema: + oneOf: + - type: string + description: ID of the product to search for. + - type: array + items: + type: string + description: ID of a product. + - in: query + name: status + style: form + explode: false + description: Status to search for + schema: + type: array + items: + type: string + enum: + - draft + - proposed + - published + - rejected + - in: query + name: collection_id + style: form + explode: false + description: Collection ids to search for. + schema: + type: array + items: + type: string + - in: query + name: tags + style: form + explode: false + description: Tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: price_list_id + style: form + explode: false + description: Price List IDs to search for + schema: + type: array + items: + type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: Sales Channel IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: category_id + style: form + explode: false + description: Category IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id + schema: + type: boolean + - in: query + name: title + description: title to search for. + schema: + type: string + - in: query + name: description + description: description to search for. + schema: + type: string + - in: query + name: handle + description: handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: boolean + - in: query + name: created_at + description: Date comparison for when resulting products were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting products were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting products were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 50 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each product of the result. + schema: + type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.list() + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/{id}/variants: + post: + operationId: PostProductsProductVariants + summary: Create a Product Variant + description: Creates a Product Variant. Each Product Variant must have a unique combination of Product Option Values. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductVariantsReq' + x-codegen: + method: createVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.createVariant(product_id, { + title: 'Color', + prices: [ + { + amount: 1000, + currency_code: "eur" + } + ], + options: [ + { + option_id, + value: 'S' + } + ], + inventory_quantity: 100 + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/variants' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Color", + "prices": [ + { + "amount": 1000, + "currency_code": "eur" + } + ], + "options": [ + { + "option_id": "asdasf", + "value": "S" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductsProductVariants + summary: List a Product's Variants + description: Retrieves a list of the Product Variants associated with a Product. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: ID of the product to search for the variants. + schema: + type: string + - in: query + name: fields + description: Comma separated string of the column to select. + schema: + type: string + - in: query + name: expand + description: Comma separated string of the relations to include. + schema: + type: string + - in: query + name: offset + description: How many items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of items returned. + schema: + type: integer + default: 100 + x-codegen: + method: listVariants + queryParams: AdminGetProductsVariantsParams + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/{id}/variants' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListVariantsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/{id}/options/{option_id}: + delete: + operationId: DeleteProductsProductOptionsOption + summary: Delete a Product Option + description: Deletes a Product Option. Before a Product Option can be deleted all Option Values for the Product Option must be the same. You may, for example, have to delete some of your variants prior to deleting the Product Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string + x-codegen: + method: deleteOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.deleteOption(product_id, option_id) + .then(({ option_id, object, delete, product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsDeleteOptionRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductsProductOptionsOption + summary: Update a Product Option + description: Updates a Product Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: option_id + required: true + description: The ID of the Product Option. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductOptionsOption' + x-codegen: + method: updateOption + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.updateOption(product_id, option_id, { + title: 'Size' + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/{id}: + delete: + operationId: DeleteProductsProduct + summary: Delete a Product + description: Deletes a Product and it's associated Product Variants. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.delete(product_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/products/asfsaf' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetProductsProduct + summary: Get a Product + description: Retrieves a Product. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.retrieve(product_id) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductsProduct + summary: Update a Product + description: Updates a Product + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.update(product_id, { + title: 'Shirt', + images: [] + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Size" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/{id}/variants/{variant_id}: + delete: + operationId: DeleteProductsProductVariantsVariant + summary: Delete a Product Variant + description: Deletes a Product Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. + schema: + type: string + x-codegen: + method: deleteVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.deleteVariant(product_id, variant_id) + .then(({ variant_id, object, deleted, product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsDeleteVariantRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostProductsProductVariantsVariant + summary: Update a Product Variant + description: Update a Product Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: variant_id + required: true + description: The ID of the Product Variant. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductVariantsVariantReq' + x-codegen: + method: updateVariant + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.updateVariant(product_id, variant_id, { + title: 'Color', + prices: [ + { + amount: 1000, + currency_code: "eur" + } + ], + options: [ + { + option_id, + value: 'S' + } + ], + inventory_quantity: 100 + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Color", + "prices": [ + { + "amount": 1000, + "currency_code": "eur" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/tag-usage: + get: + operationId: GetProductsTagUsage + summary: List Tags Usage Number + description: Retrieves a list of Product Tags with how many times each is used. + x-authenticated: true + x-codegen: + method: listTags + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.listTags() + .then(({ tags }) => { + console.log(tags.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/tag-usage' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Tag + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListTagsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/types: + get: + deprecated: true + operationId: GetProductsTypes + summary: List Product Types + description: Retrieves a list of Product Types. + x-authenticated: true + x-codegen: + method: listTypes + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.listTypes() + .then(({ types }) => { + console.log(types.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/types' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsListTypesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/{id}/metadata: + post: + operationId: PostProductsProductMetadata + summary: Set Product Metadata + description: Set metadata key/value pair for Product + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Product. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostProductsProductMetadataReq' + x-codegen: + method: setMetadata + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.products.setMetadata(product_id, { + key: 'test', + value: 'true' + }) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/metadata' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "key": "test", + "value": "true" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProductsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /publishable-api-keys/{id}/sales-channels/batch: + post: + operationId: PostPublishableApiKeySalesChannelsChannelsBatch + summary: Add SalesChannels + description: Assign a batch of sales channels to a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq' + x-codegen: + method: addSalesChannelsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.addSalesChannelsBatch(publishableApiKeyId, { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pak_id}/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeletePublishableApiKeySalesChannelsChannelsBatch + summary: Delete SalesChannels + description: Remove a batch of sales channels from a publishable api key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq' + x-codegen: + method: deleteSalesChannelsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.deleteSalesChannelsBatch(publishableApiKeyId, { + sales_channel_ids: [ + { + id: channel_id + } + ] + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "sales_channel_ids": [ + { + "id": "{sales_channel_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /publishable-api-keys: + post: + operationId: PostPublishableApiKeys + summary: Create PublishableApiKey + description: Creates a PublishableApiKey. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPublishableApiKeysReq' + x-authenticated: true + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.create({ + title + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "Web API Key" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetPublishableApiKeys + summary: List PublishableApiKeys + description: List PublishableApiKeys. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching publishable api keys by title. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: list + queryParams: GetPublishableApiKeysParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.list() + .then(({ publishable_api_keys, count, limit, offset }) => { + console.log(publishable_api_keys) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /publishable-api-keys/{id}: + delete: + operationId: DeletePublishableApiKeysPublishableApiKey + summary: Delete PublishableApiKey + description: Deletes a PublishableApiKeys + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKeys to delete. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.delete(publishableApiKeyId) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeyDeleteRes' + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetPublishableApiKeysPublishableApiKey + summary: Get a PublishableApiKey + description: Retrieve the Publishable Api Key. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.retrieve(publishableApiKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /publishable-api-keys/{id}/sales-channels: + get: + operationId: GetPublishableApiKeySalesChannels + summary: List SalesChannels + description: List PublishableApiKey's SalesChannels + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Publishable Api Key. + schema: + type: string + - in: query + name: q + description: Query used for searching sales channels' names and descriptions. + schema: + type: string + x-codegen: + method: listSalesChannels + queryParams: GetPublishableApiKeySalesChannelsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.listSalesChannels() + .then(({ sales_channels }) => { + console.log(sales_channels.length) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/sales-channels' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysListSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /publishable-api-keys/{id}/revoke: + post: + operationId: PostPublishableApiKeysPublishableApiKeyRevoke + summary: Revoke PublishableApiKey + description: Revokes a PublishableApiKey. + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + x-authenticated: true + x-codegen: + method: revoke + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.revoke(publishableApiKeyId) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/revoke' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /publishable-api-key/{id}: + post: + operationId: PostPublishableApiKysPublishableApiKey + summary: Update PublishableApiKey + description: Updates a PublishableApiKey. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the PublishableApiKey. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.publishableApiKeys.update(publishableApiKeyId, { + title: "new title" + }) + .then(({ publishable_api_key }) => { + console.log(publishable_api_key.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "title": "new title" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PublishableApiKey + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPublishableApiKeysRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions/{id}/countries: + post: + operationId: PostRegionsRegionCountries + summary: Add Country + description: Adds a Country to the list of Countries in a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionCountriesReq' + x-codegen: + method: addCountry + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.addCountry(region_id, { + country_code: 'dk' + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{region_id}/countries' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "country_code": "dk" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions/{id}/fulfillment-providers: + post: + operationId: PostRegionsRegionFulfillmentProviders + summary: Add Fulfillment Provider + description: Adds a Fulfillment Provider to a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq' + x-codegen: + method: addFulfillmentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.addFulfillmentProvider(region_id, { + provider_id: 'manual' + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "provider_id": "manual" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions/{id}/payment-providers: + post: + operationId: PostRegionsRegionPaymentProviders + summary: Add Payment Provider + description: Adds a Payment Provider to a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq' + x-codegen: + method: addPaymentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.addPaymentProvider(region_id, { + provider_id: 'manual' + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/payment-providers' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "provider_id": "manual" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions: + post: + operationId: PostRegions + summary: Create a Region + description: Creates a Region + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.create({ + name: 'Europe', + currency_code: 'eur', + tax_rate: 0, + payment_providers: [ + 'manual' + ], + fulfillment_providers: [ + 'manual' + ], + countries: [ + 'DK' + ] + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Europe", + "currency_code": "eur", + "tax_rate": 0, + "payment_providers": [ + "manual" + ], + "fulfillment_providers": [ + "manual" + ], + "countries": [ + "DK" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + x-authenticated: true + parameters: + - in: query + name: limit + schema: + type: integer + default: 50 + required: false + description: limit the number of regions in response + - in: query + name: offset + schema: + type: integer + default: 0 + required: false + description: Offset of regions in response (used for pagination) + - in: query + name: created_at + schema: + type: object + required: false + description: Date comparison for when resulting region was created, i.e. less than, greater than etc. + - in: query + name: updated_at + schema: + type: object + required: false + description: Date comparison for when resulting region was updated, i.e. less than, greater than etc. + - in: query + name: deleted_at + schema: + type: object + required: false + description: Date comparison for when resulting region was deleted, i.e. less than, greater than etc. + x-codegen: + method: list + queryParams: AdminGetRegionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.list() + .then(({ regions, limit, offset, count }) => { + console.log(regions.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/regions' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions/{id}: + delete: + operationId: DeleteRegionsRegion + summary: Delete a Region + description: Deletes a Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.delete(region_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetRegionsRegion + summary: Get a Region + description: Retrieves a Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.retrieve(region_id) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/regions/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostRegionsRegion + summary: Update a Region + description: Updates a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostRegionsRegionReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.update(region_id, { + name: 'Europe' + }) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Europe" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions/{id}/fulfillment-options: + get: + operationId: GetRegionsRegionFulfillmentOptions + summary: List Fulfillment Options + description: Gathers all the fulfillment options available to in the Region. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + x-codegen: + method: retrieveFulfillmentOptions + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.retrieveFulfillmentOptions(region_id) + .then(({ fulfillment_options }) => { + console.log(fulfillment_options.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions/{id}/countries/{country_code}: + delete: + operationId: PostRegionsRegionCountriesCountry + summary: Delete Country + x-authenticated: true + description: Removes a Country from the list of Countries in a Region + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: country_code + description: The 2 character ISO code for the Country. + required: true + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: deleteCountry + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.deleteCountry(region_id, 'dk') + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/countries/dk' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions/{id}/fulfillment-providers/{provider_id}: + delete: + operationId: PostRegionsRegionFulfillmentProvidersProvider + summary: Del. Fulfillment Provider + description: Removes a Fulfillment Provider. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: provider_id + required: true + description: The ID of the Fulfillment Provider. + schema: + type: string + x-codegen: + method: deleteFulfillmentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.deleteFulfillmentProvider(region_id, 'manual') + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/manual' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions/{id}/payment-providers/{provider_id}: + delete: + operationId: PostRegionsRegionPaymentProvidersProvider + summary: Delete Payment Provider + description: Removes a Payment Provider. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Region. + schema: + type: string + - in: path + name: provider_id + required: true + description: The ID of the Payment Provider. + schema: + type: string + x-codegen: + method: deletePaymentProvider + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.regions.deletePaymentProvider(region_id, 'manual') + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /reservations: + post: + operationId: PostReservations + summary: Creates a Reservation + description: Creates a Reservation which can be associated with any resource as required. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.reservations.create({ + }) + .then(({ reservations }) => { + console.log(reservations.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/reservations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "resource_id": "{resource_id}", + "resource_type": "order", + "value": "We delivered this order" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservation + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetReservations + summary: List Reservations + description: Retrieve a list of Reservations. + x-authenticated: true + parameters: + - in: query + name: location_id + style: form + explode: false + description: Location ids to search for. + schema: + type: array + items: + type: string + - in: query + name: inventory_item_id + style: form + explode: false + description: Inventory Item ids to search for. + schema: + type: array + items: + type: string + - in: query + name: line_item_id + style: form + explode: false + description: Line Item ids to search for. + schema: + type: array + items: + type: string + - in: query + name: quantity + description: Filter by reservation quantity + schema: + type: object + properties: + lt: + type: number + description: filter by reservation quantity less than this number + gt: + type: number + description: filter by reservation quantity greater than this number + lte: + type: number + description: filter by reservation quantity less than or equal to this number + gte: + type: number + description: filter by reservation quantity greater than or equal to this number + - in: query + name: offset + description: How many Reservations to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of Reservations returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the product category. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the product category. + schema: + type: string + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-categories' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminGetReservationReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /reservations/{id}: + delete: + operationId: DeleteReservationsReservation + summary: Delete a Reservation + description: Deletes a Reservation. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Reservation to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.reservations.delete(reservation.id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/reservations/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservation + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Reservation. + object: + type: string + description: The type of the object that was deleted. + default: reservation + deleted: + type: boolean + description: Whether or not the Reservation was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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: GetReservationsReservation + summary: Get a Reservation + description: Retrieves a single reservation using its id + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the reservation to retrieve. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.reservations.retrieve(reservation_id) + .then(({ reservation }) => { + console.log(reservation.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/reservations/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservation + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostReservationsReservation + summary: Updates a Reservation + description: Updates a Reservation which can be associated with any resource as required. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Reservation to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReservationReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.reservations.update(reservation.id, { + quantity: 3 + }) + .then(({ reservations }) => { + console.log(reservations.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/reservations/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 3, + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Reservation + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReservationsReq' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /return-reasons: + post: + operationId: PostReturnReasons + summary: Create a Return Reason + description: Creates a Return Reason + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnReasonsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.create({ + label: 'Damaged', + value: 'damaged' + }) + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/return-reasons' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "label": "Damaged", + "value": "damaged" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.list() + .then(({ return_reasons }) => { + console.log(return_reasons.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/return-reasons' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /return-reasons/{id}: + delete: + operationId: DeleteReturnReason + summary: Delete a Return Reason + description: Deletes a return reason. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the return reason + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.delete(return_reason_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/return-reasons/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Return Reason. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.retrieve(return_reason_id) + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/return-reasons/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostReturnReasonsReason + summary: Update a Return Reason + description: Updates a Return Reason + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Return Reason. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnReasonsReasonReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returnReasons.update(return_reason_id, { + label: 'Damaged' + }) + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/return-reasons/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "label": "Damaged" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /returns/{id}/cancel: + post: + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string + x-codegen: + method: cancel + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returns.cancel(return_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/returns/{id}/cancel' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnsCancelRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /returns: + get: + operationId: GetReturns + summary: List Returns + description: Retrieves a list of Returns + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' + x-codegen: + method: list + queryParams: AdminGetReturnsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returns.list() + .then(({ returns, limit, offset, count }) => { + console.log(returns.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/returns' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /returns/{id}/receive: + post: + operationId: PostReturnsReturnReceive + summary: Receive a Return + description: Registers a Return as received. Updates statuses on Orders and Swaps accordingly. + parameters: + - in: path + name: id + required: true + description: The ID of the Return. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostReturnsReturnReceiveReq' + x-codegen: + method: receive + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.returns.receive(return_id, { + items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then((data) => { + console.log(data.return.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/returns/{id}/receive' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "items": [ + { + "item_id": "asafg", + "quantity": 1 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminReturnsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /sales-channels/{id}/products/batch: + post: + operationId: PostSalesChannelsChannelProductsBatch + summary: Add Products + description: Assign a batch of product to a sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq' + x-codegen: + method: addProducts + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.addProducts(sales_channel_id, { + product_ids: [ + { + id: product_id + } + ] + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels/afasf/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteSalesChannelsChannelProductsBatch + summary: Delete Products + description: Remove a list of products from a sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq' + x-codegen: + method: removeProducts + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.removeProducts(sales_channel_id, { + product_ids: [ + { + id: product_id + } + ] + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_ids": [ + { + "id": "{product_id}" + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /sales-channels/{id}/stock-locations: + post: + operationId: PostSalesChannelsSalesChannelStockLocation + summary: Associate a stock location to a Sales Channel + description: Associates a stock location to a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsChannelStockLocationsReq' + x-codegen: + method: addLocation + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.addLocation(sales_channel_id, { + location_id: 'App' + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "locaton_id": "stock_location_id" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteSalesChannelsSalesChannelStockLocation + summary: Remove a stock location from a Sales Channel + description: Removes a stock location from a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteSalesChannelsChannelStockLocationsReq' + x-codegen: + method: removeLocation + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.removeLocation(sales_channel_id, { + location_id: 'App' + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "locaton_id": "stock_location_id" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsDeleteLocationRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /sales-channels: + post: + operationId: PostSalesChannels + summary: Create a Sales Channel + description: Creates a Sales Channel. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.create({ + name: 'App', + description: 'Mobile app' + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetSalesChannels + summary: List Sales Channels + description: Retrieves a list of sales channels + x-authenticated: true + parameters: + - in: query + name: id + description: ID of the sales channel + schema: + type: string + - in: query + name: name + description: Name of the sales channel + schema: + type: string + - in: query + name: description + description: Description of the sales channel + schema: + type: string + - in: query + name: q + description: Query used for searching sales channels' names and descriptions. + schema: + type: string + - in: query + name: order + description: The field to order the results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many sales channels to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of sales channels returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each sales channel of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each sales channel of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetSalesChannelsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.list() + .then(({ sales_channels, limit, offset, count }) => { + console.log(sales_channels.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/sales-channels' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /sales-channels/{id}: + delete: + operationId: DeleteSalesChannelsSalesChannel + summary: Delete a Sales Channel + description: Deletes the sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.delete(sales_channel_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetSalesChannelsSalesChannel + summary: Get a Sales Channel + description: Retrieves the sales channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales channel. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.retrieve(sales_channel_id) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/sales-channels/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostSalesChannelsSalesChannel + summary: Update a Sales Channel + description: Updates a Sales Channel. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Sales Channel. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostSalesChannelsSalesChannelReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.salesChannels.update(sales_channel_id, { + name: 'App' + }) + .then(({ sales_channel }) => { + console.log(sales_channel.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSalesChannelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.create({ + name: 'PostFake', + region_id: "saasf", + provider_id: "manual", + data: { + }, + price_type: 'flat_rate' + }) + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-options' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "PostFake", + "region_id": "afasf", + "provider_id": "manual", + "data": {}, + "price_type": "flat_rate" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingOptions + summary: List Shipping Options + description: Retrieves a list of Shipping Options. + x-authenticated: true + parameters: + - in: query + name: region_id + schema: + type: string + description: Region ID to fetch options from + - in: query + name: is_return + schema: + type: boolean + description: Flag for fetching return options only + - in: query + name: admin_only + schema: + type: boolean + description: Flag for fetching admin specific options + x-codegen: + method: list + queryParams: AdminGetShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.list() + .then(({ shipping_options, count }) => { + console.log(shipping_options.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-options' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.delete(option_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/shipping-options/{option_id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingOptionsOption + summary: Get a Shipping Option + description: Retrieves a Shipping Option. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.retrieve(option_id) + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-options/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostShippingOptionsOption + summary: Update Shipping Option + description: Updates a Shipping Option + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingOptionsOptionReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingOptions.update(option_id, { + name: 'PostFake', + requirements: [ + { + id, + type: 'max_subtotal', + amount: 1000 + } + ] + }) + .then(({ shipping_option }) => { + console.log(shipping_option.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-options/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "requirements": [ + { + "type": "max_subtotal", + "amount": 1000 + } + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.create({ + name: 'Large Products' + }) + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingProfiles + summary: List Shipping Profiles + description: Retrieves a list of Shipping Profile. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.list() + .then(({ shipping_profiles }) => { + console.log(shipping_profiles.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.delete(profile_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteShippingProfileRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetShippingProfilesProfile + summary: Get a Shipping Profile + description: Retrieves a Shipping Profile. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.retrieve(profile_id) + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostShippingProfilesProfile + summary: Update a Shipping Profile + description: Updates a Shipping Profile + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Profile. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostShippingProfilesProfileReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.shippingProfiles.update(shipping_profile_id, { + name: 'Large Products' + }) + .then(({ shipping_profile }) => { + console.log(shipping_profile.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles/{id} \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Large Products" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Shipping Profile + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingProfilesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /stock-locations: + post: + operationId: PostStockLocations + summary: Create a Stock Location + description: Creates a Stock Location. + x-authenticated: true + parameters: + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStockLocationsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.create({ + name: 'Main Warehouse', + location_id: 'sloc' + }) + .then(({ stock_location }) => { + console.log(stock_location.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/stock-locations' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Location + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetStockLocations + summary: List Stock Locations + description: Retrieves a list of stock locations + x-authenticated: true + parameters: + - in: query + name: id + description: ID of the stock location + schema: + type: string + - in: query + name: name + description: Name of the stock location + schema: + type: string + - in: query + name: order + description: The field to order the results by. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: deleted_at + description: Date comparison for when resulting collections were deleted. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: offset + description: How many stock locations to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of stock locations returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each stock location of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each stock location of the result. + schema: + type: string + x-codegen: + method: list + queryParams: AdminGetStockLocationsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.list() + .then(({ stock_locations, limit, offset, count }) => { + console.log(stock_locations.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/stock-locations' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Sales Channel + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /stock-locations/{id}: + delete: + operationId: DeleteStockLocationsStockLocation + summary: Delete a Stock Location + description: Delete a Stock Location + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.delete(stock_location_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/stock-locations/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - StockLocation + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + format: stock_location + deleted: + type: boolean + description: Whether or not the Stock Location was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetStockLocationsStockLocation + summary: Get a Stock Location + description: Retrieves the Stock Location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetStockLocationsLocationParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.retrieve(stock_location_id) + .then(({ stock_location }) => { + console.log(stock_location.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/stock-locations/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Location + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsRes' + post: + operationId: PostStockLocationsStockLocation + summary: Update a Stock Location + description: Updates a Stock Location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStockLocationsLocationReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.update(stock_location_id, { + name: 'App' + }) + .then(({ stock_location }) => { + console.log(stock_location.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/stock-locations/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "App" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Stock Location + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStockLocationsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/currencies/{code}: + post: + operationId: PostStoreCurrenciesCode + summary: Add a Currency Code + description: Adds a Currency Code to the available currencies. + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The 3 character ISO currency code. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: addCurrency + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.addCurrency('eur') + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/store/currencies/eur' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteStoreCurrenciesCode + summary: Delete a Currency Code + description: Removes a Currency Code from the available currencies. + x-authenticated: true + parameters: + - in: path + name: code + required: true + description: The 3 character ISO currency code. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: deleteCurrency + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.deleteCurrency('eur') + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/store/currencies/eur' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store: + get: + operationId: GetStore + summary: Get Store details + description: Retrieves the Store details + x-authenticated: true + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.retrieve() + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/store' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostStore + summary: Update Store Details + description: Updates the Store details + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostStoreReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.update({ + name: 'Medusa Store' + }) + .then(({ store }) => { + console.log(store.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/store' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Medusa Store" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminStoresRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/payment-providers: + get: + operationId: GetStorePaymentProviders + summary: List Payment Providers + description: Retrieves the configured Payment Providers + x-authenticated: true + x-codegen: + method: listPaymentProviders + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.listPaymentProviders() + .then(({ payment_providers }) => { + console.log(payment_providers.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/store/payment-providers' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPaymentProvidersList' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /store/tax-providers: + get: + operationId: GetStoreTaxProviders + summary: List Tax Providers + description: Retrieves the configured Tax Providers + x-authenticated: true + x-codegen: + method: listTaxProviders + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.store.listTaxProviders() + .then(({ tax_providers }) => { + console.log(tax_providers.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/store/tax-providers' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Store + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxProvidersList' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /swaps/{id}: + get: + operationId: GetSwapsSwap + summary: Get a Swap + description: Retrieves a Swap. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Swap. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.swaps.retrieve(swap_id) + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/swaps/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSwapsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /swaps: + get: + operationId: GetSwaps + summary: List Swaps + description: Retrieves a list of Swaps. + parameters: + - in: query + name: limit + description: The upper limit for the amount of responses returned. + schema: + type: number + default: '50' + - in: query + name: offset + description: The offset of the list returned. + schema: + type: number + default: '0' + x-authenticated: true + x-codegen: + method: list + queryParams: AdminGetSwapsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.swaps.list() + .then(({ swaps }) => { + console.log(swaps.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/swaps' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminSwapsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /tax-rates/{id}/product-types/batch: + post: + operationId: PostTaxRatesTaxRateProductTypes + summary: Add to Product Types + description: Associates a Tax Rate with a list of Product Types + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq' + x-codegen: + method: addProductTypes + queryParams: AdminPostTaxRatesTaxRateProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.addProductTypes(tax_rate_id, { + product_types: [ + product_type_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_types": [ + "{product_type_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRateProductTypes + summary: Delete from Product Types + description: Removes a Tax Rate from a list of Product Types + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq' + x-codegen: + method: removeProductTypes + queryParams: AdminDeleteTaxRatesTaxRateProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.removeProductTypes(tax_rate_id, { + product_types: [ + product_type_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "product_types": [ + "{product_type_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /tax-rates/{id}/products/batch: + post: + operationId: PostTaxRatesTaxRateProducts + summary: Add to Products + description: Associates a Tax Rate with a list of Products + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductsReq' + x-codegen: + method: addProducts + queryParams: AdminPostTaxRatesTaxRateProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.addProducts(tax_rate_id, { + products: [ + product_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "products": [ + "{product_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRateProducts + summary: Delete from Products + description: Removes a Tax Rate from a list of Products + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq' + x-codegen: + method: removeProducts + queryParams: AdminDeleteTaxRatesTaxRateProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.removeProducts(tax_rate_id, { + products: [ + product_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "products": [ + "{product_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /tax-rates/{id}/shipping-options/batch: + post: + operationId: PostTaxRatesTaxRateShippingOptions + summary: Add to Shipping Options + description: Associates a Tax Rate with a list of Shipping Options + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq' + x-codegen: + method: addShippingOptions + queryParams: AdminPostTaxRatesTaxRateShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.addShippingOptions(tax_rate_id, { + shipping_options: [ + shipping_option_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "shipping_options": [ + "{shipping_option_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteTaxRatesTaxRateShippingOptions + summary: Del. for Shipping Options + description: Removes a Tax Rate from a list of Shipping Options + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq' + x-codegen: + method: removeShippingOptions + queryParams: AdminDeleteTaxRatesTaxRateShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.removeShippingOptions(tax_rate_id, { + shipping_options: [ + shipping_option_id + ] + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "shipping_options": [ + "{shipping_option_id}" + ] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /tax-rates: + post: + operationId: PostTaxRates + summary: Create a Tax Rate + description: Creates a Tax Rate + parameters: + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesReq' + x-codegen: + method: create + queryParams: AdminPostTaxRatesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.create({ + code: 'TEST', + name: 'New Tax Rate', + region_id + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "code": "TEST", + "name": "New Tax Rate", + "region_id": "{region_id}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetTaxRates + summary: List Tax Rates + description: Retrieves a list of TaxRates + x-authenticated: true + parameters: + - in: query + name: name + description: Name of tax rate to retrieve + schema: + type: string + - in: query + name: region_id + style: form + explode: false + description: Filter by Region ID + schema: + oneOf: + - type: string + - type: array + items: + type: string + - in: query + name: code + description: code to search for. + schema: + type: string + - in: query + name: rate + style: form + explode: false + description: Filter by Rate + schema: + oneOf: + - type: number + - type: object + properties: + lt: + type: number + description: filter by rates less than this number + gt: + type: number + description: filter by rates greater than this number + lte: + type: number + description: filter by rates less than or equal to this number + gte: + type: number + description: filter by rates greater than or equal to this number + - in: query + name: offset + description: How many tax rates to skip before retrieving the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of tax rates returned. + schema: + type: integer + default: 50 + - in: query + name: fields + description: Which fields should be included in each item. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved for each item. + style: form + explode: false + schema: + type: array + items: + type: string + x-codegen: + method: list + queryParams: AdminGetTaxRatesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.list() + .then(({ tax_rates, limit, offset, count }) => { + console.log(tax_rates.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/tax-rates' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /tax-rates/{id}: + delete: + operationId: DeleteTaxRatesTaxRate + summary: Delete a Tax Rate + description: Deletes a Tax Rate + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Shipping Option. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.delete(tax_rate_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesDeleteRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetTaxRatesTaxRate + summary: Get a Tax Rate + description: Retrieves a TaxRate + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + x-codegen: + method: retrieve + queryParams: AdminGetTaxRatesTaxRateParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.retrieve(tax_rate_id) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/tax-rates/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostTaxRatesTaxRate + summary: Update a Tax Rate + description: Updates a Tax Rate + parameters: + - in: path + name: id + required: true + description: ID of the tax rate. + schema: + type: string + - in: query + name: fields + description: Which fields should be included in the result. + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: expand + description: Which fields should be expanded and retrieved in the result. + style: form + explode: false + schema: + type: array + items: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostTaxRatesTaxRateReq' + x-codegen: + method: update + queryParams: AdminPostTaxRatesTaxRateParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.taxRates.update(tax_rate_id, { + name: 'New Tax Rate' + }) + .then(({ tax_rate }) => { + console.log(tax_rate.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "New Tax Rate" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Tax Rate + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTaxRatesRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /uploads/protected: + post: + operationId: PostUploadsProtected + summary: Protected File Upload + description: Uploads at least one file with ACL or a non-public bucket to the specific fileservice that is installed in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.uploads.createProtected(file) + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/uploads/protected' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: image/jpeg' \ + --form 'files=@""' \ + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUploadsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /uploads: + post: + operationId: PostUploads + summary: Upload files + description: Uploads at least one file to the specific fileservice that is installed in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.uploads.create(file) + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/uploads' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: image/jpeg' \ + --form 'files=@""' \ + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUploadsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: AdminDeleteUploads + summary: Delete an Uploaded File + description: Removes an uploaded file using the installed fileservice + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteUploadsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.uploads.delete({ + file_key + }) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/uploads' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "file_key": "{file_key}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteUploadsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /uploads/download-url: + post: + operationId: PostUploadsDownloadUrl + summary: Get a File's Download URL + description: Creates a presigned download url for a file + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostUploadsDownloadUrlReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.uploads.getPresignedDownloadUrl({ + file_key + }) + .then(({ download_url }) => { + console.log(download_url); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/uploads/download-url' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "file_key": "{file_key}" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUploadsDownloadUrlRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /users: + post: + operationId: PostUsers + summary: Create a User + description: Creates a User + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCreateUserRequest' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.create({ + email: 'user@example.com', + password: 'supersecret' + }) + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/users' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetUsers + summary: List Users + description: Retrieves all users. + x-authenticated: true + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.list() + .then(({ users }) => { + console.log(users.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/users' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUsersListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /users/{id}: + delete: + operationId: DeleteUsersUser + summary: Delete a User + description: Deletes a User + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-codegen: + method: delete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.delete(user_id) + .then(({ id, object, deleted }) => { + console.log(id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/users/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminDeleteUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetUsersUser + summary: Get a User + description: Retrieves a User. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.retrieve(user_id) + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/users/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostUsersUser + summary: Update a User + description: Updates a User + parameters: + - in: path + name: id + required: true + description: The ID of the User. + schema: + type: string + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdateUserRequest' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.update(user_id, { + first_name: 'Marcellus' + }) + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/users/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Marcellus" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /users/password-token: + post: + operationId: PostUsersUserPasswordToken + summary: Request Password Reset + description: Generates a password token for a User with a given email. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminResetPasswordTokenRequest' + x-codegen: + method: sendResetPasswordToken + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.sendResetPasswordToken({ + email: 'user@example.com' + }) + .then(() => { + // successful + }) + .catch(() => { + // error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/users/password-token' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /users/reset-password: + post: + operationId: PostUsersUserPassword + summary: Reset Password + description: Sets the password for a User given the correct token. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminResetPasswordRequest' + x-codegen: + method: resetPassword + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.users.resetPassword({ + token: 'supersecrettoken', + password: 'supersecret' + }) + .then(({ user }) => { + console.log(user.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/users/reset-password' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "token": "supersecrettoken", + "password": "supersecret" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - User + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUserRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /variants/{id}/inventory: + get: + operationId: GetVariantsVariantInventory + summary: Get inventory of Variant. + description: Returns the available inventory of a Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Product Variant id to get inventory for. + schema: + type: string + x-codegen: + method: getInventory + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.variants.list() + .then(({ variants, limit, offset, count }) => { + console.log(variants.length) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/variants' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + variant: + type: object + $ref: '#/components/schemas/AdminGetVariantsVariantInventoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /variants: + get: + operationId: GetVariants + summary: List Product Variants + description: Retrieves a list of Product Variants + x-authenticated: true + parameters: + - in: query + name: id + description: A Product Variant id to filter by. + schema: + type: string + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: fields + description: A comma separated list of Product Variant fields to include. + schema: + type: string + - in: query + name: offset + description: How many product variants to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Maximum number of Product Variants to return. + schema: + type: number + default: '100' + - in: query + name: cart_id + description: The id of the cart to use for price selection. + schema: + type: string + - in: query + name: region_id + description: The id of the region to use for price selection. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: customer_id + description: The id of the customer to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search using less and greater than comparisons. + properties: + lt: + type: number + description: filter by inventory quantity less than this number + gt: + type: number + description: filter by inventory quantity greater than this number + lte: + type: number + description: filter by inventory quantity less than or equal to this number + gte: + type: number + description: filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: AdminGetVariantsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.variants.list() + .then(({ variants, limit, offset, count }) => { + console.log(variants.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/variants' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminVariantsListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' +components: + responses: + default_error: + description: Default Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + invalid_state_error: + description: Invalid State Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: The request conflicted with another request. You may retry the request with the provided Idempotency-Key. + type: QueryRunnerAlreadyReleasedError + invalid_request_error: + description: Invalid Request Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: invalid_request_error + message: Discount with code TEST already exists. + type: duplicate_error + not_found_error: + description: Not Found Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + message: Entity with id 1 was not found + type: not_found + 400_error: + description: Client Error or Multiple Errors + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' + examples: + not_allowed: + $ref: '#/components/examples/not_allowed_error' + invalid_data: + $ref: '#/components/examples/invalid_data_error' + MultipleErrors: + $ref: '#/components/examples/multiple_errors' + 500_error: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + database: + $ref: '#/components/examples/database_error' + unexpected_state: + $ref: '#/components/examples/unexpected_state_error' + invalid_argument: + $ref: '#/components/examples/invalid_argument_error' + default_error: + $ref: '#/components/examples/default_error' + unauthorized: + description: User is not authorized. Must log in first + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + incorrect_credentials: + description: User does not exist or incorrect credentials + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + examples: + not_allowed_error: + summary: Not Allowed Error + value: + message: Discount must be set to dynamic + type: not_allowed + invalid_data_error: + summary: Invalid Data Error + value: + message: first_name must be a string + type: invalid_data + multiple_errors: + summary: Multiple Errors + value: + message: Provided request body contains errors. Please check the data and retry the request + errors: + - message: first_name must be a string + type: invalid_data + - message: Discount must be set to dynamic + type: not_allowed + database_error: + summary: Database Error + value: + code: api_error + message: An error occured while hashing password + type: database_error + unexpected_state_error: + summary: Unexpected State Error + value: + message: cart.total must be defined + type: unexpected_state + invalid_argument_error: + summary: Invalid Argument Error + value: + message: cart.total must be defined + type: unexpected_state + default_error: + summary: Default Error + value: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + securitySchemes: + api_token: + type: http + x-displayName: API Token + description: | + Use a user's API Token to send authenticated requests. + + ### How to Add API Token to a User + + At the moment, there's no direct way of adding an API Token for a user. The only way it can be done is through directly editing the database. + + If you're using a PostgreSQL database, you can run the following commands in your command line to add API token: + + ```bash + psql -d -U + UPDATE public.user SET api_token='' WHERE email=''; + ``` + + Where: + - `` is the name of the database schema you use for the Medusa server. + - `` is the name of the user that has privileges over the database schema. + - `` is the API token you want to associate with the user. You can use [this tool to generate a random token](https://randomkeygen.com/). + - `` is the email address of the admin user you want to have this API token. + + ### How to Use the API Token + + The API token can be used for Bearer Authentication. It's passed in the `Authorization` header as the following: + + ``` + Authorization: Bearer {api_token} + ``` + + In this API reference, you'll find in the cURL request samples the use of `{api_token}`. This is where you must pass the API token. + + If you're following along with the JS Client request samples, you must provide the `apiKey` option when creating the Medusa client: + + ```ts + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3, apiKey: '{api_token}' }) + ``` + + If you're using Medusa React, you can pass the `apiKey` prop to `MedusaProvider`: + + ```tsx + + ``` + scheme: bearer + cookie_auth: + type: apiKey + in: cookie + name: connect.sid + x-displayName: Cookie Session ID + description: | + Use a cookie session to send authenticated requests. + + ### How to Obtain the Cookie Session + + If you're sending requests through a browser, using JS Client, or using tools like Postman, the cookie session should be automatically set when the admin user is logged in. + + If you're sending requests using cURL, you must set the Session ID in the cookie manually. + + To do that, send a request to [authenticate the user](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: + + ```bash + curl -v --location --request POST 'https://medusa-url.com/admin/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + ``` + + The headers will be logged in the terminal as well as the response. You should find in the headers a Cookie header similar to this: + + ```bash + Set-Cookie: connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; + ``` + + Copy the value after `connect.sid` (without the `;` at the end) and pass it as a cookie in subsequent requests as the following: + + ```bash + curl --location --request GET 'https://medusa-url.com/admin/products' \ + --header 'Cookie: connect.sid={sid}' + ``` + + Where `{sid}` is the value of `connect.sid` that you copied. + schemas: + AddressFields: + title: Address Fields + description: Address fields used when creating/updating an address. + type: object + properties: + company: + type: string + description: Company name + example: Acme + first_name: + type: string + description: First name + example: Arno + last_name: + type: string + description: Last name + example: Willms + address_1: + type: string + description: Address line 1 + example: 14433 Kemmer Court + address_2: + type: string + description: Address line 2 + example: Suite 369 + city: + type: string + description: City + example: South Geoffreyview + country_code: + type: string + description: The 2 character ISO code of the country in lower case + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + type: string + description: Province + example: Kentucky + postal_code: + type: string + description: Postal Code + example: 72093 + phone: + type: string + description: Phone Number + example: 16128234334802 + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + Address: + title: Address + description: An address. + type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at + properties: + id: + type: string + description: ID of the address + example: addr_01G8ZC9VS1XVE149MGH2J7QSSH + customer_id: + description: ID of the customer this address belongs to + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: Available if the relation `customer` is expanded. + nullable: true + type: object + company: + description: Company name + nullable: true + type: string + example: Acme + first_name: + description: First name + nullable: true + type: string + example: Arno + last_name: + description: Last name + nullable: true + type: string + example: Willms + address_1: + description: Address line 1 + nullable: true + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + nullable: true + type: string + example: Suite 369 + city: + description: City + nullable: true + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + nullable: true + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + country: + description: A country object. Available if the relation `country` is expanded. + nullable: true + $ref: '#/components/schemas/Country' + province: + description: Province + nullable: true + type: string + example: Kentucky + postal_code: + description: Postal Code + nullable: true + type: string + example: 72093 + phone: + description: Phone Number + nullable: true + type: string + example: 16128234334802 + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + BatchJob: + title: Batch Job + description: A Batch Job. + type: object + required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status + - type + - updated_at + properties: + id: + description: The unique identifier for the batch job. + type: string + example: batch_01G8T782965PYFG0751G0Z38B4 + type: + description: The type of batch job. + type: string + enum: + - product-import + - product-export + status: + description: The status of the batch job. + type: string + enum: + - created + - pre_processed + - confirmed + - processing + - completed + - canceled + - failed + default: created + created_by: + description: The unique identifier of the user that created the batch job. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: A user object. Available if the relation `created_by_user` is expanded. + nullable: true + $ref: '#/components/schemas/User' + context: + description: The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true + type: object + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + nullable: true + allOf: + - type: object + example: {} + - type: object + properties: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: + type: string + file_size: + type: number + example: + errors: + - err: [] + code: unknown + message: Method not implemented. + stat_descriptors: + - key: product-export-count + name: Product count to export + message: There will be 8 products exported by this action + pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true + type: string + format: date-time + processing_at: + description: The date the job is processing at. + nullable: true + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + nullable: true + type: string + format: date-time + completed_at: + description: The date of the completion. + nullable: true + type: string + format: date-time + canceled_at: + description: The date of the concellation. + nullable: true + type: string + format: date-time + failed_at: + description: The date when the job failed. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Cart: + title: Cart + description: Represents a user cart + type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at + properties: + id: + description: The cart's ID + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + email: + description: The email associated with the cart + nullable: true + type: string + format: email + billing_address_id: + description: The billing address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The shipping address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + discounts: + description: Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + customer_id: + description: The customer's ID + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + type: object + payment_session: + description: The selected payment session in the cart. + nullable: true + type: object + payment_sessions: + description: The payment sessions created on the cart. + type: array + items: + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object + shipping_methods: + description: The shipping methods added to the cart. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + type: + description: The cart's type. + type: string + enum: + - default + - swap + - draft_order + - payment_link + - claim + default: default + completed_at: + description: The date with timezone at which the cart was completed. + nullable: true + type: string + format: date-time + payment_authorized_at: + description: The date with timezone at which the payment was authorized. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + context: + description: The context of the cart which can include info like IP or user agent. + nullable: true + type: object + example: + ip: '::1' + user_agent: PostmanRuntime/7.29.2 + sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + sales_channel: + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + shipping_total: + description: The total of shipping + type: integer + example: 1000 + discount_total: + description: The total of discount + type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order associated with this cart is returned. + type: integer + example: 0 + total: + description: The total amount of the cart + type: integer + example: 8200 + subtotal: + description: The subtotal of the cart + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + ClaimImage: + title: Claim Image + description: Represents photo documentation of a claim. + type: object + required: + - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + description: The claim image's ID + type: string + example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 + claim_item_id: + description: The ID of the claim item associated with the image + type: string + claim_item: + description: A claim item object. Available if the relation `claim_item` is expanded. + nullable: true + type: object + url: + description: The URL of the image + type: string + format: uri + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimItem: + title: Claim Item + description: Represents a claimed item along with information about the reasons for the claim. + type: object + required: + - claim_order_id + - created_at + - deleted_at + - id + - item_id + - metadata + - note + - quantity + - reason + - updated_at + - variant_id + properties: + id: + description: The claim item's ID + type: string + example: citm_01G8ZH853Y6TFXWPG5EYE81X63 + images: + description: Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimImage' + claim_order_id: + description: The ID of the claim this item is associated with. + type: string + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + item_id: + description: The ID of the line item that the claim item refers to. + type: string + example: item_01G8ZM25TN49YV9EQBE2NC27KC + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + variant_id: + description: The ID of the product variant that is claimed. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A variant object. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + reason: + description: The reason for the claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + note: + description: An optional note about the claim, for additional information + nullable: true + type: string + example: I don't like it. + quantity: + description: The quantity of the item that is being claimed; must be less than or equal to the amount purchased in the original order. + type: integer + example: 1 + tags: + description: User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimTag' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimOrder: + title: Claim Order + description: Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. + type: object + required: + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at + properties: + id: + description: The claim's ID + type: string + example: claim_01G8ZH853Y6TFXWPG5EYE81X63 + type: + description: The claim's type + type: string + enum: + - refund + - replace + payment_status: + description: The status of the claim's payment + type: string + enum: + - na + - not_refunded + - refunded + default: na + fulfillment_status: + description: The claim's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + claim_items: + description: The items that have been claimed + type: array + items: + $ref: '#/components/schemas/ClaimItem' + additional_items: + description: Refers to the new items to be shipped when the claim order has the type `replace` + type: array + items: + $ref: '#/components/schemas/LineItem' + order_id: + description: The ID of the order that the claim comes from. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + return_order: + description: A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + nullable: true + type: object + shipping_address_id: + description: The ID of the address that the new items should be shipped to + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The shipping methods that the claim order will be shipped with. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + fulfillments: + description: The fulfillments of the new items to be shipped + type: array + items: + type: object + refund_amount: + description: The amount that will be refunded in conjunction with the claim + nullable: true + type: integer + example: 1000 + canceled_at: + description: The date with timezone at which the claim was canceled. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + no_notification: + description: Flag for describing whether or not notifications related to this should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + ClaimTag: + title: Claim Tag + description: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The claim tag's ID + type: string + example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 + value: + description: The value that the claim tag holds + type: string + example: Damaged + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Country: + title: Country + description: Country details + type: object + required: + - display_name + - id + - iso_2 + - iso_3 + - name + - num_code + - region_id + properties: + id: + description: The country's ID + type: string + example: 109 + iso_2: + description: The 2 character ISO code of the country in lower case + type: string + example: it + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + iso_3: + description: The 2 character ISO code of the country in lower case + type: string + example: ita + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements + description: See a list of codes. + num_code: + description: The numerical ISO code for the country. + type: string + example: 380 + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements + description: See a list of codes. + name: + description: The normalized country name in upper case. + type: string + example: ITALY + display_name: + description: The country name appropriate for display. + type: string + example: Italy + region_id: + description: The region ID this country is associated with. + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + Currency: + title: Currency + description: Currency + type: object + required: + - code + - name + - symbol + - symbol_native + properties: + code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + symbol: + description: The symbol used to indicate the currency. + type: string + example: $ + symbol_native: + description: The native symbol used to indicate the currency. + type: string + example: $ + name: + description: The written name of the currency + type: string + example: US Dollar + includes_tax: + description: '[EXPERIMENTAL] Does the currency prices include tax' + type: boolean + default: false + CustomShippingOption: + title: Custom Shipping Option + description: Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option + type: object + required: + - cart_id + - created_at + - deleted_at + - id + - metadata + - price + - shipping_option_id + - updated_at + properties: + id: + description: The custom shipping option's ID + type: string + example: cso_01G8X99XNB77DMFBJFWX6DN9V9 + price: + description: The custom price set that will override the shipping option's original price + type: integer + example: 1000 + shipping_option_id: + description: The ID of the Shipping Option that the custom shipping option overrides + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: A shipping option object. Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + cart_id: + description: The ID of the Cart that the custom shipping option is attached to + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + CustomerGroup: + title: Customer Group + description: Represents a customer group + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - updated_at + properties: + id: + description: The customer group's ID + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + name: + description: The name of the customer group + type: string + example: VIP + customers: + description: The customers that belong to the customer group. Available if the relation `customers` is expanded. + type: array + items: + type: object + price_lists: + description: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Customer: + title: Customer + description: Represents a customer + type: object + required: + - billing_address_id + - created_at + - deleted_at + - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at + properties: + id: + description: The customer's ID + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + email: + description: The customer's email + type: string + format: email + first_name: + description: The customer's first name + nullable: true + type: string + example: Arno + last_name: + description: The customer's last name + nullable: true + type: string + example: Willms + billing_address_id: + description: The customer's billing address ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_addresses: + description: Available if the relation `shipping_addresses` is expanded. + type: array + items: + $ref: '#/components/schemas/Address' + phone: + description: The customer's phone number + nullable: true + type: string + example: 16128234334802 + has_account: + description: Whether the customer has an account or not + type: boolean + default: false + orders: + description: Available if the relation `orders` is expanded. + type: array + items: + type: object + groups: + description: The customer groups the customer belongs to. Available if the relation `groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionCustomerGroup: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + type: object + required: + - condition_id + - created_at + - customer_group_id + - metadata + - updated_at + properties: + customer_group_id: + description: The ID of the Product Tag + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + customer_group: + description: Available if the relation `customer_group` is expanded. + nullable: true + $ref: '#/components/schemas/CustomerGroup' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductCollection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + type: object + required: + - condition_id + - created_at + - metadata + - product_collection_id + - updated_at + properties: + product_collection_id: + description: The ID of the Product Collection + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_collection: + description: Available if the relation `product_collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductTag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + type: object + required: + - condition_id + - created_at + - metadata + - product_tag_id + - updated_at + properties: + product_tag_id: + description: The ID of the Product Tag + type: string + example: ptag_01F0YESHPZYY3H4SJ3A5918SBN + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_tag: + description: Available if the relation `product_tag` is expanded. + nullable: true + $ref: '#/components/schemas/ProductTag' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductType: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + type: object + required: + - condition_id + - created_at + - metadata + - product_type_id + - updated_at + properties: + product_type_id: + description: The ID of the Product Tag + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProduct: + title: Product Discount Condition + description: Associates a discount condition with a product + type: object + required: + - condition_id + - created_at + - metadata + - product_id + - updated_at + properties: + product_id: + description: The ID of the Product Tag + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountCondition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + type: object + required: + - created_at + - deleted_at + - discount_rule_id + - id + - metadata + - operator + - type + - updated_at + properties: + id: + description: The discount condition's ID + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + operator: + description: The operator of the Condition + type: string + enum: + - in + - not_in + discount_rule_id: + description: The ID of the discount rule associated with the condition + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + discount_rule: + description: Available if the relation `discount_rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + products: + description: products associated with this condition if type = products. Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + product_tags: + description: Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + product_collections: + description: Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductCollection' + customer_groups: + description: Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountRule: + title: Discount Rule + description: Holds the rules that governs how a Discount is calculated when applied to a Cart. + type: object + required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata + - type + - updated_at + - value + properties: + id: + description: The discount rule's ID + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + type: + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. + type: string + enum: + - fixed + - percentage + - free_shipping + example: percentage + description: + description: A short description of the discount + nullable: true + type: string + example: 10 Percent + value: + description: The value that the discount represents; this will depend on the type of the discount + type: integer + example: 10 + allocation: + description: The scope that the discount should apply to. + nullable: true + type: string + enum: + - total + - item + example: total + conditions: + description: A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Discount: + title: Discount + description: Represents a discount that can be applied to a cart for promotional purposes. + type: object + required: + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration + properties: + id: + description: The discount's ID + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + code: + description: A unique code for the discount - this will be used by the customer to apply the discount + type: string + example: 10DISC + is_dynamic: + description: A flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts + type: boolean + example: false + rule_id: + description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + rule: + description: Available if the relation `rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + is_disabled: + description: Whether the Discount has been disabled. Disabled discounts cannot be applied to carts + type: boolean + example: false + parent_discount_id: + description: The Discount that the discount was created from. This will always be a dynamic discount + nullable: true + type: string + example: disc_01G8ZH853YPY9B94857DY91YGW + parent_discount: + description: Available if the relation `parent_discount` is expanded. + nullable: true + type: object + starts_at: + description: The time at which the discount can be used. + type: string + format: date-time + ends_at: + description: The time at which the discount can no longer be used. + nullable: true + type: string + format: date-time + valid_duration: + description: Duration the discount runs between + nullable: true + type: string + example: P3Y6M4DT12H30M5S + regions: + description: The Regions in which the Discount can be used. Available if the relation `regions` is expanded. + type: array + items: + $ref: '#/components/schemas/Region' + usage_limit: + description: The maximum number of times that a discount can be used. + nullable: true + type: integer + example: 100 + usage_count: + description: The number of times a discount has been used. + type: integer + example: 50 + default: 0 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DraftOrder: + title: DraftOrder + description: Represents a draft order + type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at + properties: + id: + description: The draft order's ID + type: string + example: dorder_01G8TJFKBG38YYFQ035MSVG03C + status: + description: The status of the draft order + type: string + enum: + - open + - completed + default: open + display_id: + description: The draft order's display ID + type: string + example: 2 + cart_id: + description: The ID of the cart associated with the draft order. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the order associated with the draft order. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + canceled_at: + description: The date the draft order was canceled at. + nullable: true + type: string + format: date-time + completed_at: + description: The date the draft order was completed at. + nullable: true + type: string + format: date-time + no_notification_order: + description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + FulfillmentItem: + title: Fulfillment Item + description: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. + type: object + required: + - fulfillment_id + - item_id + - quantity + properties: + fulfillment_id: + description: The id of the Fulfillment that the Fulfillment Item belongs to. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + item_id: + description: The id of the Line Item that the Fulfillment Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + fulfillment: + description: A fulfillment object. Available if the relation `fulfillment` is expanded. + nullable: true + type: object + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Fulfillment. + type: integer + example: 1 + FulfillmentProvider: + title: Fulfillment Provider + description: Represents a fulfillment provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the fulfillment provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + Fulfillment: + title: Fulfillment + description: Fulfillments are created once store operators can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a provider, which is typically an external shipping aggregator, shipping partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. + type: object + required: + - canceled_at + - claim_order_id + - created_at + - data + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - provider_id + - shipped_at + - swap_id + - tracking_numbers + - updated_at + properties: + id: + description: The fulfillment's ID + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + claim_order_id: + description: The id of the Claim that the Fulfillment belongs to. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Fulfillment belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + order_id: + description: The id of the Order that the Fulfillment belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + provider_id: + description: The id of the Fulfillment Provider responsible for handling the fulfillment + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + location_id: + description: The id of the stock location the fulfillment will be shipped from + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + items: + description: The Fulfillment Items in the Fulfillment - these hold information about how many of each Line Item has been fulfilled. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentItem' + tracking_links: + description: The Tracking Links that can be used to track the status of the Fulfillment, these will usually be provided by the Fulfillment Provider. Available if the relation `tracking_links` is expanded. + type: array + items: + $ref: '#/components/schemas/TrackingLink' + tracking_numbers: + description: The tracking numbers that can be used to track the status of the fulfillment. + deprecated: true + type: array + items: + type: string + data: + description: This contains all the data necessary for the Fulfillment provider to handle the fulfillment. + type: object + example: {} + shipped_at: + description: The date with timezone at which the Fulfillment was shipped. + nullable: true + type: string + format: date-time + no_notification: + description: Flag for describing whether or not notifications related to this should be sent. + nullable: true + type: boolean + example: false + canceled_at: + description: The date with timezone at which the Fulfillment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of the fulfillment in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + GiftCardTransaction: + title: Gift Card Transaction + description: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order + type: object + required: + - amount + - created_at + - gift_card_id + - id + - is_taxable + - order_id + - tax_rate + properties: + id: + description: The gift card transaction's ID + type: string + example: gct_01G8X9A7ESKAJXG2H0E6F1MW7A + gift_card_id: + description: The ID of the Gift Card that was used in the transaction. + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + gift_card: + description: A gift card object. Available if the relation `gift_card` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Gift Card was used to pay for. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + amount: + description: The amount that was used from the Gift Card. + type: integer + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + is_taxable: + description: Whether the transaction is taxable or not. + nullable: true + type: boolean + example: false + tax_rate: + description: The tax rate of the transaction + nullable: true + type: number + example: 0 + GiftCard: + title: Gift Card + description: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. + type: object + required: + - balance + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - metadata + - order_id + - region_id + - tax_rate + - updated_at + - value + properties: + id: + description: The gift card's ID + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + code: + description: The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card. + type: string + example: 3RFT-MH2C-Y4YZ-XMN4 + value: + description: The value that the Gift Card represents. + type: integer + example: 10 + balance: + description: The remaining value on the Gift Card. + type: integer + example: 10 + region_id: + description: The id of the Region in which the Gift Card is available. + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + order_id: + description: The id of the Order that the Gift Card was purchased in. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + is_disabled: + description: Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts. + type: boolean + default: false + ends_at: + description: The time at which the Gift Card can no longer be used. + nullable: true + type: string + format: date-time + tax_rate: + description: The gift card's tax rate that will be applied on calculating totals + nullable: true + type: number + example: 0 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + IdempotencyKey: + title: Idempotency Key + description: Idempotency Key is used to continue a process in case of any failure that might occur. + type: object + required: + - created_at + - id + - idempotency_key + - locked_at + - recovery_point + - response_code + - response_body + - request_method + - request_params + - request_path + properties: + id: + description: The idempotency key's ID + type: string + example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A + idempotency_key: + description: The unique randomly generated key used to determine the state of a process. + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: Date which the idempotency key was locked. + type: string + format: date-time + locked_at: + description: Date which the idempotency key was locked. + nullable: true + type: string + format: date-time + request_method: + description: The method of the request + nullable: true + type: string + example: POST + request_params: + description: The parameters passed to the request + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + request_path: + description: The request's path + nullable: true + type: string + example: /store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete + response_code: + description: The response's code. + nullable: true + type: string + example: 200 + response_body: + description: The response's body + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + recovery_point: + description: Where to continue from. + type: string + default: started + Image: + title: Image + description: Images holds a reference to a URL at which the image file can be found. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + type: string + description: The image's ID + example: img_01G749BFYR6T8JTVW6SGW3K3E6 + url: + description: The URL at which the image file can be found. + type: string + format: uri + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Invite: + title: Invite + description: Represents an invite + type: object + required: + - accepted + - created_at + - deleted_at + - expires_at + - id + - metadata + - role + - token + - updated_at + - user_email + properties: + id: + type: string + description: The invite's ID + example: invite_01G8TKE4XYCTHSCK2GDEP47RE1 + user_email: + description: The email of the user being invited. + type: string + format: email + role: + description: The user's role. + nullable: true + type: string + enum: + - admin + - member + - developer + default: member + accepted: + description: Whether the invite was accepted or not. + type: boolean + default: false + token: + description: The token used to accept the invite. + type: string + expires_at: + description: The date the invite expires at. + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemAdjustment: + title: Line Item Adjustment + description: Represents a Line Item Adjustment + type: object + required: + - amount + - description + - discount_id + - id + - item_id + - metadata + properties: + id: + description: The Line Item Adjustment's ID + type: string + example: lia_01G8TKE4XYCTHSCK2GDEP47RE1 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + description: + description: The line item's adjustment description + type: string + example: Adjusted item's price. + discount_id: + description: The ID of the discount associated with the adjustment + nullable: true + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + discount: + description: Available if the relation `discount` is expanded. + nullable: true + $ref: '#/components/schemas/Discount' + amount: + description: The adjustment amount + type: integer + example: 1000 + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemTaxLine: + title: Line Item Tax Line + description: Represents a Line Item Tax Line + type: object + required: + - code + - created_at + - id + - item_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItem: + title: Line Item + description: Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. + type: object + required: + - allow_discounts + - cart_id + - claim_order_id + - created_at + - description + - fulfilled_quantity + - has_shipping + - id + - is_giftcard + - is_return + - metadata + - order_edit_id + - order_id + - original_item_id + - quantity + - returned_quantity + - shipped_quantity + - should_merge + - swap_id + - thumbnail + - title + - unit_price + - updated_at + - variant_id + properties: + id: + description: The line item's ID + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + cart_id: + description: The ID of the Cart that the Line Item belongs to. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Line Item belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Line Item belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + claim_order_id: + description: The id of the Claim that the Line Item belongs to. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemTaxLine' + adjustments: + description: Available if the relation `adjustments` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemAdjustment' + original_item_id: + description: The id of the original line item + nullable: true + type: string + order_edit_id: + description: The ID of the order edit to which a cloned item belongs + nullable: true + type: string + order_edit: + description: The order edit joined. Available if the relation `order_edit` is expanded. + nullable: true + type: object + title: + description: The title of the Line Item, this should be easily identifiable by the Customer. + type: string + example: Medusa Coffee Mug + description: + description: A more detailed description of the contents of the Line Item. + nullable: true + type: string + example: One Size + thumbnail: + description: A URL string to a small image of the contents of the Line Item. + nullable: true + type: string + format: uri + example: https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png + is_return: + description: Is the item being returned + type: boolean + default: false + is_giftcard: + description: Flag to indicate if the Line Item is a Gift Card. + type: boolean + default: false + should_merge: + description: Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item. + type: boolean + default: true + allow_discounts: + description: Flag to indicate if the Line Item should be included when doing discount calculations. + type: boolean + default: true + has_shipping: + description: Flag to indicate if the Line Item has fulfillment associated with it. + nullable: true + type: boolean + example: false + unit_price: + description: The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to. + type: integer + example: 8000 + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + quantity: + description: The quantity of the content in the Line Item. + type: integer + example: 1 + fulfilled_quantity: + description: The quantity of the Line Item that has been fulfilled. + nullable: true + type: integer + example: 0 + returned_quantity: + description: The quantity of the Line Item that has been returned. + nullable: true + type: integer + example: 0 + shipped_quantity: + description: The quantity of the Line Item that has been shipped. + nullable: true + type: integer + example: 0 + refundable: + description: The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration. + type: integer + example: 0 + subtotal: + description: The subtotal of the line item + type: integer + example: 8000 + tax_total: + description: The total of tax of the line item + type: integer + example: 0 + total: + description: The total amount of the line item + type: integer + example: 8000 + original_total: + description: The original total amount of the line item + type: integer + example: 8000 + original_tax_total: + description: The original tax total amount of the line item + type: integer + example: 0 + discount_total: + description: The total of discount of the line item + type: integer + example: 0 + gift_card_total: + description: The total of the gift card of the line item + type: integer + example: 0 + includes_tax: + description: '[EXPERIMENTAL] Indicates if the line item unit_price include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + MoneyAmount: + title: Money Amount + description: Money Amounts represents an amount that a given Product Variant can be purcased for. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. + type: object + required: + - amount + - created_at + - currency_code + - deleted_at + - id + - max_quantity + - min_quantity + - price_list_id + - region_id + - updated_at + - variant_id + properties: + id: + description: The money amount's ID + type: string + example: ma_01F0YESHRFQNH5S8Q0PK84YYZN + currency_code: + description: The 3 character currency code that the Money Amount is given in. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount: + description: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. + type: integer + example: 100 + min_quantity: + description: The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. + nullable: true + type: integer + example: 1 + max_quantity: + description: The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. + nullable: true + type: integer + example: 1 + price_list_id: + description: The ID of the price list associated with the money amount + nullable: true + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + price_list: + description: Available if the relation `price_list` is expanded. + nullable: true + type: object + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true + type: object + region_id: + description: The region's ID + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Note: + title: Note + description: Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. + type: object + required: + - author_id + - created_at + - deleted_at + - id + - metadata + - resource_id + - resource_type + - updated_at + - value + properties: + id: + description: The note's ID + type: string + example: note_01G8TM8ENBMC7R90XRR1G6H26Q + resource_type: + description: The type of resource that the Note refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Note refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + value: + description: The contents of the note. + type: string + example: This order must be fulfilled on Monday + author_id: + description: The ID of the author (user) + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + author: + description: Available if the relation `author` is expanded. + nullable: true + $ref: '#/components/schemas/User' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + NotificationProvider: + title: Notification Provider + description: Represents a notification provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the notification provider as given by the plugin. + type: string + example: sendgrid + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + Notification: + title: Notification + description: Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. + type: object + required: + - created_at + - customer_id + - data + - event_name + - id + - parent_id + - provider_id + - resource_type + - resource_id + - to + - updated_at + properties: + id: + description: The notification's ID + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + event_name: + description: The name of the event that the notification was sent for. + nullable: true + type: string + example: order.placed + resource_type: + description: The type of resource that the Notification refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Notification refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + customer_id: + description: The ID of the Customer that the Notification was sent to. + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + to: + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id + type: string + example: user@example.com + data: + description: The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend. + type: object + example: {} + parent_id: + description: The notification's parent ID + nullable: true + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + parent_notification: + description: Available if the relation `parent_notification` is expanded. + nullable: true + type: object + resends: + description: The resends that have been completed after the original Notification. Available if the relation `resends` is expanded. + type: array + items: + type: object + provider_id: + description: The id of the Notification Provider that handles the Notification. + nullable: true + type: string + example: sengrid + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/NotificationProvider' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + OAuth: + title: OAuth + description: Represent an OAuth app + type: object + required: + - application_name + - data + - display_name + - id + - install_url + - uninstall_url + properties: + id: + description: The app's ID + type: string + example: example_app + display_name: + description: The app's display name + type: string + example: Example app + application_name: + description: The app's name + type: string + example: example + install_url: + description: The URL to install the app + nullable: true + type: string + format: uri + uninstall_url: + description: The URL to uninstall the app + nullable: true + type: string + format: uri + data: + description: Any data necessary to the app. + nullable: true + type: object + example: {} + OrderEdit: + title: Order Edit + description: Order edit keeps track of order items changes. + type: object + required: + - canceled_at + - canceled_by + - confirmed_by + - confirmed_at + - created_at + - created_by + - declined_at + - declined_by + - declined_reason + - id + - internal_note + - order_id + - payment_collection_id + - requested_at + - requested_by + - status + - updated_at + properties: + id: + description: The order edit's ID + type: string + example: oe_01G8TJSYT9M6AVS5N4EMNFS1EK + order_id: + description: The ID of the order that is edited + type: string + example: order_01G2SG30J8C85S4A5CHM2S1NS2 + order: + description: Available if the relation `order` is expanded. + nullable: true + type: object + changes: + description: Available if the relation `changes` is expanded. + type: array + items: + $ref: '#/components/schemas/OrderItemChange' + internal_note: + description: An optional note with additional details about the order edit. + nullable: true + type: string + example: Included two more items B to the order. + created_by: + description: The unique identifier of the user or customer who created the order edit. + type: string + requested_by: + description: The unique identifier of the user or customer who requested the order edit. + nullable: true + type: string + requested_at: + description: The date with timezone at which the edit was requested. + nullable: true + type: string + format: date-time + confirmed_by: + description: The unique identifier of the user or customer who confirmed the order edit. + nullable: true + type: string + confirmed_at: + description: The date with timezone at which the edit was confirmed. + nullable: true + type: string + format: date-time + declined_by: + description: The unique identifier of the user or customer who declined the order edit. + nullable: true + type: string + declined_at: + description: The date with timezone at which the edit was declined. + nullable: true + type: string + format: date-time + declined_reason: + description: An optional note why the order edit is declined. + nullable: true + type: string + canceled_by: + description: The unique identifier of the user or customer who cancelled the order edit. + nullable: true + type: string + canceled_at: + description: The date with timezone at which the edit was cancelled. + nullable: true + type: string + format: date-time + subtotal: + description: The total of subtotal + type: integer + example: 8000 + discount_total: + description: The total of discount + type: integer + example: 800 + shipping_total: + description: The total of the shipping amount + type: integer + example: 800 + gift_card_total: + description: The total of the gift card amount + type: integer + example: 800 + gift_card_tax_total: + description: The total of the gift card tax amount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + total: + description: The total amount of the edited order. + type: integer + example: 8200 + difference_due: + description: The difference between the total amount of the order and total amount of edited order. + type: integer + example: 8200 + status: + description: The status of the order edit. + type: string + enum: + - confirmed + - declined + - requested + - created + - canceled + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + payment_collection_id: + description: The ID of the payment collection + nullable: true + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + nullable: true + $ref: '#/components/schemas/PaymentCollection' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + OrderItemChange: + title: Order Item Change + description: Represents an order edit item change + type: object + required: + - created_at + - deleted_at + - id + - line_item_id + - order_edit_id + - original_line_item_id + - type + - updated_at + properties: + id: + description: The order item change's ID + type: string + example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The order item change's status + type: string + enum: + - item_add + - item_remove + - item_update + order_edit_id: + description: The ID of the order edit + type: string + example: oe_01G2SG30J8C85S4A5CHM2S1NS2 + order_edit: + description: Available if the relation `order_edit` is expanded. + nullable: true + type: object + original_line_item_id: + description: The ID of the original line item in the order + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + original_line_item: + description: Available if the relation `original_line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + line_item_id: + description: The ID of the cloned line item. + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + line_item: + description: Available if the relation `line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Order: + title: Order + description: Represents an order + type: object + required: + - billing_address_id + - canceled_at + - cart_id + - created_at + - currency_code + - customer_id + - draft_order_id + - display_id + - email + - external_id + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - object + - payment_status + - region_id + - shipping_address_id + - status + - tax_rate + - updated_at + properties: + id: + description: The order's ID + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + status: + description: The order's status + type: string + enum: + - pending + - completed + - archived + - canceled + - requires_action + default: pending + fulfillment_status: + description: The order's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + payment_status: + description: The order's payment status + type: string + enum: + - not_paid + - awaiting + - captured + - partially_refunded + - refunded + - canceled + - requires_action + default: not_paid + display_id: + description: The order's display ID + type: integer + example: 2 + cart_id: + description: The ID of the cart associated with the order + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + customer_id: + description: The ID of the customer associated with the order + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + type: object + email: + description: The email associated with the order + type: string + format: email + billing_address_id: + description: The ID of the billing address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The ID of the shipping address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character currency code that is used in the order + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The order's tax rate + nullable: true + type: number + example: 0 + discounts: + description: The discounts used in the order. Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: The gift cards used in the order. Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + shipping_methods: + description: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + payments: + description: The payments used in the order. Available if the relation `payments` is expanded. + type: array + items: + type: object + fulfillments: + description: The fulfillments used in the order. Available if the relation `fulfillments` is expanded. + type: array + items: + type: object + returns: + description: The returns associated with the order. Available if the relation `returns` is expanded. + type: array + items: + type: object + claims: + description: The claims associated with the order. Available if the relation `claims` is expanded. + type: array + items: + type: object + refunds: + description: The refunds associated with the order. Available if the relation `refunds` is expanded. + type: array + items: + type: object + swaps: + description: The swaps associated with the order. Available if the relation `swaps` is expanded. + type: array + items: + type: object + draft_order_id: + description: The ID of the draft order this order is associated with. + nullable: true + type: string + example: null + draft_order: + description: A draft order object. Available if the relation `draft_order` is expanded. + nullable: true + type: object + items: + description: The line items that belong to the order. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + edits: + description: Order edits done on the order. Available if the relation `edits` is expanded. + type: array + items: + type: object + gift_card_transactions: + description: The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCardTransaction' + canceled_at: + description: The date the order was canceled on. + nullable: true + type: string + format: date-time + no_notification: + description: Flag for describing whether or not notifications related to this should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the processing of the order in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + external_id: + description: The ID of an external order. + nullable: true + type: string + example: null + sales_channel_id: + description: The ID of the sales channel this order is associated with. + nullable: true + type: string + example: null + sales_channel: + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + shipping_total: + type: integer + description: The total of shipping + example: 1000 + discount_total: + description: The total of discount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order is returned. + type: integer + example: 0 + total: + description: The total amount of the order + type: integer + example: 8200 + subtotal: + description: The subtotal of the order + type: integer + example: 8000 + paid_total: + description: The total amount paid + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + returnable_items: + description: The items that are returnable as part of the order, order swaps or order claims + type: array + items: + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentCollection: + title: Payment Collection + description: Payment Collection + type: object + required: + - amount + - authorized_amount + - created_at + - created_by + - currency_code + - deleted_at + - description + - id + - metadata + - region_id + - status + - type + - updated_at + properties: + id: + description: The payment collection's ID + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The type of the payment collection + type: string + enum: + - order_edit + status: + description: The type of the payment collection + type: string + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - canceled + description: + description: Description of the payment collection + nullable: true + type: string + amount: + description: Amount of the payment collection. + type: integer + authorized_amount: + description: Authorized amount of the payment collection. + nullable: true + type: integer + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + payment_sessions: + description: Available if the relation `payment_sessions` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentSession' + payments: + description: Available if the relation `payments` is expanded. + type: array + items: + $ref: '#/components/schemas/Payment' + created_by: + description: The ID of the user that created the payment collection. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentProvider: + title: Payment Provider + description: Represents a Payment Provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the payment provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + PaymentSession: + title: Payment Session + description: Payment Sessions are created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, who is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. + type: object + required: + - amount + - cart_id + - created_at + - data + - id + - is_initiated + - is_selected + - idempotency_key + - payment_authorized_at + - provider_id + - status + - updated_at + properties: + id: + description: The payment session's ID + type: string + example: ps_01G901XNSRM2YS3ASN9H5KG3FZ + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + provider_id: + description: The id of the Payment Provider that is responsible for the Payment Session + type: string + example: manual + is_selected: + description: A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase. + nullable: true + type: boolean + example: true + is_initiated: + description: A flag to indicate if a communication with the third party provider has been initiated. + type: boolean + default: false + example: true + status: + description: Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer. + type: string + enum: + - authorized + - pending + - requires_more + - error + - canceled + example: pending + data: + description: The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. + type: object + example: {} + idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + amount: + description: The amount that the Payment Session has been authorized for. + nullable: true + type: integer + example: 100 + payment_authorized_at: + description: The date with timezone at which the Payment Session was authorized. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + Payment: + title: Payment + description: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. + type: object + required: + - amount + - amount_refunded + - canceled_at + - captured_at + - cart_id + - created_at + - currency_code + - data + - id + - idempotency_key + - metadata + - order_id + - provider_id + - swap_id + - updated_at + properties: + id: + description: The payment's ID + type: string + example: pay_01G2SJNT6DEEWDFNAJ4XWDTHKE + swap_id: + description: The ID of the Swap that the Payment is used for. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Payment is used for. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + amount: + description: The amount that the Payment has been authorized for. + type: integer + example: 100 + currency_code: + description: The 3 character ISO currency code that the Payment is completed in. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount_refunded: + description: The amount of the original Payment amount that has been refunded back to the Customer. + type: integer + default: 0 + example: 0 + provider_id: + description: The id of the Payment Provider that is responsible for the Payment + type: string + example: manual + data: + description: The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. + type: object + example: {} + captured_at: + description: The date with timezone at which the Payment was captured. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Payment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of a payment in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PriceList: + title: Price List + description: Price Lists represents a set of prices that overrides the default price for one or more product variants. + type: object + required: + - created_at + - deleted_at + - description + - ends_at + - id + - name + - starts_at + - status + - type + - updated_at + properties: + id: + description: The price list's ID + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + name: + description: The price list's name + type: string + example: VIP Prices + description: + description: The price list's description + type: string + example: Prices for VIP customers + type: + description: The type of Price List. This can be one of either `sale` or `override`. + type: string + enum: + - sale + - override + default: sale + status: + description: The status of the Price List + type: string + enum: + - active + - draft + default: draft + starts_at: + description: The date with timezone that the Price List starts being valid. + nullable: true + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + nullable: true + type: string + format: date-time + customer_groups: + description: The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + prices: + description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + includes_tax: + description: '[EXPERIMENTAL] Does the price list prices include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductCategory: + title: ProductCategory + description: Represents a product category + x-resourceId: ProductCategory + type: object + required: + - category_children + - created_at + - deleted_at + - handle + - id + - is_active + - is_internal + - mpath + - name + - parent_category_id + - updated_at + properties: + id: + description: The product category's ID + type: string + example: pcat_01G2SG30J8C85S4A5CHM2S1NS2 + name: + description: The product category's name + type: string + example: Regular Fit + handle: + description: A unique string that identifies the Product Category - can for example be used in slug structures. + type: string + example: regular-fit + mpath: + description: A string for Materialized Paths - used for finding ancestors and descendents + nullable: true + type: string + example: pcat_id1.pcat_id2.pcat_id3 + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + default: false + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + default: false + category_children: + description: Available if the relation `category_children` are expanded. + type: array + items: + type: object + parent_category_id: + description: The ID of the parent category. + nullable: true + type: string + default: null + parent_category: + description: A product category object. Available if the relation `parent_category` is expanded. + nullable: true + type: object + products: + description: Products associated with category. Available if the relation `products` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductCollection: + title: Product Collection + description: Product Collections represents a group of Products that are related. + type: object + required: + - created_at + - deleted_at + - handle + - id + - metadata + - title + - updated_at + properties: + id: + description: The product collection's ID + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + title: + description: The title that the Product Collection is identified by. + type: string + example: Summer Collection + handle: + description: A unique string that identifies the Product Collection - can for example be used in slug structures. + nullable: true + type: string + example: summer-collection + products: + description: The Products contained in the Product Collection. Available if the relation `products` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOptionValue: + title: Product Option Value + description: A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - option_id + - updated_at + - value + - variant_id + properties: + id: + description: The product option value's ID + type: string + example: optval_01F0YESHR7S6ECD03RF6W12DSJ + value: + description: The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is \"Size\" this value could be `Small`, `Medium` or `Large`). + type: string + example: large + option_id: + description: The ID of the Product Option that the Product Option Value is defined for. + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + option: + description: Available if the relation `option` is expanded. + nullable: true + type: object + variant_id: + description: The ID of the Product Variant that the Product Option Value is defined for. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: Available if the relation `variant` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOption: + title: Product Option + description: Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - product_id + - title + - updated_at + properties: + id: + description: The product option's ID + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + title: + description: The title that the Product Option is defined by (e.g. `Size`). + type: string + example: Size + values: + description: The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + product_id: + description: The ID of the Product that the Product Option is defined for. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTag: + title: Product Tag + description: Product Tags can be added to Products for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product tag's ID + type: string + example: ptag_01G8K2MTMG9168F2B70S1TAVK3 + value: + description: The value that the Product Tag represents + type: string + example: Pants + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTaxRate: + title: Product Tax Rate + description: Associates a tax rate with a product to indicate that the product is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_id + - rate_id + - updated_at + properties: + product_id: + description: The ID of the Product + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTypeTaxRate: + title: Product Type Tax Rate + description: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_type_id + - rate_id + - updated_at + properties: + product_type_id: + description: The ID of the Product type + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + rate_id: + description: The id of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductType: + title: Product Type + description: Product Type can be added to Products for filtering and reporting purposes. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product type's ID + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + value: + description: The value that the Product Type represents. + type: string + example: Clothing + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductVariantInventoryItem: + title: Product Variant Inventory Item + description: Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant. + type: object + required: + - created_at + - deleted_at + - id + - inventory_item_id + - required_quantity + - updated_at + - variant_id + properties: + id: + description: The product variant inventory item's ID + type: string + example: pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A + inventory_item_id: + description: The id of the inventory item + type: string + variant_id: + description: The id of the variant. + type: string + variant: + description: A ProductVariant object. Available if the relation `variant` is expanded. + nullable: true + type: object + required_quantity: + description: The quantity of an inventory item required for one quantity of the variant. + type: integer + default: 1 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductVariant: + title: Product Variant + description: Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. + type: object + required: + - allow_backorder + - barcode + - created_at + - deleted_at + - ean + - height + - hs_code + - id + - inventory_quantity + - length + - manage_inventory + - material + - metadata + - mid_code + - origin_country + - product_id + - sku + - title + - upc + - updated_at + - weight + - width + properties: + id: + description: The product variant's ID + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + title: + description: A title that can be displayed for easy identification of the Product Variant. + type: string + example: Small + product_id: + description: The ID of the Product that the Product Variant belongs to. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + type: object + prices: + description: The Money Amounts defined for the Product Variant. Each Money Amount represents a price in a given currency or a price in a specific Region. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + sku: + description: The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems. + nullable: true + type: string + example: shirt-123 + barcode: + description: A generic field for a GTIN number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + ean: + description: An EAN barcode number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + upc: + description: A UPC barcode number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + variant_rank: + description: The ranking of this variant + nullable: true + type: number + default: 0 + inventory_quantity: + description: The current quantity of the item that is stocked. + type: integer + example: 100 + allow_backorder: + description: Whether the Product Variant should be purchasable when `inventory_quantity` is 0. + type: boolean + default: false + manage_inventory: + description: Whether Medusa should manage inventory for the Product Variant. + type: boolean + default: true + hs_code: + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + origin_country: + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + weight: + description: The weight of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + length: + description: The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: The height of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + width: + description: The width of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + options: + description: The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + inventory_items: + description: The Inventory Items related to the product variant. Available if the relation `inventory_items` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariantInventoryItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Product: + title: Product + description: Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. + type: object + required: + - collection_id + - created_at + - deleted_at + - description + - discountable + - external_id + - handle + - height + - hs_code + - id + - is_giftcard + - length + - material + - metadata + - mid_code + - origin_country + - profile_id + - status + - subtitle + - type_id + - thumbnail + - title + - updated_at + - weight + - width + properties: + id: + description: The product's ID + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + title: + description: A title that can be displayed for easy identification of the Product. + type: string + example: Medusa Coffee Mug + subtitle: + description: An optional subtitle that can be used to further specify the Product. + nullable: true + type: string + description: + description: A short description of the Product. + nullable: true + type: string + example: Every programmer's best friend. + handle: + description: A unique identifier for the Product (e.g. for slug structure). + nullable: true + type: string + example: coffee-mug + is_giftcard: + description: Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased. + type: boolean + default: false + status: + description: The status of the product + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + images: + description: Images of the Product. Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/Image' + thumbnail: + description: A URL to an image file that can be used to identify the Product. + nullable: true + type: string + format: uri + options: + description: The Product Options that are defined for the Product. Product Variants of the Product will have a unique combination of Product Option Values. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOption' + variants: + description: The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. Available if the relation `variants` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariant' + categories: + description: The product's associated categories. Available if the relation `categories` are expanded. + type: array + items: + $ref: '#/components/schemas/ProductCategory' + profile_id: + description: The ID of the Shipping Profile that the Product belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + weight: + description: The weight of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + length: + description: The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: The height of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + width: + description: The width of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + hs_code: + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + origin_country: + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + collection_id: + description: The Product Collection that the Product belongs to + nullable: true + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + collection: + description: A product collection object. Available if the relation `collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + type_id: + description: The Product type that the Product belongs to + nullable: true + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: Available if the relation `type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + tags: + description: The Product Tags assigned to the Product. Available if the relation `tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + discountable: + description: Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`. + type: boolean + default: true + external_id: + description: The external ID of the product + nullable: true + type: string + example: null + sales_channels: + description: The sales channels the product is associated with. Available if the relation `sales_channels` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PublishableApiKeySalesChannel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + type: object + required: + - publishable_key_id + - sales_channel_id + properties: + sales_channel_id: + description: The sales channel's ID + type: string + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + description: The publishable API key's ID + type: string + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + PublishableApiKey: + title: Publishable API key + description: Publishable API key defines scopes (i.e. resources) that are available within a request. + type: object + required: + - created_at + - created_by + - id + - revoked_by + - revoked_at + - title + - updated_at + properties: + id: + description: The key's ID + type: string + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + description: The unique identifier of the user that created the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by: + description: The unique identifier of the user that revoked the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_at: + description: The date with timezone at which the key was revoked. + nullable: true + type: string + format: date-time + title: + description: The key's title. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + Refund: + title: Refund + description: Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. + type: object + required: + - amount + - created_at + - id + - idempotency_key + - metadata + - note + - order_id + - payment_id + - reason + - updated_at + properties: + id: + description: The refund's ID + type: string + example: ref_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Refund is related to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object + amount: + description: The amount that has be refunded to the Customer. + type: integer + example: 1000 + note: + description: An optional note explaining why the amount was refunded. + nullable: true + type: string + example: I didn't like it + reason: + description: The reason given for the Refund, will automatically be set when processed as part of a Swap, Claim or Return. + type: string + enum: + - discount + - return + - swap + - claim + - other + example: return + idempotency_key: + description: Randomly generated key used to continue the completion of the refund in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Region: + title: Region + description: Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. + type: object + required: + - automatic_taxes + - created_at + - currency_code + - deleted_at + - gift_cards_taxable + - id + - metadata + - name + - tax_code + - tax_provider_id + - tax_rate + - updated_at + properties: + id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + name: + description: The name of the region as displayed to the customer. If the Region only has one country it is recommended to write the country name. + type: string + example: EU + currency_code: + description: The 3 character currency code that the Region uses. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The tax rate that should be charged on purchases in the Region. + type: number + example: 0 + tax_rates: + description: The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded. + type: array + items: + $ref: '#/components/schemas/TaxRate' + tax_code: + description: The tax code used on purchases in the Region. This may be used by other systems for accounting purposes. + nullable: true + type: string + example: null + gift_cards_taxable: + description: Whether the gift cards are taxable or not in this region. + type: boolean + default: true + automatic_taxes: + description: Whether taxes should be automated in this region. + type: boolean + default: true + countries: + description: The countries that are included in the Region. Available if the relation `countries` is expanded. + type: array + items: + $ref: '#/components/schemas/Country' + tax_provider_id: + description: The ID of the tax provider used in this region + nullable: true + type: string + example: null + tax_provider: + description: Available if the relation `tax_provider` is expanded. + nullable: true + $ref: '#/components/schemas/TaxProvider' + payment_providers: + description: The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + fulfillment_providers: + description: The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `fulfillment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentProvider' + includes_tax: + description: '[EXPERIMENTAL] Does the prices for the region include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnItem: + title: Return Item + description: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. + type: object + required: + - is_requested + - item_id + - metadata + - note + - quantity + - reason_id + - received_quantity + - requested_quantity + - return_id + properties: + return_id: + description: The id of the Return that the Return Item belongs to. + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + item_id: + description: The id of the Line Item that the Return Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + return_order: + description: Available if the relation `return_order` is expanded. + nullable: true + type: object + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Return. + type: integer + example: 1 + is_requested: + description: Whether the Return Item was requested initially or received unexpectedly in the warehouse. + type: boolean + default: true + requested_quantity: + description: The quantity that was originally requested to be returned. + nullable: true + type: integer + example: 1 + received_quantity: + description: The quantity that was received in the warehouse. + nullable: true + type: integer + example: 1 + reason_id: + description: The ID of the reason for returning the item. + nullable: true + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + reason: + description: Available if the relation `reason` is expanded. + nullable: true + $ref: '#/components/schemas/ReturnReason' + note: + description: An optional note with additional details about the Return. + nullable: true + type: string + example: I didn't like it. + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnReason: + title: Return Reason + description: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. + type: object + required: + - created_at + - deleted_at + - description + - id + - label + - metadata + - parent_return_reason_id + - updated_at + - value + properties: + id: + description: The return reason's ID + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + value: + description: The value to identify the reason by. + type: string + example: damaged + label: + description: A text that can be displayed to the Customer as a reason. + type: string + example: Damaged goods + description: + description: A description of the Reason. + nullable: true + type: string + example: Items that are damaged + parent_return_reason_id: + description: The ID of the parent reason. + nullable: true + type: string + example: null + parent_return_reason: + description: Available if the relation `parent_return_reason` is expanded. + nullable: true + type: object + return_reason_children: + description: Available if the relation `return_reason_children` is expanded. + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Return: + title: Return + description: Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. + type: object + required: + - claim_order_id + - created_at + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - received_at + - refund_amount + - shipping_data + - status + - swap_id + - updated_at + properties: + id: + description: The return's ID + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + status: + description: Status of the Return. + type: string + enum: + - requested + - received + - requires_action + - canceled + default: requested + items: + description: The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/ReturnItem' + swap_id: + description: The ID of the Swap that the Return is a part of. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + claim_order_id: + description: The ID of the Claim that the Return is a part of. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Return is made from. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + shipping_method: + description: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingMethod' + shipping_data: + description: Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment. + nullable: true + type: object + example: {} + location_id: + description: The id of the stock location the return will be added back. + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + refund_amount: + description: The amount that should be refunded as a result of the return. + type: integer + example: 1000 + no_notification: + description: When set to true, no notification will be sent related to this return. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the return in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + received_at: + description: The date with timezone at which the return was received. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + SalesChannelLocation: + title: Sales Channel Stock Location + description: Sales Channel Stock Location link sales channels with stock locations. + type: object + required: + - created_at + - deleted_at + - id + - location_id + - sales_channel_id + - updated_at + properties: + id: + description: The Sales Channel Stock Location's ID + type: string + example: scloc_01G8X9A7ESKAJXG2H0E6F1MW7A + sales_channel_id: + description: The id of the Sales Channel + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + location_id: + description: The id of the Location Stock. + type: string + sales_channel: + description: The sales channel the location is associated with. Available if the relation `sales_channel` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + SalesChannel: + title: Sales Channel + description: A Sales Channel + type: object + required: + - created_at + - deleted_at + - description + - id + - is_disabled + - name + - updated_at + properties: + id: + description: The sales channel's ID + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + name: + description: The name of the sales channel. + type: string + example: Market + description: + description: The description of the sales channel. + nullable: true + type: string + example: Multi-vendor market + is_disabled: + description: Specify if the sales channel is enabled or disabled. + type: boolean + default: false + locations: + description: The Stock Locations related to the sales channel. Available if the relation `locations` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannelLocation' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingMethodTaxLine: + title: Shipping Method Tax Line + description: Shipping Method Tax Line + type: object + required: + - code + - created_at + - id + - shipping_method_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + shipping_method_id: + description: The ID of the line item + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_method: + description: Available if the relation `shipping_method` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingMethod: + title: Shipping Method + description: Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. + type: object + required: + - cart_id + - claim_order_id + - data + - id + - order_id + - price + - return_id + - shipping_option_id + - swap_id + properties: + id: + description: The shipping method's ID + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_option_id: + description: The id of the Shipping Option that the Shipping Method is built from. + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Shipping Method is used on. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + claim_order_id: + description: The id of the Claim that the Shipping Method is used on. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + cart_id: + description: The id of the Cart that the Shipping Method is used on. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Shipping Method is used on. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + return_id: + description: The id of the Return that the Shipping Method is used on. + nullable: true + type: string + example: null + return_order: + description: A return object. Available if the relation `return_order` is expanded. + nullable: true + type: object + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethodTaxLine' + price: + description: The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of. + type: integer + example: 200 + data: + description: Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' + type: boolean + default: false + subtotal: + description: The subtotal of the shipping + type: integer + example: 8000 + total: + description: The total amount of the shipping + type: integer + example: 8200 + tax_total: + description: The total of tax + type: integer + example: 0 + ShippingOptionRequirement: + title: Shipping Option Requirement + description: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. + type: object + required: + - amount + - deleted_at + - id + - shipping_option_id + - type + properties: + id: + description: The shipping option requirement's ID + type: string + example: sor_01G1G5V29AB4CTNDRFSRWSRKWD + shipping_option_id: + description: The id of the Shipping Option that the hipping option requirement belongs to + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + type: object + type: + description: The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available. + type: string + enum: + - min_subtotal + - max_subtotal + example: min_subtotal + amount: + description: The amount to compare the Cart subtotal to. + type: integer + example: 100 + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingOption: + title: Shipping Option + description: Shipping Options represent a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. + type: object + required: + - admin_only + - amount + - created_at + - data + - deleted_at + - id + - is_return + - metadata + - name + - price_type + - profile_id + - provider_id + - region_id + - updated_at + properties: + id: + description: The shipping option's ID + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + name: + description: The name given to the Shipping Option - this may be displayed to the Customer. + type: string + example: PostFake Standard + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + profile_id: + description: The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + provider_id: + description: The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option. + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + price_type: + description: The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations. + type: string + enum: + - flat_rate + - calculated + example: flat_rate + amount: + description: The amount to charge for shipping when the Shipping Option price type is `flat_rate`. + nullable: true + type: integer + example: 200 + is_return: + description: Flag to indicate if the Shipping Option can be used for Return shipments. + type: boolean + default: false + admin_only: + description: Flag to indicate if the Shipping Option usage is restricted to admin users. + type: boolean + default: false + requirements: + description: The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingOptionRequirement' + data: + description: The data needed for the Fulfillment Provider to identify the Shipping Option. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Does the shipping option price include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingProfile: + title: Shipping Profile + description: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - type + - updated_at + properties: + id: + description: The shipping profile's ID + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + name: + description: The name given to the Shipping profile - this may be displayed to the Customer. + type: string + example: Default Shipping Profile + type: + description: The type of the Shipping Profile, may be `default`, `gift_card` or `custom`. + type: string + enum: + - default + - gift_card + - custom + example: default + products: + description: The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. + type: array + items: + type: object + shipping_options: + description: The Shipping Options that can be used to fulfill the Products in the Shipping Profile. Available if the relation `shipping_options` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingTaxRate: + title: Shipping Tax Rate + description: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way + type: object + required: + - created_at + - metadata + - rate_id + - shipping_option_id + - updated_at + properties: + shipping_option_id: + description: The ID of the Shipping Option + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + StagedJob: + title: Staged Job + description: A staged job resource + type: object + required: + - data + - event_name + - id + - options + properties: + id: + description: The staged job's ID + type: string + example: job_01F0YET7BZTARY9MKN1SJ7AAXF + event_name: + description: The name of the event + type: string + example: order.placed + data: + description: Data necessary for the job + type: object + example: {} + option: + description: The staged job's option + type: object + example: {} + Store: + title: Store + description: Holds settings for the Store, such as name, currencies, etc. + type: object + required: + - created_at + - default_currency_code + - default_location_id + - id + - invite_link_template + - metadata + - name + - payment_link_template + - swap_link_template + - updated_at + properties: + id: + description: The store's ID + type: string + example: store_01G1G5V21KADXNGH29BJMAJ4B4 + name: + description: The name of the Store - this may be displayed to the Customer. + type: string + example: Medusa Store + default_currency_code: + description: The 3 character currency code that is the default of the store. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + default_currency: + description: Available if the relation `default_currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + currencies: + description: The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. + type: array + items: + $ref: '#/components/schemas/Currency' + swap_link_template: + description: A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link. + nullable: true + type: string + example: null + payment_link_template: + description: A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link. + nullable: true + type: string + example: null + invite_link_template: + description: A template to generate Invite links from + nullable: true + type: string + example: null + default_location_id: + description: The location ID the store is associated with. + nullable: true + type: string + example: null + default_sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + default_sales_channel: + description: A sales channel object. Available if the relation `default_sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Swap: + title: Swap + description: Swaps can be created when a Customer wishes to exchange Products that they have purchased to different Products. Swaps consist of a Return of previously purchased Products and a Fulfillment of new Products, the amount paid for the Products being returned will be used towards payment for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. + type: object + required: + - allow_backorder + - canceled_at + - cart_id + - confirmed_at + - created_at + - deleted_at + - difference_due + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - shipping_address_id + - updated_at + properties: + id: + description: The swap's ID + type: string + example: swap_01F0YET86Y9G92D3YDR9Y6V676 + fulfillment_status: + description: The status of the Fulfillment of the Swap. + type: string + enum: + - not_fulfilled + - fulfilled + - shipped + - partially_shipped + - canceled + - requires_action + example: not_fulfilled + payment_status: + description: The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount. + type: string + enum: + - not_paid + - awaiting + - captured + - confirmed + - canceled + - difference_refunded + - partially_refunded + - refunded + - requires_action + example: not_paid + order_id: + description: The ID of the Order where the Line Items to be returned where purchased. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + additional_items: + description: The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + return_order: + description: A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded. + nullable: true + type: object + fulfillments: + description: The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded. + type: array + items: + type: object + payment: + description: The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. + nullable: true + type: object + difference_due: + description: The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products. + nullable: true + type: integer + example: 0 + shipping_address_id: + description: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + cart_id: + description: The id of the Cart that the Customer will use to confirm the Swap. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + confirmed_at: + description: The date with timezone at which the Swap was confirmed by the Customer. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + nullable: true + type: string + format: date-time + no_notification: + description: If set to true, no notification will be sent related to this swap + nullable: true + type: boolean + example: false + allow_backorder: + description: If true, swaps can be completed with items out of stock + type: boolean + default: false + idempotency_key: + description: Randomly generated key used to continue the completion of the swap in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxLine: + title: Tax Line + description: Line item that specifies an amount of tax to add to a line item. + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The tax line's ID + type: string + example: tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxProvider: + title: Tax Provider + description: The tax service used to calculate taxes + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the tax provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + TaxRate: + title: Tax Rate + description: A Tax Rate can be used to associate a certain rate to charge on products within a given Region + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - region_id + - updated_at + properties: + id: + description: The tax rate's ID + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + rate: + description: The numeric rate to charge + nullable: true + type: number + example: 10 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + region_id: + description: The id of the Region that the rate belongs to + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + products: + description: The products that belong to this tax rate. Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: The product types that belong to this tax rate. Available if the relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + shipping_options: + type: array + description: The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. + items: + $ref: '#/components/schemas/ShippingOption' + product_count: + description: The count of products + type: integer + example: 10 + product_type_count: + description: The count of product types + type: integer + example: 2 + shipping_option_count: + description: The count of shipping options + type: integer + example: 1 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TrackingLink: + title: Tracking Link + description: Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. + type: object + required: + - created_at + - deleted_at + - fulfillment_id + - id + - idempotency_key + - metadata + - tracking_number + - updated_at + - url + properties: + id: + description: The tracking link's ID + type: string + example: tlink_01G8ZH853Y6TFXWPG5EYE81X63 + url: + description: The URL at which the status of the shipment can be tracked. + nullable: true + type: string + format: uri + tracking_number: + description: The tracking number given by the shipping carrier. + type: string + format: RH370168054CN + fulfillment_id: + description: The id of the Fulfillment that the Tracking Link references. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + fulfillment: + description: Available if the relation `fulfillment` is expanded. + nullable: true + type: object + idempotency_key: + description: Randomly generated key used to continue the completion of a process in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + User: + title: User + description: Represents a User who can manage store settings. + type: object + required: + - api_token + - created_at + - deleted_at + - email + - first_name + - id + - last_name + - metadata + - role + - updated_at + properties: + id: + description: The user's ID + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + role: + description: The user's role + type: string + enum: + - admin + - member + - developer + default: member + email: + description: The email of the User + type: string + format: email + first_name: + description: The first name of the User + nullable: true + type: string + example: Levi + last_name: + description: The last name of the User + nullable: true + type: string + example: Bogan + api_token: + description: An API token associated with the user. + nullable: true + type: string + example: null + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + material: + description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + weight: + description: The weight of the Inventory Item. May be used in shipping rate calculations. + type: number + height: + description: The height of the Inventory Item. May be used in shipping rate calculations. + type: number + width: + description: The width of the Inventory Item. May be used in shipping rate calculations. + type: number + length: + description: The length of the Inventory Item. May be used in shipping rate calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + ReservationItemDTO: + title: Reservation item + description: Represents a reservation of an inventory item at a stock location + type: object + required: + - id + - location_id + - inventory_item_id + - quantity + properties: + id: + description: The id of the reservation item + type: string + location_id: + description: The id of the location of the reservation + type: string + inventory_item_id: + description: The id of the inventory item the reservation relates to + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + reserved_quantity: + description: the reserved stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + PricedVariant: + title: Priced Product Variant + type: object + allOf: + - $ref: '#/components/schemas/ProductVariant' + - type: object + properties: + original_price: + type: number + description: The original price of the variant without any discounted prices applied. + calculated_price: + type: number + description: The calculated price of the variant. Can be a discounted price. + original_price_incl_tax: + type: number + description: The original price of the variant including taxes. + calculated_price_incl_tax: + type: number + description: The calculated price of the variant including taxes. + original_tax: + type: number + description: The taxes applied on the original price. + calculated_tax: + type: number + description: The taxes applied on the calculated price. + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + PricedProduct: + title: Priced Product + type: object + allOf: + - $ref: '#/components/schemas/Product' + - type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + StockLocationAddressDTO: + title: Stock Location Address + description: Represents a Stock Location Address + type: object + required: + - address_1 + - country_code + - created_at + - updated_at + properties: + id: + type: string + description: The stock location address' ID + example: laddr_51G4ZW853Y6TFXWPG5ENJ81X42 + address_1: + type: string + description: Stock location address + example: 35, Jhon Doe Ave + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + StockLocationDTO: + title: Stock Location + description: Represents a Stock Location + type: object + required: + - id + - name + - address_id + - created_at + - updated_at + properties: + id: + type: string + description: The stock location's ID + example: sloc_51G4ZW853Y6TFXWPG5ENJ81X42 + address_id: + type: string + description: Stock location address' ID + example: laddr_05B2ZE853Y6FTXWPW85NJ81A44 + name: + type: string + description: The name of the stock location + example: Main Warehouse + address: + description: The Address of the Stock Location + allOf: + - $ref: '#/components/schemas/StockLocationAddressDTO' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + StockLocationAddressInput: + title: Stock Location Address Input + description: Represents a Stock Location Address Input + type: object + required: + - address_1 + - country_code + properties: + address_1: + type: string + description: Stock location address + example: 35, Jhon Doe Ave + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + CreateStockLocationInput: + title: Create Stock Location Input + description: Represents the Input to create a Stock Location + type: object + required: + - name + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + UpdateStockLocationInput: + title: Update Stock Location Input + description: Represents the Input to update a Stock Location + type: object + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + MultipleErrors: + title: Multiple Errors + type: object + properties: + errors: + type: array + description: Array of errors + items: + $ref: '#/components/schemas/Error' + message: + type: string + default: Provided request body contains errors. Please check the data and retry the request + Error: + title: Response Error + type: object + properties: + code: + type: string + description: A slug code to indicate the type of the error. + message: + type: string + description: Description of the error that occurred. + type: + type: string + description: A slug indicating the type of the error. + 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. + AdminAppsRes: + type: object + properties: + apps: + $ref: '#/components/schemas/OAuth' + AdminAppsListRes: + type: object + properties: + apps: + type: array + items: + $ref: '#/components/schemas/OAuth' + 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 + AdminAuthRes: + type: object + properties: + user: + $ref: '#/components/schemas/User' + 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 + AdminBatchJobRes: + type: object + properties: + batch_job: + $ref: '#/components/schemas/BatchJob' + AdminBatchJobListRes: + type: object + properties: + batch_jobs: + type: array + items: + $ref: '#/components/schemas/BatchJob' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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 + AdminCollectionsListRes: + 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 + AdminCollectionsDeleteRes: + 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 + AdminDeleteProductsFromCollectionRes: + 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 + AdminCollectionsRes: + type: object + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + 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 + AdminCurrenciesListRes: + 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 + AdminCurrenciesRes: + type: object + properties: + currency: + $ref: '#/components/schemas/Currency' + AdminPostCurrenciesCurrencyReq: + type: object + properties: + includes_tax: + type: boolean + description: '[EXPERIMENTAL] Tax included in prices of currency.' + AdminPostCustomerGroupsGroupCustomersBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to add + type: array + items: + type: object + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminPostCustomerGroupsReq: + type: object + required: + - name + properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. + AdminDeleteCustomerGroupsGroupCustomerBatchReq: + type: object + required: + - customer_ids + properties: + customer_ids: + description: The ids of the customers to remove + type: array + items: + type: object + required: + - id + properties: + id: + description: ID of the customer + type: string + AdminCustomerGroupsRes: + type: object + properties: + customer_group: + $ref: '#/components/schemas/CustomerGroup' + AdminCustomerGroupsDeleteRes: + 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 + AdminCustomerGroupsListRes: + 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 + AdminPostCustomerGroupsGroupReq: + type: object + properties: + name: + description: Name of the customer group + type: string + metadata: + description: Metadata for the customer. + type: object + AdminPostCustomersReq: + type: object + required: + - email + - first_name + - last_name + - password + properties: + email: + type: string + description: The customer's email. + format: email + first_name: + type: string + description: The customer's first name. + last_name: + type: string + description: The customer's last name. + password: + type: string + description: The customer's password. + format: password + phone: + type: string + description: The customer's phone number. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminCustomersRes: + type: object + properties: + customer: + $ref: '#/components/schemas/Customer' + AdminCustomersListRes: + 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 + AdminPostCustomersCustomerReq: + type: object + properties: + email: + type: string + description: The Customer's email. + format: email + first_name: + type: string + description: The Customer's first name. + last_name: + type: string + description: The Customer's last name. + phone: + type: string + description: The Customer's phone number. + password: + type: string + description: The Customer's password. + format: password + groups: + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a customer group + type: string + description: A list of customer groups to which the customer belongs. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminPostDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + type: object + required: + - id + properties: + id: + description: The id of the item + type: string + 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 + AdminPostDiscountsDiscountDynamicCodesReq: + type: object + required: + - code + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + usage_limit: + type: number + description: Maximum times the discount can be used + default: 1 + metadata: + type: object + description: An optional set of key-value pairs to hold additional information. + AdminDeleteDiscountsDiscountConditionsConditionBatchReq: + type: object + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + type: object + required: + - id + properties: + id: + description: The id of the item + type: string + AdminDiscountsRes: + type: object + properties: + discount: + $ref: '#/components/schemas/Discount' + AdminDiscountConditionsRes: + type: object + properties: + discount_condition: + $ref: '#/components/schemas/DiscountCondition' + AdminDiscountsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Discount + object: + type: string + description: The type of the object that was deleted. + default: discount + deleted: + type: boolean + description: Whether the discount was deleted successfully or not. + default: true + AdminDiscountConditionsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted DiscountCondition + object: + type: string + description: The type of the object that was deleted. + default: discount-condition + deleted: + type: boolean + description: Whether the discount condition was deleted successfully or not. + default: true + discount: + description: The Discount to which the condition used to belong + $ref: '#/components/schemas/Discount' + AdminDiscountsListRes: + type: object + properties: + discounts: + type: array + items: + $ref: '#/components/schemas/Discount' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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 + AdminPostDraftOrdersDraftOrderRegisterPaymentRes: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + AdminDraftOrdersRes: + type: object + properties: + draft_order: + $ref: '#/components/schemas/DraftOrder' + AdminDraftOrdersDeleteRes: + 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 + AdminDraftOrdersListRes: + 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 + 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 + AdminGiftCardsRes: + type: object + properties: + gift_card: + $ref: '#/components/schemas/GiftCard' + AdminGiftCardsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Gift Card + object: + type: string + description: The type of the object that was deleted. + default: gift-card + deleted: + type: boolean + description: Whether the gift card was deleted successfully or not. + default: true + AdminGiftCardsListRes: + type: object + properties: + gift_cards: + type: array + items: + $ref: '#/components/schemas/GiftCard' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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 + AdminPostInventoryItemsItemLocationLevelsReq: + type: object + required: + - location_id + - stocked_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + AdminInventoryItemsRes: + type: object + properties: + inventory_item: + $ref: '#/components/schemas/InventoryItemDTO' + AdminInventoryItemsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Inventory Item. + object: + type: string + description: The type of the object that was deleted. + format: inventory_item + deleted: + type: boolean + description: Whether or not the Inventory Item was deleted. + default: true + AdminInventoryItemsListRes: + type: object + properties: + inventory_items: + type: array + items: + $ref: '#/components/schemas/InventoryItemDTO' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsListWithVariantsAndLocationLevelsRes: + type: object + properties: + inventory_items: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryItemDTO' + - type: object + properties: + location_levels: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryLevelDTO' + variants: + type: array + items: + allOf: + - $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsLocationLevelsRes: + type: object + properties: + id: + description: The id of the location + location_levels: + description: List of stock levels at a given location + type: array + items: + $ref: '#/components/schemas/InventoryLevelDTO' + AdminPostInventoryItemsInventoryItemReq: + type: object + properties: + hs_code: + description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + material: + description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + weight: + description: The weight of the Inventory Item. May be used in shipping rate calculations. + type: number + height: + description: The height of the Inventory Item. May be used in shipping rate calculations. + type: number + width: + description: The width of the Inventory Item. May be used in shipping rate calculations. + type: number + length: + description: The length of the Inventory Item. May be used in shipping rate calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + AdminPostInventoryItemsItemLocationLevelsLevelReq: + type: object + properties: + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + 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 + AdminInviteDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Invite. + object: + type: string + description: The type of the object that was deleted. + default: invite + deleted: + type: boolean + description: Whether or not the Invite was deleted. + default: true + AdminListInvitesRes: + type: object + properties: + invites: + type: array + items: + $ref: '#/components/schemas/Invite' + 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. + AdminNotesRes: + type: object + properties: + note: + $ref: '#/components/schemas/Note' + AdminNotesDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Note. + object: + type: string + description: The type of the object that was deleted. + default: note + deleted: + type: boolean + description: Whether or not the Note was deleted. + default: true + AdminNotesListRes: + type: object + properties: + notes: + type: array + items: + $ref: '#/components/schemas/Note' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPostNotesNoteReq: + type: object + required: + - value + properties: + value: + type: string + description: The updated description of the Note. + AdminNotificationsListRes: + type: object + properties: + notifications: + type: array + items: + $ref: '#/components/schemas/Notification' + AdminNotificationsRes: + type: object + properties: + notification: + $ref: '#/components/schemas/Notification' + 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 + AdminOrderEditsRes: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + AdminOrderEditsListRes: + type: object + properties: + order_edits: + type: array + items: + $ref: '#/components/schemas/OrderEdit' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminOrderEditDeleteRes: + 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. + default: order_edit + deleted: + type: boolean + description: Whether or not the Order Edit was deleted. + default: true + AdminOrderEditItemChangeDeleteRes: + 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. + default: item_change + deleted: + type: boolean + description: Whether or not the Order Edit Item Change was deleted. + default: true + 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 + AdminPostOrdersOrderShippingMethodsReq: + type: object + required: + - price + - option_id + properties: + price: + type: number + description: The price (excluding VAT) that should be charged for the Shipping Method + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + date: + type: object + description: The data required for the Shipping Option to create a Shipping Method. This will depend on the Fulfillment Provider. + AdminPostOrdersOrderClaimsClaimShipmentsReq: + type: object + required: + - fulfillment_id + properties: + fulfillment_id: + description: The ID of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + AdminPostOrdersOrderClaimsReq: + type: object + required: + - type + - claim_items + properties: + type: + description: 'The type of the Claim. This will determine how the Claim is treated: `replace` Claims will result in a Fulfillment with new items being created, while a `refund` Claim will refund the amount paid for the claimed items.' + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: A list of image URL's that will be associated with the Claim + items: + type: string + return_shipping: + description: Optional details for the Return Shipping Method, if the items are to be sent back. + type: object + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer when the Claim type is Replace. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + type: object + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + data: + description: An optional set of key-value pairs to hold additional information. + type: object + shipping_address: + 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: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + AdminOrdersOrderLineItemReservationReq: + type: object + required: + - location_id + properties: + location_id: + description: The id of the location of the reservation + type: string + quantity: + description: The quantity to reserve + type: number + 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: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + return_shipping: + description: How the Swap will be returned. + type: object + required: + - option_id + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + custom_shipping_options: + description: The custom shipping options to potentially create a Shipping Method from. + type: array + items: + type: object + required: + - option_id + - price + properties: + option_id: + description: The ID of the Shipping Option to override with a custom price. + type: string + price: + description: The custom price of the Shipping Option. + type: integer + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + allow_backorder: + description: If true, swaps can be completed with items out of stock + type: boolean + default: true + 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 + AdminOrdersRes: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + AdminOrdersListRes: + type: object + properties: + orders: + type: array + items: + $ref: '#/components/schemas/Order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + reason_id: + description: The ID of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: The Shipping Method to be used to handle the return shipment. + type: object + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + note: + description: An optional note with information about the Return. + type: string + receive_now: + description: A flag to indicate if the Return should be registerd as received immediately. + type: boolean + default: false + no_notification: + description: A flag to indicate if no notifications should be emitted related to the requested Return. + type: boolean + refund: + description: The amount to refund. + type: integer + AdminPostOrdersOrderClaimsClaimReq: + type: object + properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + type: object + required: + - id + - images + - tags + properties: + id: + description: The ID of the Claim Item. + type: string + item_id: + description: The ID of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: Short text describing the Claim Item in further detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: object + properties: + id: + type: string + description: Tag ID + value: + type: string + description: Tag value + images: + description: A list of image URL's that will be associated with the Claim + type: array + items: + type: object + properties: + id: + type: string + description: Image ID + url: + type: string + description: Image URL + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + type: object + properties: + id: + description: The ID of an existing Shipping Method + type: string + option_id: + description: The ID of the Shipping Option to create a Shipping Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + data: + description: An optional set of key-value pairs to hold additional information. + type: object + no_notification: + description: If set to true no notification will be send related to this Swap. + type: boolean + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + 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 + AdminPaymentCollectionsRes: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + AdminPaymentCollectionDeleteRes: + 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. + default: payment_collection + deleted: + type: boolean + description: Whether or not the Payment Collection was deleted. + default: true + 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 + AdminPaymentRes: + type: object + properties: + payment: + $ref: '#/components/schemas/Payment' + AdminRefundRes: + type: object + properties: + refund: + $ref: '#/components/schemas/Refund' + AdminPostPaymentRefundsReq: + type: object + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A note with additional details about the Refund. + type: string + AdminPostPriceListPricesPricesReq: + type: object + properties: + prices: + description: The prices to update or add. + type: array + items: + type: object + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + override: + description: If true the prices will replace all existing prices associated with the Price List. + type: boolean + AdminPostPriceListsPriceListReq: + type: object + required: + - name + - description + - type + - prices + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + type: object + required: + - amount + - variant_id + properties: + region_id: + description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + variant_id: + description: The ID of the Variant for which the price is used. + type: string + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + type: object + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminDeletePriceListPricesPricesReq: + type: object + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string + AdminPriceListRes: + type: object + properties: + price_list: + $ref: '#/components/schemas/PriceList' + AdminPriceListDeleteBatchRes: + type: object + properties: + ids: + type: array + items: + type: string + description: The IDs of the deleted Money Amounts (Prices). + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListDeleteProductPricesRes: + type: object + properties: + ids: + type: array + description: The price ids that have been deleted. + items: + type: string + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListDeleteVariantPricesRes: + type: object + properties: + ids: + type: array + description: The price ids that have been deleted. + items: + type: string + object: + type: string + description: The type of the object that was deleted. + default: money-amount + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Price List. + object: + type: string + description: The type of the object that was deleted. + default: price-list + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminPriceListsListRes: + type: object + properties: + price_lists: + type: array + items: + $ref: '#/components/schemas/PriceList' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPriceListsProductsListRes: + type: object + properties: + products: + type: array + items: + $ref: '#/components/schemas/Product' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPostPriceListsPriceListPriceListReq: + type: object + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date + ends_at: + description: The date with timezone that the Price List ends being valid. + type: string + format: date + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + type: object + required: + - amount + - variant_id + properties: + id: + description: The ID of the price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + variant_id: + description: The ID of the Variant for which the price is used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + type: object + required: + - id + properties: + id: + description: The ID of a customer group + type: string + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of price list' + type: boolean + AdminPostProductCategoriesCategoryProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to add to the Product Category + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the product + AdminPostProductCategoriesReq: + type: object + required: + - name + properties: + name: + type: string + description: The name to identify the Product Category by. + handle: + type: string + description: An optional handle to be used in slugs, if none is provided we will kebab-case the title. + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + parent_category_id: + type: string + description: The ID of the parent product category + AdminDeleteProductCategoriesCategoryProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to delete from the Product Category. + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of a product + type: string + AdminProductCategoriesCategoryRes: + type: object + properties: + product_category: + $ref: '#/components/schemas/ProductCategory' + AdminProductCategoriesCategoryDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted product category + object: + type: string + description: The type of the object that was deleted. + default: product-category + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminProductCategoriesListRes: + type: object + properties: + product_categories: + type: array + items: + $ref: '#/components/schemas/ProductCategory' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPostProductCategoriesCategoryReq: + type: object + properties: + name: + type: string + description: The name to identify the Product Category by. + handle: + type: string + description: A handle to be used in slugs. + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + parent_category_id: + type: string + description: The ID of the parent product category + AdminProductTagsListRes: + type: object + properties: + product_tags: + type: array + items: + $ref: '#/components/schemas/ProductTag' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductTypesListRes: + type: object + properties: + product_types: + type: array + items: + $ref: '#/components/schemas/ProductType' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + 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: + type: object + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: The value of the Tag, these will be upserted. + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string + options: + description: The Options that the Product should have. These define on which properties the Product's Product Variants will differ. + type: array + items: + type: object + required: + - title + properties: + title: + description: The title to identify the Product Option by. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + type: object + required: + - title + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: Whether Medusa should keep track of the inventory for this Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + region_id: + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - value + properties: + value: + description: The value to give for the Product Option at the same index in the Product's `options` field. + type: string + weight: + description: The weight of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsProductVariantsReq: + type: object + required: + - title + - prices + - options + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + default: 0 + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: Whether Medusa should keep track of the inventory for this Product Variant. + type: boolean + default: true + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + AdminProductsDeleteOptionRes: + type: object + properties: + option_id: + type: string + description: The ID of the deleted Product Option + object: + type: string + description: The type of the object that was deleted. + default: option + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + product: + $ref: '#/components/schemas/Product' + AdminProductsDeleteVariantRes: + type: object + properties: + variant_id: + type: string + description: The ID of the deleted Product Variant. + object: + type: string + description: The type of the object that was deleted. + default: product-variant + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + product: + $ref: '#/components/schemas/Product' + AdminProductsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Product. + object: + type: string + description: The type of the object that was deleted. + default: product + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminProductsListRes: + type: object + properties: + products: + type: array + items: + oneOf: + - $ref: '#/components/schemas/Product' + - $ref: '#/components/schemas/PricedProduct' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductsListVariantsRes: + type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminProductsListTypesRes: + type: object + properties: + types: + type: array + items: + $ref: '#/components/schemas/ProductType' + AdminProductsListTagsRes: + type: object + properties: + tags: + type: array + items: + type: object + properties: + id: + description: The ID of the tag. + type: string + usage_count: + description: The number of products that use this tag. + type: string + value: + description: The value of the tag. + type: string + AdminProductsRes: + type: object + properties: + product: + $ref: '#/components/schemas/Product' + 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: + type: object + required: + - value + properties: + id: + description: The ID of an existing Tag. + type: string + value: + description: The value of the Tag, these will be upserted. + type: string + sales_channels: + description: '[EXPERIMENTAL] Sales channels to associate the Product with.' + type: array + items: + type: object + required: + - id + properties: + id: + description: The ID of an existing Sales channel. + type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string + variants: + description: A list of Product Variants to create with the Product. + type: array + items: + type: object + properties: + id: + description: The ID of the Product Variant. + type: string + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: Whether Medusa should keep track of the inventory for this Product Variant. + type: boolean + weight: + description: The wieght of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + id: + description: The ID of the Price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - option_id + - value + properties: + option_id: + description: The ID of the Option. + type: string + value: + description: The value to give for the Product Option at the same index in the Product's `options` field. + type: string + weight: + description: The wieght of the Product. + type: number + length: + description: The length of the Product. + type: number + height: + description: The height of the Product. + type: number + width: + description: The width of the Product. + type: number + origin_country: + description: The country of origin of the Product. + type: string + mid_code: + description: The Manufacturer Identification code for the Product. + type: string + material: + description: The material composition of the Product. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + AdminPostProductsProductVariantsVariantReq: + type: object + required: + - prices + properties: + title: + description: The title to identify the Product Variant by. + type: string + sku: + description: The unique SKU for the Product Variant. + type: string + ean: + description: The EAN number of the item. + type: string + upc: + description: The UPC number of the item. + type: string + barcode: + description: A generic GTIN field for the Product Variant. + type: string + hs_code: + description: The Harmonized System code for the Product Variant. + type: string + inventory_quantity: + description: The amount of stock kept for the Product Variant. + type: integer + allow_backorder: + description: Whether the Product Variant can be purchased when out of stock. + type: boolean + manage_inventory: + description: Whether Medusa should keep track of the inventory for this Product Variant. + type: boolean + weight: + description: The weight of the Product Variant. + type: number + length: + description: The length of the Product Variant. + type: number + height: + description: The height of the Product Variant. + type: number + width: + description: The width of the Product Variant. + type: number + origin_country: + description: The country of origin of the Product Variant. + type: string + mid_code: + description: The Manufacturer Identification code for the Product Variant. + type: string + material: + description: The material composition of the Product Variant. + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + prices: + type: array + items: + type: object + required: + - amount + properties: + id: + description: The ID of the price. + type: string + region_id: + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. + type: string + currency_code: + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + options: + type: array + items: + type: object + required: + - option_id + - value + properties: + option_id: + description: The ID of the Product Option to set the value for. + type: string + value: + description: The value to give for the Product Option. + type: string + 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 + AdminPublishableApiKeysRes: + type: object + properties: + publishable_api_key: + $ref: '#/components/schemas/PublishableApiKey' + AdminPublishableApiKeysListRes: + type: object + properties: + publishable_api_keys: + type: array + items: + $ref: '#/components/schemas/PublishableApiKey' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPublishableApiKeyDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted PublishableApiKey. + object: + type: string + description: The type of the object that was deleted. + default: publishable_api_key + deleted: + type: boolean + description: Whether the PublishableApiKeys was deleted. + default: true + AdminPublishableApiKeysListSalesChannelsRes: + type: object + properties: + sales_channels: + type: array + items: + $ref: '#/components/schemas/SalesChannel' + 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 + AdminRegionsRes: + type: object + properties: + region: + $ref: '#/components/schemas/Region' + AdminRegionsListRes: + type: object + properties: + regions: + type: array + items: + $ref: '#/components/schemas/Region' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminRegionsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Region. + object: + type: string + description: The type of the object that was deleted. + default: region + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminGetRegionsRegionFulfillmentOptionsRes: + type: object + properties: + fulfillment_options: + type: array + items: + type: object + properties: + provider_id: + type: string + description: ID of the fulfillment provider + options: + type: array + description: fulfillment provider options + example: + - id: manual-fulfillment + - id: manual-fulfillment-return + is_return: true + 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 + AdminPostReservationsReq: + type: object + required: + - reservation + properties: + reservation: + $ref: '#/components/schemas/ReservationItemDTO' + AdminGetReservationReservationsReq: + type: object + properties: + reservations: + type: array + items: + $ref: '#/components/schemas/ReservationItemDTO' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminPostReservationsReservationReq: + type: object + properties: + location_id: + description: The id of the location of the reservation + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + description: An optional set of key-value pairs with additional information. + type: object + 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 + AdminReturnReasonsRes: + type: object + properties: + return_reason: + $ref: '#/components/schemas/ReturnReason' + AdminReturnReasonsListRes: + type: object + properties: + return_reasons: + type: array + items: + $ref: '#/components/schemas/ReturnReason' + AdminReturnReasonsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted return reason + object: + type: string + description: The type of the object that was deleted. + default: return_reason + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + 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 + AdminReturnsCancelRes: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + AdminReturnsListRes: + type: object + properties: + returns: + type: array + items: + $ref: '#/components/schemas/Return' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminReturnsRes: + type: object + properties: + return: + $ref: '#/components/schemas/Return' + AdminPostReturnsReturnReceiveReq: + type: object + required: + - items + properties: + items: + description: The Line Items that have been received. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: number + AdminPostSalesChannelsChannelProductsBatchReq: + type: object + required: + - product_ids + properties: + product_ids: + description: The IDs of the products to add to the Sales Channel + type: array + items: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the product + AdminPostSalesChannelsChannelStockLocationsReq: + type: object + required: + - location_id + properties: + location_id: + description: The ID of the stock location + type: string + AdminPostSalesChannelsReq: + type: object + required: + - name + properties: + name: + description: The name of the Sales Channel + type: string + description: + description: The description of the Sales Channel + type: string + is_disabled: + description: Whether the Sales Channel is disabled or not. + type: boolean + 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 + AdminSalesChannelsRes: + type: object + properties: + sales_channel: + $ref: '#/components/schemas/SalesChannel' + AdminSalesChannelsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted sales channel + object: + type: string + description: The type of the object that was deleted. + default: sales-channel + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminSalesChannelsDeleteLocationRes: + type: object + properties: + id: + type: string + description: The ID of the removed stock location from a sales channel + object: + type: string + description: The type of the object that was removed. + default: stock-location + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminSalesChannelsListRes: + type: object + properties: + sales_channels: + type: array + items: + $ref: '#/components/schemas/SalesChannel' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminDeleteSalesChannelsChannelStockLocationsReq: + type: object + required: + - location_id + properties: + location_id: + description: The ID of the stock location + 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. + AdminPostShippingOptionsReq: + type: object + required: + - name + - region_id + - provider_id + - data + - price_type + properties: + name: + description: The name of the Shipping Option + type: string + region_id: + description: The ID of the Region in which the Shipping Option will be available. + type: string + provider_id: + description: The ID of the Fulfillment Provider that handles the Shipping Option. + type: string + profile_id: + description: The ID of the Shipping Profile to add the Shipping Option to. + type: number + data: + description: The data needed for the Fulfillment Provider to handle shipping with this Shipping Option. + type: object + price_type: + description: The type of the Shipping Option price. + type: string + enum: + - flat_rate + - calculated + amount: + description: The amount to charge for the Shipping Option. + type: integer + requirements: + description: The requirements that must be satisfied for the Shipping Option to be available. + type: array + items: + type: object + required: + - type + - amount + properties: + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + is_return: + description: Whether the Shipping Option defines a return shipment. + type: boolean + default: false + admin_only: + description: If true, the option can be used for draft orders + type: boolean + default: false + metadata: + description: An optional set of key-value pairs with additional information. + type: object + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminShippingOptionsListRes: + type: object + properties: + shipping_options: + type: array + items: + $ref: '#/components/schemas/ShippingOption' + count: + type: integer + description: The total number of items available + AdminShippingOptionsRes: + type: object + properties: + shipping_option: + $ref: '#/components/schemas/ShippingOption' + AdminShippingOptionsDeleteRes: + 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 + AdminPostShippingOptionsOptionReq: + type: object + required: + - requirements + properties: + name: + description: The name of the Shipping Option + type: string + amount: + description: The amount to charge for the Shipping Option. + type: integer + admin_only: + description: If true, the option can be used for draft orders + type: boolean + metadata: + description: An optional set of key-value pairs with additional information. + type: object + requirements: + description: The requirements that must be satisfied for the Shipping Option to be available. + type: array + items: + type: object + required: + - type + - amount + properties: + id: + description: The ID of the requirement + type: string + type: + description: The type of the requirement + type: string + enum: + - max_subtotal + - min_subtotal + amount: + description: The amount to compare with. + type: integer + includes_tax: + description: '[EXPERIMENTAL] Tax included in prices of shipping option' + type: boolean + AdminPostShippingProfilesReq: + type: object + required: + - name + - type + properties: + name: + description: The name of the Shipping Profile + type: string + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom + AdminDeleteShippingProfileRes: + 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 + AdminShippingProfilesRes: + type: object + properties: + shipping_profile: + $ref: '#/components/schemas/ShippingProfile' + AdminShippingProfilesListRes: + type: object + properties: + shipping_profiles: + type: array + items: + $ref: '#/components/schemas/ShippingProfile' + AdminPostShippingProfilesProfileReq: + type: object + properties: + name: + description: The name of the Shipping Profile + type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom + products: + description: An optional array of product ids to associate with the Shipping Profile + type: array + shipping_options: + description: An optional array of shipping option ids to associate with the Shipping Profile + type: array + AdminPostStockLocationsReq: + type: object + required: + - name + properties: + name: + description: the name of the stock location + type: string + address_id: + description: the stock location address ID + type: string + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + address: + $ref: '#/components/schemas/StockLocationAddressInput' + AdminStockLocationsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + default: stock_location + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminStockLocationsRes: + type: object + properties: + stock_location: + $ref: '#/components/schemas/StockLocationDTO' + AdminStockLocationsListRes: + type: object + properties: + stock_locations: + type: array + items: + $ref: '#/components/schemas/StockLocationDTO' + 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 + AdminPostStockLocationsLocationReq: + type: object + properties: + name: + description: the name of the stock location + type: string + address_id: + description: the stock location address ID + type: string + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + address: + $ref: '#/components/schemas/StockLocationAddressInput' + AdminStoresRes: + type: object + properties: + store: + $ref: '#/components/schemas/Store' + AdminTaxProvidersList: + type: object + properties: + tax_providers: + type: array + items: + $ref: '#/components/schemas/TaxProvider' + AdminPaymentProvidersList: + type: object + properties: + payment_providers: + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + 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 + AdminSwapsListRes: + type: object + properties: + swaps: + type: array + items: + $ref: '#/components/schemas/Swap' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminSwapsRes: + type: object + properties: + swap: + $ref: '#/components/schemas/Swap' + 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 + AdminTaxRatesDeleteRes: + 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: tax-rate + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminTaxRatesListRes: + type: object + properties: + tax_rates: + type: array + items: + $ref: '#/components/schemas/TaxRate' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminTaxRatesRes: + type: object + properties: + tax_rate: + $ref: '#/components/schemas/TaxRate' + 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 + AdminUploadsRes: + type: object + properties: + uploads: + type: array + items: + type: object + properties: + url: + type: string + description: The URL of the uploaded file. + format: uri + AdminDeleteUploadsRes: + type: object + properties: + id: + type: string + description: The file key of the upload deleted + object: + type: string + description: The type of the object that was deleted. + default: file + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + AdminUploadsDownloadUrlRes: + type: object + properties: + download_url: + type: string + description: The Download URL of the file + 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 + AdminUserRes: + type: object + properties: + user: + $ref: '#/components/schemas/User' + AdminUsersListRes: + type: object + properties: + users: + type: array + items: + $ref: '#/components/schemas/User' + AdminDeleteUserRes: + type: object + properties: + id: + type: string + description: The ID of the deleted user. + object: + type: string + description: The type of the object that was deleted. + default: user + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true + 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 + AdminGetVariantsVariantInventoryRes: + type: object + properties: + id: + description: the id of the variant + type: string + inventory: + description: the stock location address ID + type: string + sales_channel_availability: + type: object + description: An optional key-value map with additional details + properties: + channel_name: + description: Sales channel name + type: string + channel_id: + description: Sales channel id + type: string + available_quantity: + description: Available quantity in sales channel + type: number + AdminVariantsListRes: + type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page diff --git a/docs/api/admin/components/schemas/Cart.yaml b/docs/api/admin/components/schemas/Cart.yaml index 204dddb8af..92c5146ff8 100644 --- a/docs/api/admin/components/schemas/Cart.yaml +++ b/docs/api/admin/components/schemas/Cart.yaml @@ -82,12 +82,12 @@ properties: payment_session: description: The selected payment session in the cart. nullable: true - $ref: ./PaymentSession.yaml + type: object payment_sessions: description: The payment sessions created on the cart. type: array items: - $ref: ./PaymentSession.yaml + type: object payment_id: description: The payment's ID if available nullable: true diff --git a/docs/api/admin/components/schemas/ClaimImage.yaml b/docs/api/admin/components/schemas/ClaimImage.yaml index 5a46013ba3..214446d0bb 100644 --- a/docs/api/admin/components/schemas/ClaimImage.yaml +++ b/docs/api/admin/components/schemas/ClaimImage.yaml @@ -20,7 +20,7 @@ properties: claim_item: description: A claim item object. Available if the relation `claim_item` is expanded. nullable: true - $ref: ./ClaimItem.yaml + type: object url: description: The URL of the image type: string diff --git a/docs/api/admin/components/schemas/Country.yaml b/docs/api/admin/components/schemas/Country.yaml index 188fb5ccae..3b78bc3b33 100644 --- a/docs/api/admin/components/schemas/Country.yaml +++ b/docs/api/admin/components/schemas/Country.yaml @@ -54,4 +54,4 @@ properties: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: ./Region.yaml + type: object diff --git a/docs/api/admin/components/schemas/CustomerGroup.yaml b/docs/api/admin/components/schemas/CustomerGroup.yaml index 65e7fb545a..c3ae03f953 100644 --- a/docs/api/admin/components/schemas/CustomerGroup.yaml +++ b/docs/api/admin/components/schemas/CustomerGroup.yaml @@ -23,14 +23,14 @@ properties: `customers` is expanded. type: array items: - $ref: ./Customer.yaml + type: object price_lists: description: >- The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. type: array items: - $ref: ./PriceList.yaml + type: object created_at: description: The date with timezone at which the resource was created. type: string diff --git a/docs/api/admin/components/schemas/Discount.yaml b/docs/api/admin/components/schemas/Discount.yaml index 9257a02406..124f8698ed 100644 --- a/docs/api/admin/components/schemas/Discount.yaml +++ b/docs/api/admin/components/schemas/Discount.yaml @@ -59,7 +59,7 @@ properties: parent_discount: description: Available if the relation `parent_discount` is expanded. nullable: true - $ref: ./Discount.yaml + type: object starts_at: description: The time at which the discount can be used. type: string diff --git a/docs/api/admin/components/schemas/DiscountRule.yaml b/docs/api/admin/components/schemas/DiscountRule.yaml index 2adf4fb537..e2571f38a7 100644 --- a/docs/api/admin/components/schemas/DiscountRule.yaml +++ b/docs/api/admin/components/schemas/DiscountRule.yaml @@ -54,7 +54,7 @@ properties: used. Available if the relation `conditions` is expanded. type: array items: - $ref: ./DiscountCondition.yaml + type: object created_at: description: The date with timezone at which the resource was created. type: string diff --git a/docs/api/admin/components/schemas/Fulfillment.yaml b/docs/api/admin/components/schemas/Fulfillment.yaml index 8567463bfe..6ab0193bdf 100644 --- a/docs/api/admin/components/schemas/Fulfillment.yaml +++ b/docs/api/admin/components/schemas/Fulfillment.yaml @@ -9,32 +9,52 @@ description: >- Fulfillments. type: object required: + - canceled_at + - claim_order_id + - created_at + - data + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id - provider_id + - shipped_at + - swap_id + - tracking_numbers + - updated_at properties: id: + description: The fulfillment's ID type: string - description: The cart's ID example: ful_01G8ZRTMQCA76TXNAT81KPJZRF claim_order_id: description: The id of the Claim that the Fulfillment belongs to. + nullable: true type: string example: null claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object swap_id: description: The id of the Swap that the Fulfillment belongs to. + nullable: true type: string example: null swap: description: A swap object. Available if the relation `swap` is expanded. + nullable: true type: object order_id: description: The id of the Order that the Fulfillment belongs to. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object provider_id: description: >- @@ -42,13 +62,15 @@ properties: fulfillment type: string example: manual - location_id: - description: The id of the stock location the fulfillment will be shipped from - type: string - example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK provider: description: Available if the relation `provider` is expanded. + nullable: true $ref: ./FulfillmentProvider.yaml + location_id: + description: The id of the stock location the fulfillment will be shipped from + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK items: description: >- The Fulfillment Items in the Fulfillment - these hold information about @@ -66,10 +88,10 @@ properties: items: $ref: ./TrackingLink.yaml tracking_numbers: - deprecated: true description: >- The tracking numbers that can be used to track the status of the fulfillment. + deprecated: true type: array items: type: string @@ -81,41 +103,42 @@ properties: example: {} shipped_at: description: The date with timezone at which the Fulfillment was shipped. + nullable: true type: string format: date-time no_notification: description: >- Flag for describing whether or not notifications related to this should be - send. + sent. + nullable: true type: boolean example: false canceled_at: description: The date with timezone at which the Fulfillment was canceled. + nullable: true type: string format: date-time idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the fulfillment in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/FulfillmentItem.yaml b/docs/api/admin/components/schemas/FulfillmentItem.yaml index 8578f6a4d7..ad05c5637e 100644 --- a/docs/api/admin/components/schemas/FulfillmentItem.yaml +++ b/docs/api/admin/components/schemas/FulfillmentItem.yaml @@ -18,9 +18,11 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN fulfillment: description: A fulfillment object. Available if the relation `fulfillment` is expanded. + nullable: true type: object item: description: Available if the relation `item` is expanded. + nullable: true $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Fulfillment. diff --git a/docs/api/admin/components/schemas/FulfillmentProvider.yaml b/docs/api/admin/components/schemas/FulfillmentProvider.yaml index bbd8801420..77f50f4c75 100644 --- a/docs/api/admin/components/schemas/FulfillmentProvider.yaml +++ b/docs/api/admin/components/schemas/FulfillmentProvider.yaml @@ -1,6 +1,9 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. type: object +required: + - id + - is_installed properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -12,4 +15,4 @@ properties: no longer installed are not deleted by will have this field set to `false`. type: boolean - example: true + default: true diff --git a/docs/api/admin/components/schemas/GiftCard.yaml b/docs/api/admin/components/schemas/GiftCard.yaml index d169d35e54..0967dd0b92 100644 --- a/docs/api/admin/components/schemas/GiftCard.yaml +++ b/docs/api/admin/components/schemas/GiftCard.yaml @@ -4,14 +4,23 @@ description: >- payment of an Order. type: object required: - - code - - value - balance + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - metadata + - order_id - region_id + - tax_rate + - updated_at + - value properties: id: + description: The gift card's ID type: string - description: The cart's ID example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ code: description: >- @@ -28,47 +37,54 @@ properties: type: integer example: 10 region_id: - type: string description: The id of the Region in which the Gift Card is available. + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: ./Region.yaml order_id: - type: string description: The id of the Order that the Gift Card was purchased in. + nullable: true + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object is_disabled: description: >- Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts. type: boolean - example: false + default: false ends_at: description: The time at which the Gift Card can no longer be used. + nullable: true type: string format: date-time tax_rate: - description: The gift cards's tax rate that will be applied on calculating totals + description: The gift card's tax rate that will be applied on calculating totals + nullable: true type: number example: 0 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/GiftCardTransaction.yaml b/docs/api/admin/components/schemas/GiftCardTransaction.yaml index df738aa63b..48cd927c23 100644 --- a/docs/api/admin/components/schemas/GiftCardTransaction.yaml +++ b/docs/api/admin/components/schemas/GiftCardTransaction.yaml @@ -4,12 +4,17 @@ description: >- their Order type: object required: - - gift_card_id - amount + - created_at + - gift_card_id + - id + - is_taxable + - order_id + - tax_rate properties: id: - type: string description: The gift card transaction's ID + type: string example: gct_01G8X9A7ESKAJXG2H0E6F1MW7A gift_card_id: description: The ID of the Gift Card that was used in the transaction. @@ -17,6 +22,7 @@ properties: example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ gift_card: description: A gift card object. Available if the relation `gift_card` is expanded. + nullable: true type: object order_id: description: The ID of the Order that the Gift Card was used to pay for. @@ -24,6 +30,7 @@ properties: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object amount: description: The amount that was used from the Gift Card. @@ -35,9 +42,11 @@ properties: format: date-time is_taxable: description: Whether the transaction is taxable or not. + nullable: true type: boolean example: false tax_rate: description: The tax rate of the transaction + nullable: true type: number example: 0 diff --git a/docs/api/admin/components/schemas/IdempotencyKey.yaml b/docs/api/admin/components/schemas/IdempotencyKey.yaml index b496aadde3..1ee68e1a5b 100644 --- a/docs/api/admin/components/schemas/IdempotencyKey.yaml +++ b/docs/api/admin/components/schemas/IdempotencyKey.yaml @@ -4,11 +4,20 @@ description: >- might occur. type: object required: + - created_at + - id - idempotency_key + - locked_at + - recovery_point + - response_code + - response_body + - request_method + - request_params + - request_path properties: id: - type: string description: The idempotency key's ID + type: string example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A idempotency_key: description: >- @@ -25,31 +34,37 @@ properties: format: date-time locked_at: description: Date which the idempotency key was locked. + nullable: true type: string format: date-time request_method: description: The method of the request + nullable: true type: string example: POST request_params: - type: object description: The parameters passed to the request + nullable: true + type: object example: id: cart_01G8ZH853Y6TFXWPG5EYE81X63 request_path: description: The request's path + nullable: true type: string example: /store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete response_code: - type: string description: The response's code. + nullable: true + type: string example: 200 response_body: - type: object description: The response's body + nullable: true + type: object example: id: cart_01G8ZH853Y6TFXWPG5EYE81X63 recovery_point: - type: string description: Where to continue from. + type: string default: started diff --git a/docs/api/admin/components/schemas/Image.yaml b/docs/api/admin/components/schemas/Image.yaml index 5250816766..e061ecefe8 100644 --- a/docs/api/admin/components/schemas/Image.yaml +++ b/docs/api/admin/components/schemas/Image.yaml @@ -2,6 +2,11 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - url properties: id: @@ -13,19 +18,21 @@ properties: type: string format: uri created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/Invite.yaml b/docs/api/admin/components/schemas/Invite.yaml index 9e16e818ea..fa8ba054c5 100644 --- a/docs/api/admin/components/schemas/Invite.yaml +++ b/docs/api/admin/components/schemas/Invite.yaml @@ -2,6 +2,15 @@ title: Invite description: Represents an invite type: object required: + - accepted + - created_at + - deleted_at + - expires_at + - id + - metadata + - role + - token + - updated_at - user_email properties: id: @@ -9,42 +18,45 @@ properties: description: The invite's ID example: invite_01G8TKE4XYCTHSCK2GDEP47RE1 user_email: - type: string description: The email of the user being invited. + type: string format: email role: - type: string description: The user's role. + nullable: true + type: string enum: - admin - member - developer default: member accepted: - type: boolean description: Whether the invite was accepted or not. - example: false + type: boolean + default: false token: - type: string description: The token used to accept the invite. - expores_at: type: string + expires_at: description: The date the invite expires at. + type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/LineItem.yaml b/docs/api/admin/components/schemas/LineItem.yaml index 0e0c64de6f..e809ce5e3c 100644 --- a/docs/api/admin/components/schemas/LineItem.yaml +++ b/docs/api/admin/components/schemas/LineItem.yaml @@ -6,41 +6,70 @@ description: >- may also be created when processing Swaps and Claims. type: object required: + - allow_discounts + - cart_id + - claim_order_id + - created_at + - description + - fulfilled_quantity + - has_shipping + - id + - is_giftcard + - is_return + - metadata + - order_edit_id + - order_id + - original_item_id + - quantity + - returned_quantity + - shipped_quantity + - should_merge + - swap_id + - thumbnail - title - unit_price - - quantity + - updated_at + - variant_id properties: id: + description: The line item's ID type: string - description: The cart's ID example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN cart_id: description: The ID of the Cart that the Line Item belongs to. + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object order_id: description: The ID of the Order that the Line Item belongs to. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object swap_id: description: The id of the Swap that the Line Item belongs to. + nullable: true type: string example: null swap: description: A swap object. Available if the relation `swap` is expanded. + nullable: true type: object claim_order_id: description: The id of the Claim that the Line Item belongs to. + nullable: true type: string example: null claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object tax_lines: description: Available if the relation `tax_lines` is expanded. @@ -52,6 +81,18 @@ properties: type: array items: $ref: ./LineItemAdjustment.yaml + original_item_id: + description: The id of the original line item + nullable: true + type: string + order_edit_id: + description: The ID of the order edit to which a cloned item belongs + nullable: true + type: string + order_edit: + description: The order edit joined. Available if the relation `order_edit` is expanded. + nullable: true + type: object title: description: >- The title of the Line Item, this should be easily identifiable by the @@ -60,35 +101,38 @@ properties: example: Medusa Coffee Mug description: description: A more detailed description of the contents of the Line Item. + nullable: true type: string example: One Size thumbnail: description: A URL string to a small image of the contents of the Line Item. + nullable: true type: string format: uri example: https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png is_return: description: Is the item being returned type: boolean - example: false + default: false is_giftcard: description: Flag to indicate if the Line Item is a Gift Card. type: boolean - example: false + default: false should_merge: description: >- Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item. type: boolean - example: false + default: true allow_discounts: description: >- Flag to indicate if the Line Item should be included when doing discount calculations. type: boolean - example: false + default: true has_shipping: description: Flag to indicate if the Line Item has fulfillment associated with it. + nullable: true type: boolean example: false unit_price: @@ -96,31 +140,36 @@ properties: The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to. - type: boolean + type: integer example: 8000 variant_id: description: The id of the Product Variant contained in the Line Item. + nullable: true type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: >- A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. - type: object + nullable: true + $ref: ./ProductVariant.yaml quantity: description: The quantity of the content in the Line Item. type: integer example: 1 fulfilled_quantity: description: The quantity of the Line Item that has been fulfilled. + nullable: true type: integer example: 0 returned_quantity: description: The quantity of the Line Item that has been returned. + nullable: true type: integer example: 0 shipped_quantity: description: The quantity of the Line Item that has been shipped. + nullable: true type: integer example: 0 refundable: @@ -130,55 +179,48 @@ properties: type: integer example: 0 subtotal: - type: integer description: The subtotal of the line item + type: integer example: 8000 tax_total: - type: integer description: The total of tax of the line item + type: integer example: 0 total: - type: integer description: The total amount of the line item + type: integer example: 8000 original_total: - type: integer description: The original total amount of the line item + type: integer example: 8000 original_tax_total: - type: integer description: The original tax total amount of the line item + type: integer example: 0 discount_total: - type: integer description: The total of discount of the line item + type: integer example: 0 gift_card_total: - type: integer description: The total of the gift card of the line item + type: integer example: 0 includes_tax: description: '[EXPERIMENTAL] Indicates if the line item unit_price include tax' type: boolean - original_item_id: - description: '[EXPERIMENTAL] The id of the original line item' - type: string - order_edit_id: - description: '[EXPERIMENTAL] The ID of the order edit to which a cloned item belongs' - type: string - order_edit: - description: '[EXPERIMENTAL] The order edit joined' - type: object + default: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/LineItemAdjustment.yaml b/docs/api/admin/components/schemas/LineItemAdjustment.yaml index 28b41b9566..fe1b9049e8 100644 --- a/docs/api/admin/components/schemas/LineItemAdjustment.yaml +++ b/docs/api/admin/components/schemas/LineItemAdjustment.yaml @@ -2,38 +2,45 @@ title: Line Item Adjustment description: Represents a Line Item Adjustment type: object required: - - item_id - - description - amount + - description + - discount_id + - id + - item_id + - metadata properties: id: + description: The Line Item Adjustment's ID type: string - description: The invite's ID example: lia_01G8TKE4XYCTHSCK2GDEP47RE1 item_id: - type: string description: The ID of the line item + type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./LineItem.yaml + nullable: true + type: object description: - type: string description: The line item's adjustment description + type: string example: Adjusted item's price. discount_id: - type: string description: The ID of the discount associated with the adjustment + nullable: true + type: string example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. + nullable: true $ref: ./Discount.yaml amount: - type: number description: The adjustment amount + type: integer example: 1000 metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/LineItemTaxLine.yaml b/docs/api/admin/components/schemas/LineItemTaxLine.yaml index 2ee2e0a546..ec316b7cb7 100644 --- a/docs/api/admin/components/schemas/LineItemTaxLine.yaml +++ b/docs/api/admin/components/schemas/LineItemTaxLine.yaml @@ -2,23 +2,22 @@ title: Line Item Tax Line description: Represents a Line Item Tax Line type: object required: + - code + - created_at + - id - item_id - - rate + - metadata - name + - rate + - updated_at properties: id: - type: string description: The line item tax line's ID - example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 - item_id: type: string - description: The ID of the line item - example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN - item: - description: Available if the relation `item` is expanded. - $ref: ./LineItem.yaml + example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 code: description: A code to identify the tax type by + nullable: true type: string example: tax01 name: @@ -29,16 +28,25 @@ properties: description: The numeric rate to charge tax by type: number example: 10 - created_at: + item_id: + description: The ID of the line item type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + created_at: description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/MoneyAmount.yaml b/docs/api/admin/components/schemas/MoneyAmount.yaml index 223ddf5f44..f2b78adabf 100644 --- a/docs/api/admin/components/schemas/MoneyAmount.yaml +++ b/docs/api/admin/components/schemas/MoneyAmount.yaml @@ -7,12 +7,21 @@ description: >- the amount will be in the currency defined for the Reigon. type: object required: - - currency_code - amount + - created_at + - currency_code + - deleted_at + - id + - max_quantity + - min_quantity + - price_list_id + - region_id + - updated_at + - variant_id properties: id: - type: string description: The money amount's ID + type: string example: ma_01F0YESHRFQNH5S8Q0PK84YYZN currency_code: description: The 3 character currency code that the Money Amount is given in. @@ -23,6 +32,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml amount: description: >- @@ -34,51 +44,55 @@ properties: description: >- The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. + nullable: true type: integer example: 1 max_quantity: description: >- The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. + nullable: true type: integer example: 1 price_list_id: - type: string description: The ID of the price list associated with the money amount + nullable: true + type: string example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: ./PriceList.yaml + nullable: true + type: object variant_id: description: The id of the Product Variant contained in the Line Item. + nullable: true type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: >- The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true type: object region_id: - type: string description: The region's ID + nullable: true + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. + nullable: true type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time - metadata: - type: object - description: An optional key-value map with additional details - example: - car: white diff --git a/docs/api/admin/components/schemas/Note.yaml b/docs/api/admin/components/schemas/Note.yaml index 2decb4f715..3fce158b7e 100644 --- a/docs/api/admin/components/schemas/Note.yaml +++ b/docs/api/admin/components/schemas/Note.yaml @@ -4,13 +4,19 @@ description: >- allow users to describe additional information in relation to these. type: object required: - - value - - resource_type + - author_id + - created_at + - deleted_at + - id + - metadata - resource_id + - resource_type + - updated_at + - value properties: id: - type: string description: The note's ID + type: string example: note_01G8TM8ENBMC7R90XRR1G6H26Q resource_type: description: The type of resource that the Note refers to. @@ -25,26 +31,30 @@ properties: type: string example: This order must be fulfilled on Monday author_id: - type: string description: The ID of the author (user) + nullable: true + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. + nullable: true $ref: ./User.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/Notification.yaml b/docs/api/admin/components/schemas/Notification.yaml index ddc77a9c73..13eca79f77 100644 --- a/docs/api/admin/components/schemas/Notification.yaml +++ b/docs/api/admin/components/schemas/Notification.yaml @@ -6,16 +6,25 @@ description: >- Order, and enables resends. type: object required: + - created_at + - customer_id + - data + - event_name + - id + - parent_id + - provider_id - resource_type - resource_id - to + - updated_at properties: id: - type: string description: The notification's ID + type: string example: noti_01G53V9Y6CKMCGBM1P0X7C28RX event_name: description: The name of the event that the notification was sent for. + nullable: true type: string example: order.placed resource_type: @@ -28,11 +37,13 @@ properties: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK customer_id: description: The ID of the Customer that the Notification was sent to. + nullable: true type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. - type: object + nullable: true + $ref: ./Customer.yaml to: description: >- The address that the Notification was sent to. This will usually be an @@ -45,23 +56,36 @@ properties: necessary for the Notification Provider to initiate a resend. type: object example: {} + parent_id: + description: The notification's parent ID + nullable: true + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + parent_notification: + description: Available if the relation `parent_notification` is expanded. + nullable: true + type: object resends: - description: The resends that have been completed after the original Notification. + description: >- + The resends that have been completed after the original Notification. + Available if the relation `resends` is expanded. type: array items: - $ref: ./NotificationResend.yaml + type: object provider_id: description: The id of the Notification Provider that handles the Notification. + nullable: true type: string example: sengrid provider: description: Available if the relation `provider` is expanded. + nullable: true $ref: ./NotificationProvider.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time diff --git a/docs/api/admin/components/schemas/NotificationProvider.yaml b/docs/api/admin/components/schemas/NotificationProvider.yaml index fbc83c6837..71bc9d5f96 100644 --- a/docs/api/admin/components/schemas/NotificationProvider.yaml +++ b/docs/api/admin/components/schemas/NotificationProvider.yaml @@ -3,6 +3,7 @@ description: Represents a notification provider plugin and holds its installatio type: object required: - id + - is_installed properties: id: description: The id of the notification provider as given by the plugin. diff --git a/docs/api/admin/components/schemas/NotificationResend.yaml b/docs/api/admin/components/schemas/NotificationResend.yaml deleted file mode 100644 index cd88d291ae..0000000000 --- a/docs/api/admin/components/schemas/NotificationResend.yaml +++ /dev/null @@ -1,61 +0,0 @@ -title: Notification Resend -description: A resend of a Notification. -type: object -properties: - id: - description: The notification resend's ID - type: string - example: noti_01F0YET45G9NHP08Z66CE4QKBS - event_name: - description: The name of the event that the notification was sent for. - type: string - example: order.placed - resource_type: - description: The type of resource that the Notification refers to. - type: string - example: order - resource_id: - description: The ID of the resource that the Notification refers to. - type: string - example: order_01G8TJSYT9M6AVS5N4EMNFS1EK - customer_id: - description: The ID of the Customer that the Notification was sent to. - type: string - example: cus_01G2SG30J8C85S4A5CHM2S1NS2 - customer: - description: A customer object. Available if the relation `customer` is expanded. - type: object - to: - description: >- - The address that the Notification was sent to. This will usually be an - email address, but represent other addresses such as a chat bot user id - type: string - example: user@example.com - data: - description: >- - The data that the Notification was sent with. This contains all the data - necessary for the Notification Provider to initiate a resend. - type: object - example: {} - parent_id: - description: The ID of the Notification that was originally sent. - type: string - example: noti_01G53V9Y6CKMCGBM1P0X7C28RX - parent_notification: - description: Available if the relation `parent_notification` is expanded. - $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: ./NotificationProvider.yaml - created_at: - type: string - description: The date with timezone at which the resource was created. - format: date-time - updated_at: - type: string - description: The date with timezone at which the resource was updated. - format: date-time diff --git a/docs/api/admin/components/schemas/OAuth.yaml b/docs/api/admin/components/schemas/OAuth.yaml index 9f22524f3e..36df175455 100644 --- a/docs/api/admin/components/schemas/OAuth.yaml +++ b/docs/api/admin/components/schemas/OAuth.yaml @@ -2,31 +2,37 @@ title: OAuth description: Represent an OAuth app type: object required: - - id - - display_name - application_name + - data + - display_name + - id + - install_url + - uninstall_url properties: id: - type: string description: The app's ID + type: string example: example_app display_name: - type: string description: The app's display name + type: string example: Example app application_name: - type: string description: The app's name + type: string example: example install_url: - type: string description: The URL to install the app + nullable: true + type: string format: uri uninstall_url: - type: string description: The URL to uninstall the app + nullable: true + type: string format: uri data: - type: object description: Any data necessary to the app. + nullable: true + type: object example: {} diff --git a/docs/api/admin/components/schemas/Order.yaml b/docs/api/admin/components/schemas/Order.yaml index e503b4fecd..26d73485be 100644 --- a/docs/api/admin/components/schemas/Order.yaml +++ b/docs/api/admin/components/schemas/Order.yaml @@ -2,18 +2,36 @@ title: Order description: Represents an order type: object required: - - customer_id - - email - - region_id + - billing_address_id + - canceled_at + - cart_id + - created_at - currency_code + - customer_id + - draft_order_id + - display_id + - email + - external_id + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - object + - payment_status + - region_id + - shipping_address_id + - status + - tax_rate + - updated_at properties: id: - type: string description: The order's ID + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK status: - type: string description: The order's status + type: string enum: - pending - completed @@ -22,8 +40,8 @@ properties: - requires_action default: pending fulfillment_status: - type: string description: The order's fulfillment status + type: string enum: - not_fulfilled - partially_fulfilled @@ -36,60 +54,68 @@ properties: - requires_action default: not_fulfilled payment_status: - type: string description: The order's payment status + type: string enum: - not_paid - awaiting - captured - partially_refunded - - refuneded + - refunded - canceled - requires_action default: not_paid display_id: - type: integer description: The order's display ID + type: integer example: 2 cart_id: - type: string description: The ID of the cart associated with the order + nullable: true + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object customer_id: - type: string description: The ID of the customer associated with the order + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. + nullable: true type: object email: description: The email associated with the order type: string format: email billing_address_id: - type: string description: The ID of the billing address associated with the order + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_address_id: - type: string description: The ID of the shipping address associated with the order + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: ./Address.yaml region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: ./Region.yaml currency_code: description: The 3 character currency code that is used in the order type: string @@ -99,177 +125,202 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml tax_rate: description: The order's tax rate + nullable: true type: number example: 0 discounts: - type: array description: >- The discounts used in the order. Available if the relation `discounts` is expanded. - items: - type: object - description: A discount object. - gift_cards: type: array + items: + $ref: ./Discount.yaml + gift_cards: description: >- The gift cards used in the order. Available if the relation `gift_cards` is expanded. - items: - type: object - description: A gift card object. - shipping_methods: type: array + items: + $ref: ./GiftCard.yaml + shipping_methods: description: >- The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. + type: array items: $ref: ./ShippingMethod.yaml payments: - type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. + type: array items: type: object fulfillments: - type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. + type: array items: type: object returns: - type: array description: >- The returns associated with the order. Available if the relation `returns` is expanded. + type: array items: type: object - description: A return object. claims: - type: array description: >- The claims associated with the order. Available if the relation `claims` is expanded. + type: array items: type: object - description: A claim order object. refunds: - type: array description: >- The refunds associated with the order. Available if the relation `refunds` is expanded. + type: array items: type: object - description: A refund object. swaps: - type: array description: >- The swaps associated with the order. Available if the relation `swaps` is expanded. + type: array items: type: object - description: A swap object. draft_order_id: - type: string description: The ID of the draft order this order is associated with. + nullable: true + type: string example: null draft_order: description: A draft order object. Available if the relation `draft_order` is expanded. + nullable: true type: object items: - type: array description: >- The line items that belong to the order. Available if the relation `items` is expanded. + type: array items: $ref: ./LineItem.yaml edits: - type: array description: >- - [EXPERIMENTAL] Order edits done on the order. Available if the relation - `edits` is expanded. + Order edits done on the order. Available if the relation `edits` is + expanded. + type: array items: type: object gift_card_transactions: - type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. + type: array items: $ref: ./GiftCardTransaction.yaml canceled_at: - type: string description: The date the order was canceled on. + nullable: true + type: string format: date-time no_notification: description: >- Flag for describing whether or not notifications related to this should be send. + nullable: true type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the processing of the order in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. external_id: description: The ID of an external order. + nullable: true type: string example: null sales_channel_id: - type: string description: The ID of the sales channel this order is associated with. + nullable: true + type: string example: null sales_channel: description: >- A sales channel object. Available if the relation `sales_channel` is expanded. - type: object + nullable: true + $ref: ./SalesChannel.yaml shipping_total: type: integer description: The total of shipping example: 1000 discount_total: - type: integer description: The total of discount + type: integer example: 800 tax_total: - type: integer description: The total of tax + type: integer example: 0 refunded_total: - type: integer description: The total amount refunded if the order is returned. + type: integer example: 0 total: - type: integer description: The total amount of the order + type: integer example: 8200 subtotal: - type: integer description: The subtotal of the order + type: integer example: 8000 paid_total: - type: integer description: The total amount paid + type: integer example: 8000 refundable_amount: - type: integer description: The amount that can be refunded + type: integer example: 8200 gift_card_total: - type: integer description: The total of gift cards + type: integer example: 0 gift_card_tax_total: - type: integer description: The total of gift cards with taxes + type: integer example: 0 + returnable_items: + description: >- + The items that are returnable as part of the order, order swaps or order + claims + type: array + items: + $ref: ./LineItem.yaml + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white diff --git a/docs/api/admin/components/schemas/OrderEdit.yaml b/docs/api/admin/components/schemas/OrderEdit.yaml index 01f09e31d0..c6b72efad7 100644 --- a/docs/api/admin/components/schemas/OrderEdit.yaml +++ b/docs/api/admin/components/schemas/OrderEdit.yaml @@ -2,99 +2,132 @@ title: Order Edit description: Order edit keeps track of order items changes. type: object required: - - order_id - - order - - changes + - canceled_at + - canceled_by + - confirmed_by + - confirmed_at + - created_at - created_by + - declined_at + - declined_by + - declined_reason + - id + - internal_note + - order_id + - payment_collection_id + - requested_at + - requested_by + - status + - updated_at properties: id: - type: string description: The order edit's ID + type: string example: oe_01G8TJSYT9M6AVS5N4EMNFS1EK order_id: - type: string description: The ID of the order that is edited + type: string example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. + nullable: true type: object changes: - type: array description: Available if the relation `changes` is expanded. + type: array items: $ref: ./OrderItemChange.yaml internal_note: description: An optional note with additional details about the order edit. + nullable: true type: string example: Included two more items B to the order. created_by: - type: string description: The unique identifier of the user or customer who created the order edit. - requested_by: type: string + requested_by: description: >- The unique identifier of the user or customer who requested the order edit. - requested_at: + nullable: true type: string + requested_at: description: The date with timezone at which the edit was requested. + nullable: true + type: string format: date-time confirmed_by: - type: string description: >- The unique identifier of the user or customer who confirmed the order edit. - confirmed_at: + nullable: true type: string + confirmed_at: description: The date with timezone at which the edit was confirmed. + nullable: true + type: string format: date-time declined_by: - type: string description: The unique identifier of the user or customer who declined the order edit. - declined_at: + nullable: true type: string + declined_at: description: The date with timezone at which the edit was declined. + nullable: true + type: string format: date-time declined_reason: description: An optional note why the order edit is declined. + nullable: true type: string + canceled_by: + description: >- + The unique identifier of the user or customer who cancelled the order + edit. + nullable: true + type: string + canceled_at: + description: The date with timezone at which the edit was cancelled. + nullable: true + type: string + format: date-time subtotal: - type: integer description: The total of subtotal + type: integer example: 8000 discount_total: - type: integer description: The total of discount + type: integer example: 800 shipping_total: - type: integer description: The total of the shipping amount + type: integer example: 800 gift_card_total: - type: integer description: The total of the gift card amount + type: integer example: 800 gift_card_tax_total: - type: integer description: The total of the gift card tax amount + type: integer example: 800 tax_total: - type: integer description: The total of tax + type: integer example: 0 total: - type: integer description: The total amount of the edited order. + type: integer example: 8200 difference_due: - type: integer description: >- The difference between the total amount of the order and total amount of edited order. + type: integer example: 8200 status: - type: string description: The status of the order edit. + type: string enum: - confirmed - declined @@ -102,22 +135,24 @@ properties: - created - canceled items: - type: array description: Available if the relation `items` is expanded. + type: array items: $ref: ./LineItem.yaml payment_collection_id: - type: string description: The ID of the payment collection + nullable: true + type: string example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. + nullable: true $ref: ./PaymentCollection.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time diff --git a/docs/api/admin/components/schemas/OrderItemChange.yaml b/docs/api/admin/components/schemas/OrderItemChange.yaml index 49d0ecab5b..31a0435da5 100644 --- a/docs/api/admin/components/schemas/OrderItemChange.yaml +++ b/docs/api/admin/components/schemas/OrderItemChange.yaml @@ -2,55 +2,62 @@ title: Order Item Change description: Represents an order edit item change type: object required: - - type + - created_at + - deleted_at + - id + - line_item_id - order_edit_id + - original_line_item_id + - type + - updated_at properties: id: - type: string description: The order item change's ID + type: string example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK type: - type: string description: The order item change's status + type: string enum: - item_add - item_remove - item_update order_edit_id: - type: string description: The ID of the order edit + type: string example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: ./OrderEdit.yaml + nullable: true + type: object original_line_item_id: - type: string description: The ID of the original line item in the order + nullable: true + type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. + nullable: true $ref: ./LineItem.yaml line_item_id: - type: string description: The ID of the cloned line item. + nullable: true + type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. + nullable: true $ref: ./LineItem.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time - metadata: - type: object - description: An optional key-value map with additional details - example: - car: white diff --git a/docs/api/admin/components/schemas/Payment.yaml b/docs/api/admin/components/schemas/Payment.yaml index d224dca6cf..2555ec8ed4 100644 --- a/docs/api/admin/components/schemas/Payment.yaml +++ b/docs/api/admin/components/schemas/Payment.yaml @@ -5,32 +5,50 @@ description: >- type: object required: - amount + - amount_refunded + - canceled_at + - captured_at + - cart_id + - created_at - currency_code + - data + - id + - idempotency_key + - metadata + - order_id - provider_id + - swap_id + - updated_at properties: id: - type: string description: The payment's ID + type: string example: pay_01G2SJNT6DEEWDFNAJ4XWDTHKE swap_id: description: The ID of the Swap that the Payment is used for. + nullable: true type: string example: null swap: description: A swap object. Available if the relation `swap` is expanded. + nullable: true type: object cart_id: description: The id of the Cart that the Payment Session is created for. + nullable: true type: string cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object order_id: description: The ID of the Order that the Payment is used for. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object amount: description: The amount that the Payment has been authorized for. @@ -45,12 +63,14 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml amount_refunded: description: >- The amount of the original Payment amount that has been refunded back to the Customer. type: integer + default: 0 example: 0 provider_id: description: The id of the Payment Provider that is responsible for the Payment @@ -66,31 +86,35 @@ properties: example: {} captured_at: description: The date with timezone at which the Payment was captured. + nullable: true type: string format: date-time canceled_at: description: The date with timezone at which the Payment was canceled. + nullable: true type: string format: date-time idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a payment in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/PaymentCollection.yaml b/docs/api/admin/components/schemas/PaymentCollection.yaml index 096abf613c..83db018a75 100644 --- a/docs/api/admin/components/schemas/PaymentCollection.yaml +++ b/docs/api/admin/components/schemas/PaymentCollection.yaml @@ -2,25 +2,32 @@ title: Payment Collection description: Payment Collection type: object required: - - type - - status - amount - - region_id - - currency_code + - authorized_amount + - created_at - created_by + - currency_code + - deleted_at + - description + - id + - metadata + - region_id + - status + - type + - updated_at properties: id: - type: string description: The payment collection's ID + type: string example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK type: - type: string description: The type of the payment collection + type: string enum: - order_edit status: - type: string description: The type of the payment collection + type: string enum: - not_paid - awaiting @@ -28,20 +35,23 @@ properties: - partially_authorized - canceled description: - type: string description: Description of the payment collection - amount: - type: number - description: Amount of the payment collection. - authorized_amount: - type: number - description: Authorized amount of the payment collection. - region_id: + nullable: true type: string + amount: + description: Amount of the payment collection. + type: integer + authorized_amount: + description: Authorized amount of the payment collection. + nullable: true + type: integer + region_id: description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. + nullable: true $ref: ./Region.yaml currency_code: description: The 3 character ISO code for the currency. @@ -52,34 +62,37 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml payment_sessions: - type: array description: Available if the relation `payment_sessions` is expanded. + type: array items: $ref: ./PaymentSession.yaml payments: - type: array description: Available if the relation `payments` is expanded. + type: array items: $ref: ./Payment.yaml created_by: - type: string description: The ID of the user that created the payment collection. - created_at: type: string + created_at: description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/PaymentProvider.yaml b/docs/api/admin/components/schemas/PaymentProvider.yaml index 57cf719a28..ae7eaecb49 100644 --- a/docs/api/admin/components/schemas/PaymentProvider.yaml +++ b/docs/api/admin/components/schemas/PaymentProvider.yaml @@ -3,6 +3,7 @@ description: Represents a Payment Provider plugin and holds its installation sta type: object required: - id + - is_installed properties: id: description: The id of the payment provider as given by the plugin. diff --git a/docs/api/admin/components/schemas/PaymentSession.yaml b/docs/api/admin/components/schemas/PaymentSession.yaml index 440d532f58..453afac944 100644 --- a/docs/api/admin/components/schemas/PaymentSession.yaml +++ b/docs/api/admin/components/schemas/PaymentSession.yaml @@ -8,21 +8,32 @@ description: >- capture/refunds/etc. type: object required: + - amount - cart_id + - created_at + - data + - id + - is_initiated + - is_selected + - idempotency_key + - payment_authorized_at - provider_id - status + - updated_at properties: id: - type: string description: The payment session's ID + type: string example: ps_01G901XNSRM2YS3ASN9H5KG3FZ cart_id: description: The id of the Cart that the Payment Session is created for. + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: ./Cart.yaml provider_id: description: The id of the Payment Provider that is responsible for the Payment Session type: string @@ -31,6 +42,7 @@ properties: description: >- A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase. + nullable: true type: boolean example: true is_initiated: @@ -38,8 +50,8 @@ properties: A flag to indicate if a communication with the third party provider has been initiated. type: boolean - example: true default: false + example: true status: description: >- Indicates the status of the Payment Session. Will default to `pending`, @@ -63,19 +75,30 @@ properties: type: object example: {} idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - created_at: + amount: + description: The amount that the Payment Session has been authorized for. + nullable: true + type: integer + example: 100 + payment_authorized_at: + description: The date with timezone at which the Payment Session was authorized. + nullable: true type: string + format: date-time + created_at: description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time diff --git a/docs/api/admin/components/schemas/PriceList.yaml b/docs/api/admin/components/schemas/PriceList.yaml index 6c1fc7de25..ef84ed5cb5 100644 --- a/docs/api/admin/components/schemas/PriceList.yaml +++ b/docs/api/admin/components/schemas/PriceList.yaml @@ -4,20 +4,28 @@ description: >- one or more product variants. type: object required: - - name + - created_at + - deleted_at - description + - ends_at + - id + - name + - starts_at + - status + - type + - updated_at properties: id: - type: string description: The price list's ID + type: string example: pl_01G8X3CKJXCG5VXVZ87H9KC09W name: - type: string description: The price list's name + type: string example: VIP Prices description: - type: string description: The price list's description + type: string example: Prices for VIP customers type: description: The type of Price List. This can be one of either `sale` or `override`. @@ -35,10 +43,12 @@ properties: default: draft starts_at: description: The date with timezone that the Price List starts being valid. + nullable: true type: string format: date-time ends_at: description: The date with timezone that the Price List stops being valid. + nullable: true type: string format: date-time customer_groups: @@ -47,29 +57,28 @@ properties: relation `customer_groups` is expanded. type: array items: - type: object - description: A customer group object. + $ref: ./CustomerGroup.yaml prices: description: >- The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. type: array items: - oneOf: - - $ref: ./MoneyAmount.yaml - - $ref: ./CustomerGroup.yaml + $ref: ./MoneyAmount.yaml includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean + default: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/admin/components/schemas/Product.yaml b/docs/api/admin/components/schemas/Product.yaml index 2efc2db8c4..94a80dd483 100644 --- a/docs/api/admin/components/schemas/Product.yaml +++ b/docs/api/admin/components/schemas/Product.yaml @@ -5,12 +5,35 @@ description: >- the properties that Product Variants differ by. type: object required: - - title + - collection_id + - created_at + - deleted_at + - description + - discountable + - external_id + - handle + - height + - hs_code + - id + - is_giftcard + - length + - material + - metadata + - mid_code + - origin_country - profile_id + - status + - subtitle + - type_id + - thumbnail + - title + - updated_at + - weight + - width properties: id: - type: string description: The product's ID + type: string example: prod_01G1G5V2MBA328390B5AXJ610F title: description: A title that can be displayed for easy identification of the Product. @@ -18,13 +41,16 @@ properties: example: Medusa Coffee Mug subtitle: description: An optional subtitle that can be used to further specify the Product. + nullable: true type: string description: description: A short description of the Product. + nullable: true type: string example: Every programmer's best friend. handle: description: A unique identifier for the Product (e.g. for slug structure). + nullable: true type: string example: coffee-mug is_giftcard: @@ -50,6 +76,7 @@ properties: $ref: ./Image.yaml thumbnail: description: A URL to an image file that can be used to identify the Product. + nullable: true type: string format: uri options: @@ -68,6 +95,13 @@ properties: type: array items: $ref: ./ProductVariant.yaml + categories: + description: >- + The product's associated categories. Available if the relation + `categories` are expanded. + type: array + items: + $ref: ./ProductCategory.yaml profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -77,41 +111,48 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. + nullable: true $ref: ./ShippingProfile.yaml weight: description: >- The weight of the Product Variant. May be used in shipping rate calculations. - type: number - example: null - height: - description: >- - The height of the Product Variant. May be used in shipping rate - calculations. - type: number - example: null - width: - description: >- - The width of the Product Variant. May be used in shipping rate - calculations. + nullable: true type: number example: null length: description: >- The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: >- + The height of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + width: + description: >- + The width of the Product Variant. May be used in shipping rate + calculations. + nullable: true type: number example: null hs_code: description: >- The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null origin_country: description: >- The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null mid_code: @@ -119,6 +160,7 @@ properties: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null material: @@ -126,23 +168,28 @@ properties: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null collection_id: - type: string description: The Product Collection that the Product belongs to + nullable: true + type: string example: pcol_01F0YESBFAZ0DV6V831JXWH0BG collection: description: >- A product collection object. Available if the relation `collection` is expanded. - type: object + nullable: true + $ref: ./ProductCollection.yaml type_id: - type: string description: The Product type that the Product belongs to + nullable: true + type: string example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. + nullable: true $ref: ./ProductType.yaml tags: description: >- @@ -159,6 +206,7 @@ properties: default: true external_id: description: The external ID of the product + nullable: true type: string example: null sales_channels: @@ -167,30 +215,23 @@ properties: relation `sales_channels` is expanded. type: array items: - type: object - description: A sales channel object. - categories: - description: >- - The product's associated categories. Available if the relation - `categories` is expanded. - type: array - items: - type: object - description: A category object. + $ref: ./SalesChannel.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ProductCategory.yaml b/docs/api/admin/components/schemas/ProductCategory.yaml index 3f9c1eb7e7..9d15054cd5 100644 --- a/docs/api/admin/components/schemas/ProductCategory.yaml +++ b/docs/api/admin/components/schemas/ProductCategory.yaml @@ -3,25 +3,38 @@ description: Represents a product category x-resourceId: ProductCategory type: object required: + - category_children + - created_at + - deleted_at + - handle + - id + - is_active + - is_internal + - mpath - name + - parent_category_id + - updated_at properties: id: - type: string description: The product category's ID + type: string example: pcat_01G2SG30J8C85S4A5CHM2S1NS2 name: - type: string description: The product category's name + type: string example: Regular Fit handle: - description: 'A unique string that identifies the Category - example: slug structures.' + description: >- + A unique string that identifies the Product Category - can for example be + used in slug structures. type: string example: regular-fit mpath: - type: string description: >- A string for Materialized Paths - used for finding ancestors and descendents + nullable: true + type: string example: pcat_id1.pcat_id2.pcat_id3 is_internal: type: boolean @@ -36,33 +49,34 @@ properties: type: array items: type: object - description: A product category object. parent_category_id: description: The ID of the parent category. + nullable: true type: string default: null parent_category: description: >- A product category object. Available if the relation `parent_category` is expanded. + nullable: true type: object products: description: >- - products associated with category. Available if the relation `products` is + Products associated with category. Available if the relation `products` is expanded. type: array items: type: object - description: A product object. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/admin/components/schemas/ProductCollection.yaml b/docs/api/admin/components/schemas/ProductCollection.yaml index 0f215f050c..f53db55c2d 100644 --- a/docs/api/admin/components/schemas/ProductCollection.yaml +++ b/docs/api/admin/components/schemas/ProductCollection.yaml @@ -2,11 +2,17 @@ title: Product Collection description: Product Collections represents a group of Products that are related. type: object required: + - created_at + - deleted_at + - handle + - id + - metadata - title + - updated_at properties: id: - type: string description: The product collection's ID + type: string example: pcol_01F0YESBFAZ0DV6V831JXWH0BG title: description: The title that the Product Collection is identified by. @@ -16,6 +22,7 @@ properties: description: >- A unique string that identifies the Product Collection - can for example be used in slug structures. + nullable: true type: string example: summer-collection products: @@ -25,21 +32,22 @@ properties: type: array items: type: object - description: A product collection object. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ProductOption.yaml b/docs/api/admin/components/schemas/ProductOption.yaml index 0179d34d93..3de3f509d9 100644 --- a/docs/api/admin/components/schemas/ProductOption.yaml +++ b/docs/api/admin/components/schemas/ProductOption.yaml @@ -5,15 +5,20 @@ description: >- limit what Product Options that can be defined. type: object required: - - title + - created_at + - deleted_at + - id + - metadata - product_id + - title + - updated_at properties: id: - type: string description: The product option's ID + type: string example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 title: - description: The title that the Product Option is defined by (e.g. "Size"). + description: The title that the Product Option is defined by (e.g. `Size`). type: string example: Size values: @@ -29,21 +34,24 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: A product object. Available if the relation `product` is expanded. + nullable: true type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ProductOptionValue.yaml b/docs/api/admin/components/schemas/ProductOptionValue.yaml index 467e538803..b247b13506 100644 --- a/docs/api/admin/components/schemas/ProductOptionValue.yaml +++ b/docs/api/admin/components/schemas/ProductOptionValue.yaml @@ -4,19 +4,24 @@ description: >- Product Option Value for each of the Product Options defined on the Product. type: object required: - - value + - created_at + - deleted_at + - id + - metadata - option_id + - updated_at + - value - variant_id properties: id: - type: string description: The product option value's ID + type: string example: optval_01F0YESHR7S6ECD03RF6W12DSJ value: description: >- The value that the Product Variant has defined for the specific Product - Option (e.g. if the Product Option is "Size" this value could be "Small", - "Medium" or "Large"). + Option (e.g. if the Product Option is \"Size\" this value could be + `Small`, `Medium` or `Large`). type: string example: large option_id: @@ -25,7 +30,8 @@ properties: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: ./ProductOption.yaml + nullable: true + type: object variant_id: description: >- The ID of the Product Variant that the Product Option Value is defined @@ -34,21 +40,24 @@ properties: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: ./ProductVariant.yaml + nullable: true + type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ProductTag.yaml b/docs/api/admin/components/schemas/ProductTag.yaml index 615174509c..7faa4a2c1b 100644 --- a/docs/api/admin/components/schemas/ProductTag.yaml +++ b/docs/api/admin/components/schemas/ProductTag.yaml @@ -2,30 +2,37 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The product tag's ID + type: string example: ptag_01G8K2MTMG9168F2B70S1TAVK3 value: description: The value that the Product Tag represents type: string example: Pants created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ProductTaxRate.yaml b/docs/api/admin/components/schemas/ProductTaxRate.yaml index a179b64cdd..d92b163428 100644 --- a/docs/api/admin/components/schemas/ProductTaxRate.yaml +++ b/docs/api/admin/components/schemas/ProductTaxRate.yaml @@ -4,8 +4,11 @@ description: >- a certain way type: object required: + - created_at + - metadata - product_id - rate_id + - updated_at properties: product_id: description: The ID of the Product @@ -13,6 +16,7 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. + nullable: true $ref: ./Product.yaml rate_id: description: The ID of the Tax Rate @@ -20,17 +24,19 @@ properties: example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. + nullable: true $ref: ./TaxRate.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ProductType.yaml b/docs/api/admin/components/schemas/ProductType.yaml index 88555b5bf4..579e7a6fb4 100644 --- a/docs/api/admin/components/schemas/ProductType.yaml +++ b/docs/api/admin/components/schemas/ProductType.yaml @@ -2,30 +2,37 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The product type's ID + type: string example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A value: description: The value that the Product Type represents. type: string example: Clothing created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ProductTypeTaxRate.yaml b/docs/api/admin/components/schemas/ProductTypeTaxRate.yaml index a11a7ba760..4539a32fc5 100644 --- a/docs/api/admin/components/schemas/ProductTypeTaxRate.yaml +++ b/docs/api/admin/components/schemas/ProductTypeTaxRate.yaml @@ -4,8 +4,11 @@ description: >- taxed in a certain way type: object required: + - created_at + - metadata - product_type_id - rate_id + - updated_at properties: product_type_id: description: The ID of the Product type @@ -13,6 +16,7 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. + nullable: true $ref: ./ProductType.yaml rate_id: description: The id of the Tax Rate @@ -20,17 +24,19 @@ properties: example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. + nullable: true $ref: ./TaxRate.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ProductVariant.yaml b/docs/api/admin/components/schemas/ProductVariant.yaml index 3079f7bb14..7f9d451c41 100644 --- a/docs/api/admin/components/schemas/ProductVariant.yaml +++ b/docs/api/admin/components/schemas/ProductVariant.yaml @@ -5,13 +5,32 @@ description: >- is given by the number of available Product Option combinations. type: object required: - - title - - product_id + - allow_backorder + - barcode + - created_at + - deleted_at + - ean + - height + - hs_code + - id - inventory_quantity + - length + - manage_inventory + - material + - metadata + - mid_code + - origin_country + - product_id + - sku + - title + - upc + - updated_at + - weight + - width properties: id: - type: string description: The product variant's ID + type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 title: description: >- @@ -25,6 +44,7 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: A product object. Available if the relation `product` is expanded. + nullable: true type: object prices: description: >- @@ -39,24 +59,29 @@ properties: The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems. + nullable: true type: string example: shirt-123 barcode: description: >- A generic field for a GTIN number that can be used to identify the Product Variant. + nullable: true type: string example: null ean: description: An EAN barcode number that can be used to identify the Product Variant. + nullable: true type: string example: null upc: description: A UPC barcode number that can be used to identify the Product Variant. + nullable: true type: string example: null variant_rank: description: The ranking of this variant + nullable: true type: number default: 0 inventory_quantity: @@ -77,12 +102,14 @@ properties: description: >- The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null origin_country: description: >- The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null mid_code: @@ -90,6 +117,7 @@ properties: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null material: @@ -97,30 +125,35 @@ properties: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null weight: description: >- The weight of the Product Variant. May be used in shipping rate calculations. - type: number - example: null - height: - description: >- - The height of the Product Variant. May be used in shipping rate - calculations. - type: number - example: null - width: - description: >- - The width of the Product Variant. May be used in shipping rate - calculations. + nullable: true type: number example: null length: description: >- The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: >- + The height of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + width: + description: >- + The width of the Product Variant. May be used in shipping rate + calculations. + nullable: true type: number example: null options: @@ -130,20 +163,29 @@ properties: type: array items: $ref: ./ProductOptionValue.yaml + inventory_items: + description: >- + The Inventory Items related to the product variant. Available if the + relation `inventory_items` is expanded. + type: array + items: + $ref: ./ProductVariantInventoryItem.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ProductVariantInventoryItem.yaml b/docs/api/admin/components/schemas/ProductVariantInventoryItem.yaml index f583f59667..d2f658ecfb 100644 --- a/docs/api/admin/components/schemas/ProductVariantInventoryItem.yaml +++ b/docs/api/admin/components/schemas/ProductVariantInventoryItem.yaml @@ -3,10 +3,18 @@ description: >- Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant. type: object +required: + - created_at + - deleted_at + - id + - inventory_item_id + - required_quantity + - updated_at + - variant_id properties: id: - type: string description: The product variant inventory item's ID + type: string example: pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A inventory_item_id: description: The id of the inventory item @@ -14,6 +22,10 @@ properties: variant_id: description: The id of the variant. type: string + variant: + description: A ProductVariant object. Available if the relation `variant` is expanded. + nullable: true + type: object required_quantity: description: >- The quantity of an inventory item required for one quantity of the @@ -21,14 +33,15 @@ properties: type: integer default: 1 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/admin/components/schemas/PublishableApiKey.yaml b/docs/api/admin/components/schemas/PublishableApiKey.yaml index 38818bccaf..dffb94d446 100644 --- a/docs/api/admin/components/schemas/PublishableApiKey.yaml +++ b/docs/api/admin/components/schemas/PublishableApiKey.yaml @@ -3,34 +3,42 @@ description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. type: object +required: + - created_at + - created_by + - id + - revoked_by + - revoked_at + - title + - updated_at properties: id: - type: string description: The key's ID + type: string example: pk_01G1G5V27GYX4QXNARRQCW1N8T created_by: - type: string description: The unique identifier of the user that created the key. - example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V - created_by_user: - description: A user object. Available if the relation `created_by_user` is expanded. - type: object - created_at: + nullable: true type: string - description: The date with timezone at which the resource was created. - format: date-time + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V revoked_by: - type: string description: The unique identifier of the user that revoked the key. - example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V - revoked_by_user: - description: A user object. Available if the relation `revoked_by_user` is expanded. - type: object - revoked_at: + nullable: true type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_at: description: The date with timezone at which the key was revoked. + nullable: true + type: string + format: date-time + title: + description: The key's title. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time diff --git a/docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml b/docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml index e2461daba5..ac6c018ad7 100644 --- a/docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml +++ b/docs/api/admin/components/schemas/PublishableApiKeySalesChannel.yaml @@ -1,12 +1,15 @@ title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels type: object +required: + - publishable_key_id + - sales_channel_id properties: sales_channel_id: - type: string description: The sales channel's ID + type: string example: sc_01G1G5V21KADXNGH29BJMAJ4B4 publishable_key_id: - type: string description: The publishable API key's ID + type: string example: pak_01G1G5V21KADXNGH29BJMAJ4B4 diff --git a/docs/api/admin/components/schemas/Refund.yaml b/docs/api/admin/components/schemas/Refund.yaml index 936eb3842c..fa82dfc64e 100644 --- a/docs/api/admin/components/schemas/Refund.yaml +++ b/docs/api/admin/components/schemas/Refund.yaml @@ -5,23 +5,46 @@ description: >- can also be initiated by a store operator. type: object required: - - order_id - amount + - created_at + - id + - idempotency_key + - metadata + - note + - order_id + - payment_id + - reason + - updated_at properties: id: - type: string description: The refund's ID + type: string example: ref_01G1G5V27GYX4QXNARRQCW1N8T order_id: description: The id of the Order that the Refund is related to. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object amount: description: The amount that has be refunded to the Customer. type: integer example: 1000 note: description: An optional note explaining why the amount was refunded. + nullable: true type: string example: I didn't like it reason: @@ -37,28 +60,26 @@ properties: - other example: return idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the refund in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/Region.yaml b/docs/api/admin/components/schemas/Region.yaml index 89b86870dc..a8df502e1f 100644 --- a/docs/api/admin/components/schemas/Region.yaml +++ b/docs/api/admin/components/schemas/Region.yaml @@ -6,13 +6,22 @@ description: >- countries. type: object required: - - name + - automatic_taxes + - created_at - currency_code + - deleted_at + - gift_cards_taxable + - id + - metadata + - name + - tax_code + - tax_provider_id - tax_rate + - updated_at properties: id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: description: >- @@ -29,6 +38,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml tax_rate: description: The tax rate that should be charged on purchases in the Region. @@ -45,6 +55,7 @@ properties: description: >- The tax code used on purchases in the Region. This may be used by other systems for accounting purposes. + nullable: true type: string example: null gift_cards_taxable: @@ -63,11 +74,13 @@ properties: items: $ref: ./Country.yaml tax_provider_id: - type: string description: The ID of the tax provider used in this region + nullable: true + type: string example: null tax_provider: description: Available if the relation `tax_provider` is expanded. + nullable: true $ref: ./TaxProvider.yaml payment_providers: description: >- @@ -79,27 +92,30 @@ properties: fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the - Region. Available if the relation `payment_providers` is expanded. + Region. Available if the relation `fulfillment_providers` is expanded. type: array items: $ref: ./FulfillmentProvider.yaml includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean + default: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/Return.yaml b/docs/api/admin/components/schemas/Return.yaml index 406389b61d..dfbb629cea 100644 --- a/docs/api/admin/components/schemas/Return.yaml +++ b/docs/api/admin/components/schemas/Return.yaml @@ -5,11 +5,24 @@ description: >- of a Swap. type: object required: + - claim_order_id + - created_at + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - received_at - refund_amount + - shipping_data + - status + - swap_id + - updated_at properties: id: - type: string description: The return's ID + type: string example: ret_01F0YET7XPCMF8RZ0Y151NZV2V status: description: Status of the Return. @@ -29,70 +42,85 @@ properties: $ref: ./ReturnItem.yaml swap_id: description: The ID of the Swap that the Return is a part of. + nullable: true type: string example: null swap: description: A swap object. Available if the relation `swap` is expanded. - type: object - order_id: - description: The ID of the Order that the Return is made from. - type: string - example: order_01G8TJSYT9M6AVS5N4EMNFS1EK - order: - description: An order object. Available if the relation `order` is expanded. + nullable: true type: object claim_order_id: description: The ID of the Claim that the Return is a part of. + nullable: true type: string example: null claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Return is made from. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true type: object shipping_method: description: >- The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded. - type: array - items: - $ref: ./ShippingMethod.yaml + nullable: true + $ref: ./ShippingMethod.yaml shipping_data: description: >- Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment. + nullable: true type: object example: {} + location_id: + description: The id of the stock location the return will be added back. + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK refund_amount: description: The amount that should be refunded as a result of the return. type: integer example: 1000 no_notification: description: When set to true, no notification will be sent related to this return. + nullable: true type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the return in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. received_at: description: The date with timezone at which the return was received. + nullable: true type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ReturnItem.yaml b/docs/api/admin/components/schemas/ReturnItem.yaml index d56d8604a5..f2e6e78b7a 100644 --- a/docs/api/admin/components/schemas/ReturnItem.yaml +++ b/docs/api/admin/components/schemas/ReturnItem.yaml @@ -4,22 +4,31 @@ description: >- Line Item that will be returned. type: object required: - - return_id + - is_requested - item_id + - metadata + - note + - quantity + - reason_id + - received_quantity + - requested_quantity + - return_id properties: return_id: description: The id of the Return that the Return Item belongs to. type: string example: ret_01F0YET7XPCMF8RZ0Y151NZV2V - return_order: - description: Available if the relation `return_order` is expanded. - $ref: ./Return.yaml item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + return_order: + description: Available if the relation `return_order` is expanded. + nullable: true + type: object item: description: Available if the relation `item` is expanded. + nullable: true $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Return. @@ -33,25 +42,31 @@ properties: default: true requested_quantity: description: The quantity that was originally requested to be returned. + nullable: true type: integer example: 1 - recieved_quantity: + received_quantity: description: The quantity that was received in the warehouse. + nullable: true type: integer example: 1 reason_id: description: The ID of the reason for returning the item. + nullable: true type: string example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. + nullable: true $ref: ./ReturnReason.yaml note: description: An optional note with additional details about the Return. + nullable: true type: string example: I didn't like it. metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ReturnReason.yaml b/docs/api/admin/components/schemas/ReturnReason.yaml index ff9a50bf3f..37715c1fe9 100644 --- a/docs/api/admin/components/schemas/ReturnReason.yaml +++ b/docs/api/admin/components/schemas/ReturnReason.yaml @@ -4,49 +4,61 @@ description: >- Return Items in order to indicate why a Line Item was returned. type: object required: - - value + - created_at + - deleted_at + - description + - id - label + - metadata + - parent_return_reason_id + - updated_at + - value properties: id: + description: The return reason's ID type: string - description: The cart's ID example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ - description: - description: A description of the Reason. - type: string - example: Items that are damaged - label: - description: A text that can be displayed to the Customer as a reason. - type: string - example: Damaged goods value: description: The value to identify the reason by. type: string example: damaged - parent_return_reason_id: + label: + description: A text that can be displayed to the Customer as a reason. type: string + example: Damaged goods + description: + description: A description of the Reason. + nullable: true + type: string + example: Items that are damaged + parent_return_reason_id: description: The ID of the parent reason. + nullable: true + type: string example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: ./ReturnReason.yaml + nullable: true + type: object return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: ./ReturnReason.yaml + type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/SalesChannel.yaml b/docs/api/admin/components/schemas/SalesChannel.yaml index a79b3fd206..dbb40f089c 100644 --- a/docs/api/admin/components/schemas/SalesChannel.yaml +++ b/docs/api/admin/components/schemas/SalesChannel.yaml @@ -2,11 +2,17 @@ title: Sales Channel description: A Sales Channel type: object required: + - created_at + - deleted_at + - description + - id + - is_disabled - name + - updated_at properties: id: - type: string description: The sales channel's ID + type: string example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A name: description: The name of the sales channel. @@ -14,21 +20,30 @@ properties: example: Market description: description: The description of the sales channel. + nullable: true type: string example: Multi-vendor market is_disabled: description: Specify if the sales channel is enabled or disabled. type: boolean default: false + locations: + description: >- + The Stock Locations related to the sales channel. Available if the + relation `locations` is expanded. + type: array + items: + $ref: ./SalesChannelLocation.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/admin/components/schemas/SalesChannelLocation.yaml b/docs/api/admin/components/schemas/SalesChannelLocation.yaml new file mode 100644 index 0000000000..27ec4fd84b --- /dev/null +++ b/docs/api/admin/components/schemas/SalesChannelLocation.yaml @@ -0,0 +1,41 @@ +title: Sales Channel Stock Location +description: Sales Channel Stock Location link sales channels with stock locations. +type: object +required: + - created_at + - deleted_at + - id + - location_id + - sales_channel_id + - updated_at +properties: + id: + description: The Sales Channel Stock Location's ID + type: string + example: scloc_01G8X9A7ESKAJXG2H0E6F1MW7A + sales_channel_id: + description: The id of the Sales Channel + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + location_id: + description: The id of the Location Stock. + type: string + sales_channel: + description: >- + The sales channel the location is associated with. Available if the + relation `sales_channel` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time diff --git a/docs/api/admin/components/schemas/ShippingMethod.yaml b/docs/api/admin/components/schemas/ShippingMethod.yaml index 9ac6b87cc6..04dcb7020c 100644 --- a/docs/api/admin/components/schemas/ShippingMethod.yaml +++ b/docs/api/admin/components/schemas/ShippingMethod.yaml @@ -6,58 +6,76 @@ description: >- shipment. type: object required: - - shipping_option_id + - cart_id + - claim_order_id + - data + - id + - order_id - price + - return_id + - shipping_option_id + - swap_id properties: id: - type: string description: The shipping method's ID + type: string example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_option_id: description: The id of the Shipping Option that the Shipping Method is built from. type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T - shipping_option: - description: Available if the relation `shipping_option` is expanded. - $ref: ./ShippingOption.yaml order_id: description: The id of the Order that the Shipping Method is used on. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. - type: object - return_id: - description: The id of the Return that the Shipping Method is used on. - type: string - example: null - return_order: - description: A return object. Available if the relation `return_order` is expanded. - type: object - swap_id: - description: The id of the Swap that the Shipping Method is used on. - type: string - example: null - swap: - description: A swap object. Available if the relation `swap` is expanded. - type: object - cart_id: - description: The id of the Cart that the Shipping Method is used on. - type: string - example: cart_01G8ZH853Y6TFXWPG5EYE81X63 - cart: - description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object claim_order_id: description: The id of the Claim that the Shipping Method is used on. + nullable: true type: string example: null claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object + cart_id: + description: The id of the Cart that the Shipping Method is used on. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Shipping Method is used on. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + return_id: + description: The id of the Return that the Shipping Method is used on. + nullable: true + type: string + example: null + return_order: + description: A return object. Available if the relation `return_order` is expanded. + nullable: true + type: object + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: ./ShippingOption.yaml tax_lines: - type: array description: Available if the relation `tax_lines` is expanded. + type: array items: $ref: ./ShippingMethodTaxLine.yaml price: @@ -77,3 +95,16 @@ properties: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean + default: false + subtotal: + description: The subtotal of the shipping + type: integer + example: 8000 + total: + description: The total amount of the shipping + type: integer + example: 8200 + tax_total: + description: The total of tax + type: integer + example: 0 diff --git a/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml b/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml index 1089796789..d251624dca 100644 --- a/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml +++ b/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml @@ -2,23 +2,22 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line type: object required: + - code + - created_at + - id - shipping_method_id - - rate + - metadata - name + - rate + - updated_at properties: id: - type: string description: The line item tax line's ID - example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 - shipping_method_id: type: string - description: The ID of the line item - example: sm_01F0YET7DR2E7CYVSDHM593QG2 - shipping_method: - description: Available if the relation `shipping_method` is expanded. - $ref: ./ShippingMethod.yaml + example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 code: description: A code to identify the tax type by + nullable: true type: string example: tax01 name: @@ -29,16 +28,25 @@ properties: description: The numeric rate to charge tax by type: number example: 10 - created_at: + shipping_method_id: + description: The ID of the line item type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_method: + description: Available if the relation `shipping_method` is expanded. + nullable: true + type: object + created_at: description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ShippingOption.yaml b/docs/api/admin/components/schemas/ShippingOption.yaml index 0efbef070c..a8eebad545 100644 --- a/docs/api/admin/components/schemas/ShippingOption.yaml +++ b/docs/api/admin/components/schemas/ShippingOption.yaml @@ -8,15 +8,24 @@ description: >- additional information. type: object required: + - admin_only + - amount + - created_at + - data + - deleted_at + - id + - is_return + - metadata - name - - region_id + - price_type - profile_id - provider_id - - price_type + - region_id + - updated_at properties: id: - type: string description: The shipping option's ID + type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T name: description: >- @@ -25,11 +34,12 @@ properties: type: string example: PostFake Standard region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. + nullable: true type: object profile_id: description: >- @@ -40,6 +50,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. + nullable: true $ref: ./ShippingProfile.yaml provider_id: description: >- @@ -49,6 +60,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. + nullable: true $ref: ./FulfillmentProvider.yaml price_type: description: >- @@ -64,12 +76,19 @@ properties: description: >- The amount to charge for shipping when the Shipping Option price type is `flat_rate`. + nullable: true type: integer example: 200 is_return: description: Flag to indicate if the Shipping Option can be used for Return shipments. type: boolean default: false + admin_only: + description: >- + Flag to indicate if the Shipping Option usage is restricted to admin + users. + type: boolean + default: false requirements: description: >- The requirements that must be satisfied for the Shipping Option to be @@ -87,20 +106,23 @@ properties: includes_tax: description: '[EXPERIMENTAL] Does the shipping option price include tax' type: boolean + default: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml b/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml index bebafda0ea..57d045827c 100644 --- a/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml +++ b/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml @@ -4,13 +4,15 @@ description: >- to the Cart. type: object required: + - amount + - deleted_at + - id - shipping_option_id - type - - amount properties: id: - type: string description: The shipping option requirement's ID + type: string example: sor_01G1G5V29AB4CTNDRFSRWSRKWD shipping_option_id: description: >- @@ -20,7 +22,8 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./ShippingOption.yaml + nullable: true + type: object type: description: >- The type of the requirement, this defines how the value will be compared @@ -38,6 +41,7 @@ properties: type: integer example: 100 deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/admin/components/schemas/ShippingProfile.yaml b/docs/api/admin/components/schemas/ShippingProfile.yaml index 0afd646078..15ffd42c84 100644 --- a/docs/api/admin/components/schemas/ShippingProfile.yaml +++ b/docs/api/admin/components/schemas/ShippingProfile.yaml @@ -4,12 +4,17 @@ description: >- fulfill a given set of Products. type: object required: + - created_at + - deleted_at + - id + - metadata - name - type + - updated_at properties: id: - type: string description: The shipping profile's ID + type: string example: sp_01G1G5V239ENSZ5MV4JAR737BM name: description: >- @@ -34,7 +39,6 @@ properties: type: array items: type: object - description: A product object. shipping_options: description: >- The Shipping Options that can be used to fulfill the Products in the @@ -42,21 +46,23 @@ properties: expanded. type: array items: - $ref: ./ShippingOption.yaml + type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ShippingTaxRate.yaml b/docs/api/admin/components/schemas/ShippingTaxRate.yaml index 7ab7938fb0..78734007ac 100644 --- a/docs/api/admin/components/schemas/ShippingTaxRate.yaml +++ b/docs/api/admin/components/schemas/ShippingTaxRate.yaml @@ -4,8 +4,11 @@ description: >- option is taxed in a certain way type: object required: - - shipping_option_id + - created_at + - metadata - rate_id + - shipping_option_id + - updated_at properties: shipping_option_id: description: The ID of the Shipping Option @@ -13,6 +16,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. + nullable: true $ref: ./ShippingOption.yaml rate_id: description: The ID of the Tax Rate @@ -20,17 +24,19 @@ properties: example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. + nullable: true $ref: ./TaxRate.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/StagedJob.yaml b/docs/api/admin/components/schemas/StagedJob.yaml index a31192dbdc..adc7c6beab 100644 --- a/docs/api/admin/components/schemas/StagedJob.yaml +++ b/docs/api/admin/components/schemas/StagedJob.yaml @@ -2,11 +2,14 @@ title: Staged Job description: A staged job resource type: object required: + - data - event_name + - id + - options properties: id: - type: string description: The staged job's ID + type: string example: job_01F0YET7BZTARY9MKN1SJ7AAXF event_name: description: The name of the event @@ -16,3 +19,7 @@ properties: description: Data necessary for the job type: object example: {} + option: + description: The staged job's option + type: object + example: {} diff --git a/docs/api/admin/components/schemas/Store.yaml b/docs/api/admin/components/schemas/Store.yaml index d96015e522..93232178dc 100644 --- a/docs/api/admin/components/schemas/Store.yaml +++ b/docs/api/admin/components/schemas/Store.yaml @@ -1,10 +1,21 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. type: object +required: + - created_at + - default_currency_code + - default_location_id + - id + - invite_link_template + - metadata + - name + - payment_link_template + - swap_link_template + - updated_at properties: id: - type: string description: The store's ID + type: string example: store_01G1G5V21KADXNGH29BJMAJ4B4 name: description: The name of the Store - this may be displayed to the Customer. @@ -19,6 +30,7 @@ properties: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. + nullable: true $ref: ./Currency.yaml currencies: description: >- @@ -31,29 +43,48 @@ properties: description: >- A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link. + nullable: true type: string example: null payment_link_template: description: >- A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link. + nullable: true type: string example: null invite_link_template: description: A template to generate Invite links from + nullable: true + type: string + example: null + default_location_id: + description: The location ID the store is associated with. + nullable: true type: string example: null default_sales_channel_id: - type: string description: The sales channel ID the cart is associated with. + nullable: true + type: string example: null default_sales_channel: description: >- A sales channel object. Available if the relation `default_sales_channel` is expanded. - type: object + nullable: true + $ref: ./SalesChannel.yaml + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/Swap.yaml b/docs/api/admin/components/schemas/Swap.yaml index 97a560fcc8..e4ab8da2b8 100644 --- a/docs/api/admin/components/schemas/Swap.yaml +++ b/docs/api/admin/components/schemas/Swap.yaml @@ -9,13 +9,26 @@ description: >- difference. type: object required: + - allow_backorder + - canceled_at + - cart_id + - confirmed_at + - created_at + - deleted_at + - difference_due - fulfillment_status - - payment_status + - id + - idempotency_key + - metadata + - no_notification - order_id + - payment_status + - shipping_address_id + - updated_at properties: id: - type: string description: The swap's ID + type: string example: swap_01F0YET86Y9G92D3YDR9Y6V676 fulfillment_status: description: The status of the Fulfillment of the Swap. @@ -24,6 +37,7 @@ properties: - not_fulfilled - fulfilled - shipped + - partially_shipped - canceled - requires_action example: not_fulfilled @@ -49,6 +63,7 @@ properties: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object additional_items: description: >- @@ -61,6 +76,7 @@ properties: description: >- A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded. + nullable: true type: object fulfillments: description: >- @@ -74,22 +90,26 @@ properties: The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. + nullable: true type: object difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products. + nullable: true type: integer example: 0 shipping_address_id: description: >- The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. + nullable: true type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_methods: description: >- @@ -100,50 +120,58 @@ properties: $ref: ./ShippingMethod.yaml cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object + confirmed_at: + description: The date with timezone at which the Swap was confirmed by the Customer. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + nullable: true + type: string + format: date-time + no_notification: + description: If set to true, no notification will be sent related to this swap + nullable: true + type: boolean + example: false allow_backorder: description: If true, swaps can be completed with items out of stock type: boolean default: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the swap in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - confirmed_at: - description: The date with timezone at which the Swap was confirmed by the Customer. - type: string - format: date-time - canceled_at: - description: The date with timezone at which the Swap was canceled. - type: string - format: date-time - no_notification: - description: If set to true, no notification will be sent related to this swap - type: boolean - example: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/TaxLine.yaml b/docs/api/admin/components/schemas/TaxLine.yaml index 3300d86797..cca22c81f3 100644 --- a/docs/api/admin/components/schemas/TaxLine.yaml +++ b/docs/api/admin/components/schemas/TaxLine.yaml @@ -2,15 +2,21 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. type: object required: - - rate + - code + - created_at + - id + - metadata - name + - rate + - updated_at properties: id: - type: string description: The tax line's ID + type: string example: tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 code: description: A code to identify the tax type by + nullable: true type: string example: tax01 name: @@ -22,15 +28,16 @@ properties: type: number example: 10 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/TaxProvider.yaml b/docs/api/admin/components/schemas/TaxProvider.yaml index dc2b7ef07e..55c326d81c 100644 --- a/docs/api/admin/components/schemas/TaxProvider.yaml +++ b/docs/api/admin/components/schemas/TaxProvider.yaml @@ -1,6 +1,9 @@ title: Tax Provider description: The tax service used to calculate taxes type: object +required: + - id + - is_installed properties: id: description: The id of the tax provider as given by the plugin. diff --git a/docs/api/admin/components/schemas/TaxRate.yaml b/docs/api/admin/components/schemas/TaxRate.yaml index 48ff10fd0c..deb3f4d02e 100644 --- a/docs/api/admin/components/schemas/TaxRate.yaml +++ b/docs/api/admin/components/schemas/TaxRate.yaml @@ -4,19 +4,27 @@ description: >- within a given Region type: object required: + - code + - created_at + - id + - metadata - name + - rate - region_id + - updated_at properties: id: - type: string description: The tax rate's ID + type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR rate: description: The numeric rate to charge + nullable: true type: number example: 10 code: description: A code to identify the tax type by + nullable: true type: string example: tax01 name: @@ -24,58 +32,57 @@ properties: type: string example: Tax Example region_id: - type: string description: The id of the Region that the rate belongs to + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. + nullable: true type: object products: - type: array description: >- The products that belong to this tax rate. Available if the relation `products` is expanded. - items: - type: object - description: A product object. - product_types: type: array + items: + $ref: ./Product.yaml + product_types: description: >- The product types that belong to this tax rate. Available if the relation `product_types` is expanded. + type: array items: - type: object - description: A product type object. + $ref: ./ProductType.yaml shipping_options: type: array description: >- The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. items: - type: object - description: A shipping option object. + $ref: ./ShippingOption.yaml product_count: description: The count of products type: integer - example: null + example: 10 product_type_count: description: The count of product types type: integer - example: null + example: 2 shipping_option_count: description: The count of shipping options type: integer - example: null + example: 1 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/TrackingLink.yaml b/docs/api/admin/components/schemas/TrackingLink.yaml index 85a7f696e7..eb8ccde118 100644 --- a/docs/api/admin/components/schemas/TrackingLink.yaml +++ b/docs/api/admin/components/schemas/TrackingLink.yaml @@ -5,15 +5,23 @@ description: >- status of the shipment. type: object required: - - tracking_number + - created_at + - deleted_at - fulfillment_id + - id + - idempotency_key + - metadata + - tracking_number + - updated_at + - url properties: id: - type: string description: The tracking link's ID + type: string example: tlink_01G8ZH853Y6TFXWPG5EYE81X63 url: description: The URL at which the status of the shipment can be tracked. + nullable: true type: string format: uri tracking_number: @@ -21,35 +29,39 @@ properties: type: string format: RH370168054CN fulfillment_id: - type: string description: The id of the Fulfillment that the Tracking Link references. + type: string example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: ./Fulfillment.yaml + nullable: true + type: object idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a process in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/User.yaml b/docs/api/admin/components/schemas/User.yaml index c35e299a8f..cdf5cf7506 100644 --- a/docs/api/admin/components/schemas/User.yaml +++ b/docs/api/admin/components/schemas/User.yaml @@ -2,42 +2,64 @@ title: User description: Represents a User who can manage store settings. type: object required: + - api_token + - created_at + - deleted_at - email + - first_name + - id + - last_name + - metadata + - role + - updated_at properties: id: - type: string description: The user's ID + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + role: + description: The user's role + type: string + enum: + - admin + - member + - developer + default: member email: description: The email of the User type: string format: email first_name: description: The first name of the User + nullable: true type: string example: Levi last_name: description: The last name of the User + nullable: true type: string example: Bogan api_token: description: An API token associated with the user. + nullable: true type: string example: null created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/paths/order_{id}_claims.yaml b/docs/api/admin/paths/order_{id}_claims.yaml index 79b864b18e..b9e5445e8c 100644 --- a/docs/api/admin/paths/order_{id}_claims.yaml +++ b/docs/api/admin/paths/order_{id}_claims.yaml @@ -10,6 +10,16 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -17,6 +27,7 @@ post: $ref: ../components/schemas/AdminPostOrdersOrderClaimsReq.yaml x-codegen: method: createClaim + params: AdminPostOrdersOrderClaimsParams x-codeSamples: - lang: JavaScript label: JS Client 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 f54dfd8f8c..a91f61b942 100644 --- a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml +++ b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml @@ -16,6 +16,16 @@ post: description: The ID of the Claim. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -23,6 +33,7 @@ post: $ref: ../components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml x-codegen: method: updateClaim + params: AdminPostOrdersOrderClaimsClaimParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/order_{id}_swaps.yaml b/docs/api/admin/paths/order_{id}_swaps.yaml index 7961755f41..1aa00a6fb7 100644 --- a/docs/api/admin/paths/order_{id}_swaps.yaml +++ b/docs/api/admin/paths/order_{id}_swaps.yaml @@ -12,6 +12,20 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded the order of the + result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included the order of the + result. + schema: + type: string requestBody: content: application/json: @@ -19,6 +33,7 @@ post: $ref: ../components/schemas/AdminPostOrdersOrderSwapsReq.yaml x-codegen: method: createSwap + queryParams: AdminPostOrdersOrderSwapsParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}.yaml b/docs/api/admin/paths/orders_{id}.yaml index 4f13709710..555f7b277a 100644 --- a/docs/api/admin/paths/orders_{id}.yaml +++ b/docs/api/admin/paths/orders_{id}.yaml @@ -68,6 +68,16 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -75,6 +85,7 @@ post: $ref: ../components/schemas/AdminPostOrdersOrderReq.yaml x-codegen: method: update + params: AdminPostOrdersOrderParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}_archive.yaml b/docs/api/admin/paths/orders_{id}_archive.yaml index 887fde4edb..10fbab9ecc 100644 --- a/docs/api/admin/paths/orders_{id}_archive.yaml +++ b/docs/api/admin/paths/orders_{id}_archive.yaml @@ -10,8 +10,19 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: archive + params: AdminPostOrdersOrderArchiveParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_cancel.yaml index 3435f201c3..7c499cbd0a 100644 --- a/docs/api/admin/paths/orders_{id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_cancel.yaml @@ -13,8 +13,19 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: cancel + params: AdminPostOrdersOrderCancel x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}_capture.yaml b/docs/api/admin/paths/orders_{id}_capture.yaml index c123df3c15..240ae56920 100644 --- a/docs/api/admin/paths/orders_{id}_capture.yaml +++ b/docs/api/admin/paths/orders_{id}_capture.yaml @@ -10,8 +10,19 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: capturePayment + params: AdminPostOrdersOrderCaptureParams x-codeSamples: - lang: JavaScript label: JS Client 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 3121aeadd5..c380d75a35 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 @@ -16,8 +16,19 @@ post: description: The ID of the Claim. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: cancelClaim + params: AdminPostOrdersClaimCancel x-codeSamples: - lang: JavaScript label: JS Client 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 a5765acd2f..4c0fa7d0a4 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 @@ -16,6 +16,16 @@ post: description: The ID of the Claim. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -24,6 +34,7 @@ post: ../components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml x-codegen: method: fulfillClaim + params: AdminPostOrdersOrderClaimsClaimFulfillmentsReq x-codeSamples: - lang: JavaScript label: JS Client 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 1b710a2a4d..dcfb4b1201 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 @@ -22,8 +22,19 @@ post: description: The ID of the Fulfillment. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: cancelClaimFulfillment + params: AdminPostOrdersClaimFulfillmentsCancelParams x-codeSamples: - lang: JavaScript label: JS Client 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 4105a6e953..c510f0ac12 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 @@ -16,6 +16,16 @@ post: description: The ID of the Claim. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -24,6 +34,7 @@ post: ../components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml x-codegen: method: createClaimShipment + params: AdminPostOrdersOrderClaimsClaimShipmentsParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}_complete.yaml b/docs/api/admin/paths/orders_{id}_complete.yaml index 77a3ccd082..29d3d5a529 100644 --- a/docs/api/admin/paths/orders_{id}_complete.yaml +++ b/docs/api/admin/paths/orders_{id}_complete.yaml @@ -10,8 +10,19 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: complete + params: AdminPostOrdersOrderCompleteParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}_fulfillment.yaml b/docs/api/admin/paths/orders_{id}_fulfillment.yaml index 959a9fdbe8..78331b8a72 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillment.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillment.yaml @@ -12,6 +12,16 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -19,6 +29,7 @@ post: $ref: ../components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml x-codegen: method: createFulfillment + params: AdminPostOrdersOrderFulfillmentsParams x-codeSamples: - lang: JavaScript label: JS Client 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 28d300c753..ad8e739fda 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 @@ -16,8 +16,19 @@ post: description: The ID of the Fulfillment schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: cancelFulfillment + params: AdminPostOrdersOrderFulfillementsCancelParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}_refund.yaml b/docs/api/admin/paths/orders_{id}_refund.yaml index 505319e781..d05590568a 100644 --- a/docs/api/admin/paths/orders_{id}_refund.yaml +++ b/docs/api/admin/paths/orders_{id}_refund.yaml @@ -10,6 +10,16 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -17,6 +27,7 @@ post: $ref: ../components/schemas/AdminPostOrdersOrderRefundsReq.yaml x-codegen: method: refundPayment + params: AdminPostOrdersOrderRefundsParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}_return.yaml b/docs/api/admin/paths/orders_{id}_return.yaml index 209c6b1367..d034374384 100644 --- a/docs/api/admin/paths/orders_{id}_return.yaml +++ b/docs/api/admin/paths/orders_{id}_return.yaml @@ -12,6 +12,16 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -19,6 +29,7 @@ post: $ref: ../components/schemas/AdminPostOrdersOrderReturnsReq.yaml x-codegen: method: requestReturn + params: AdminPostOrdersOrderReturnsParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}_shipment.yaml b/docs/api/admin/paths/orders_{id}_shipment.yaml index e515068d65..138e916c1b 100644 --- a/docs/api/admin/paths/orders_{id}_shipment.yaml +++ b/docs/api/admin/paths/orders_{id}_shipment.yaml @@ -10,6 +10,16 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -17,6 +27,7 @@ post: $ref: ../components/schemas/AdminPostOrdersOrderShipmentReq.yaml x-codegen: method: createShipment + params: AdminPostOrdersOrderShipmentParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml index 33f35845e3..27014e6203 100644 --- a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml +++ b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml @@ -11,6 +11,16 @@ post: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -19,6 +29,7 @@ post: x-authenticated: true x-codegen: method: addShippingMethod + params: AdminPostOrdersOrderShippingMethodsParams x-codeSamples: - lang: JavaScript label: JS Client 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 14f3e851aa..2dec550158 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 @@ -16,8 +16,19 @@ post: description: The ID of the Swap. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: cancelSwap + params: AdminPostOrdersSwapCancelParams x-codeSamples: - lang: JavaScript label: JS Client 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 930b2c27da..cacdf51ac9 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 @@ -16,6 +16,16 @@ post: description: The ID of the Swap. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -24,6 +34,7 @@ post: ../components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml x-codegen: method: fulfillSwap + params: AdminPostOrdersOrderSwapsSwapFulfillmentsParams x-codeSamples: - lang: JavaScript label: JS Client 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 bbb2ee1119..e1a205e7e9 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 @@ -22,8 +22,19 @@ post: description: The ID of the Fulfillment. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: cancelSwapFulfillment + params: AdminPostOrdersSwapFulfillementsCancelParams x-codeSamples: - lang: JavaScript label: JS Client 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 0e8e6662af..c5aca27e66 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 @@ -19,8 +19,19 @@ post: description: The ID of the Swap. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string x-codegen: method: processSwapPayment + params: AdminPostOrdersOrderSwapsSwapProcessPaymentParams x-codeSamples: - lang: JavaScript label: JS Client 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 da59a0ff0c..8339a2ea01 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 @@ -16,6 +16,16 @@ post: description: The ID of the Swap. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the result. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the result. + schema: + type: string requestBody: content: application/json: @@ -23,6 +33,7 @@ post: $ref: ../components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml x-codegen: method: createSwapShipment + params: AdminPostOrdersOrderSwapsSwapShipmentsParams x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json new file mode 100644 index 0000000000..da7d1fb54f --- /dev/null +++ b/docs/api/store-spec3.json @@ -0,0 +1,12639 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Medusa Storefront API + description: > + API reference for Medusa's Storefront endpoints. All endpoints are prefixed + with `/store`. + + + ## Authentication + + + To send requests as an authenticated customer, you must use the Cookie + Session ID. + + + + + + ## Expanding Fields + + + In many endpoints you'll find an `expand` query parameter that can be passed + to the endpoint. You can use the `expand` query parameter to unpack an + entity's relations and return them in the response. + + + For example, when you list customers you can also retrieve their groups by + passing to the `expand` query parameter the value `groups`. + + + You can expand more than one relation by separating the relations in the + `expand` query parameter with a comma. For example, to retrieve both the + orders and the groups of a customer, pass to the `expand` query parameter + the value `groups,orders`. + + + Please note that the parameters you pass to `expand` replace any relations + that are expanded by default. + + + ## Selecting Fields + + + In many endpoints you'll find a `fields` query parameter that can be passed + to the endpoint. You can use the `fields` query parameter to specify which + fields in the entity should be returned in the response. + + + You can pass more than one field by seperating the field names in the + `fields` query parameter with a comma. + + + Only the fields you pass to `field` will be retrieved and returned in the + response. Any fields that are returned by default will not be returned in + this case. This does not affect relations. + + + For example, to only select the `title` and `description` fields of a + product, pass to the `fields` query parameter the value `title,description`. + + + ## Pagination + + + ### Query Parameters + + + In listing endpoints, such as list customers or list products, you can + control the pagination using the query parameters `limit` and `offset`. + + + `limit` is used to specify the maximum number of items that can be return in + the response. `offset` is used to specify how many items to skip before + returning the resulting entities. + + + You can use the `offset` query parameter to change between pages. For + example, if the limit is 50, at page 1 the offset should be 0; at page 2 the + offset should be 50, and so on. + + + ### Response Fields + + + In listing fields, aside from the entities retrieved, there are three + pagination-related fields returned: `count`, `limit`, and `offset`. + + + Similarly to the query parameters, `limit` is the maximum number of items + that can be returned in the response, and `field` is the number of items + that were skipped before the entities in the result. + + + `count` is the total number of available items of this entity. It can be + used to determine how many pages are there. + + + For example, if the `count` is 100 and the `limit` is 50, you can divide the + `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. + license: + name: MIT + url: 'https://github.com/medusajs/medusa/blob/master/LICENSE' +tags: + - name: Auth + description: >- + Auth endpoints that allow authorization of customers and manages their + sessions. + - name: Cart + description: Cart endpoints that allow handling carts in Medusa. + - name: Collection + description: Collection endpoints that allow handling collections in Medusa. + - name: Customer + description: Customer endpoints that allow handling customers in Medusa. + - name: Gift Card + description: Gift Card endpoints that allow handling gift cards in Medusa. + - name: Order + description: Order endpoints that allow handling orders in Medusa. + - name: Product + description: Product endpoints that allow handling products in Medusa. + - name: Product Variant + description: Product Variant endpoints that allow handling product variants in Medusa. + - name: Region + description: Region endpoints that allow handling regions in Medusa. + - name: Return Reason + description: Return Reason endpoints that allow handling return reasons in Medusa. + - name: Return + description: Return endpoints that allow handling returns in Medusa. + - name: Shipping Option + description: Shipping Option endpoints that allow handling shipping options in Medusa. + - name: Swap + description: Swap endpoints that allow handling swaps in Medusa. +servers: + - url: 'https://api.medusa-commerce.com/store' +paths: + /auth: + post: + operationId: PostAuth + summary: Customer Login + description: >- + Logs a Customer in and authorizes them to view their details. Successful + authentication will set a session cookie in the Customer's browser. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostAuthReq' + x-codegen: + method: authenticate + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.auth.authenticate({ + email: 'user@example.com', + password: 'user@example.com' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/incorrect_credentials' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteAuth + summary: Customer Log out + description: Destroys a Customer's authenticated session. + x-authenticated: true + x-codegen: + method: deleteSession + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request DELETE 'https://medusa-url.com/store/auth' + \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetAuth + summary: Get Current Customer + description: Gets the currently logged in Customer. + x-authenticated: true + x-codegen: + method: getSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.auth.getSession() + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/auth' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/auth/{email}': + get: + operationId: GetAuthEmail + summary: Check if email exists + description: Checks if a Customer with the given email has signed up. + parameters: + - in: path + name: email + schema: + type: string + format: email + required: true + description: The email to check if exists. + x-codegen: + method: exists + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.auth.exists('user@example.com') + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/auth/user@example.com' \ + + --header 'Cookie: connect.sid={sid}' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGetAuthEmailRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/shipping-methods': + post: + operationId: PostCartsCartShippingMethod + description: Adds a Shipping Method to the Cart. + summary: Add a Shipping Method + parameters: + - in: path + name: id + required: true + description: The cart ID. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartShippingMethodReq' + x-codegen: + method: addShippingMethod + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.addShippingMethod(cart_id, { + option_id + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "option_id": "{option_id}", + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/taxes': + post: + summary: Calculate Cart Taxes + operationId: PostCartsCartTaxes + description: >- + Calculates taxes for a cart. Depending on the cart's region this may + involve making 3rd party API calls to a Tax Provider service. + parameters: + - in: path + name: id + required: true + description: The Cart ID. + schema: + type: string + x-codegen: + method: calculateTaxes + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/taxes' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/complete': + post: + summary: Complete a Cart + operationId: PostCartsCartComplete + description: >- + Completes a cart. The following steps will be performed. Payment + authorization is attempted and if more work is required, we simply + return the cart for further updates. If payment is authorized and order + is not yet created, we make sure to do so. The completion of a cart can + be performed idempotently with a provided header `Idempotency-Key`. If + not provided, we will generate one for the request. + parameters: + - in: path + name: id + required: true + description: The Cart id. + schema: + type: string + x-codegen: + method: complete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.complete(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/complete' + tags: + - 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: + $ref: '#/components/schemas/StoreCompleteCartRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts: + post: + summary: Create a Cart + operationId: PostCart + description: >- + Creates a Cart within the given region and with the initial items. If no + `region_id` is provided the cart will be associated with the first + Region available. If no items are provided the cart will be empty after + creation. If a user is logged in the cart's customer id and email will + be set. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.create() + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts' + tags: + - Cart + responses: + '200': + description: Successfully created a new Cart + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions': + post: + operationId: PostCartsCartPaymentSessions + summary: Create Payment Sessions + description: >- + Creates Payment Sessions for each of the available Payment Providers in + the Cart's Region. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codegen: + method: createPaymentSessions + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.createPaymentSessions(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/discounts/{code}': + delete: + operationId: DeleteCartsCartDiscountsDiscount + description: Removes a Discount from a Cart. + summary: Remove Discount + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: code + required: true + description: The unique Discount code. + schema: + type: string + x-codegen: + method: deleteDiscount + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.deleteDiscount(cart_id, code) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/discounts/{code}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: deleteLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.delete(cart_id, line_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartLineItemsItem + summary: Update a Line Item + description: Updates a Line Item if the desired quantity can be fulfilled. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsItemReq' + x-codegen: + method: updateLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.update(cart_id, line_id, { + quantity: 1 + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/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-codegen: + method: deletePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.deletePaymentSession(cart_id, 'manual') + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the payment provider. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionUpdateReq' + x-codegen: + method: updatePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.updatePaymentSession(cart_id, 'manual', { + data: { + } + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "data": {} + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}': + get: + operationId: GetCartsCart + summary: Get a Cart + description: Retrieves a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.retrieve(cart_id) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/carts/{id}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCart + summary: Update a Cart + description: Updates a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.update(cart_id, { + email: 'user@example.com' + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-sessions/{provider_id}/refresh': + post: + operationId: PostCartsCartPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the Cart - + this is usually not necessary. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: >- + The id of the Payment Provider that created the Payment Session to + be refreshed. + schema: + type: string + x-codegen: + method: refreshPaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.refreshPaymentSession(cart_id, 'manual') + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/payment-session': + post: + operationId: PostCartsCartPaymentSession + summary: Select a Payment Session + description: >- + Selects a Payment Session as the session intended to be used towards the + completion of the Cart. + parameters: + - in: path + name: id + required: true + description: The ID of the Cart. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionReq' + x-codegen: + method: setPaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.setPaymentSession(cart_id, { + provider_id: 'manual' + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "provider_id": "manual" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/collections/{id}': + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + parameters: + - in: path + name: id + required: true + description: The id of the Product Collection + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.collections.retrieve(collection_id) + + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/collections/{id}' + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /collections: + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + parameters: + - in: query + name: offset + description: >- + The number of collections to skip before starting to collect the + collections set + schema: + type: integer + default: 0 + - in: query + name: limit + description: The number of collections to return + schema: + type: integer + default: 10 + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: StoreGetCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.collections.list() + + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/collections' + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCollectionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/me/addresses: + post: + operationId: PostCustomersCustomerAddresses + summary: Add a Shipping Address + description: Adds a Shipping Address to a Customer's saved addresses. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesReq' + x-codegen: + method: addAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.customers.addresses.addAddress({ + address: { + first_name: 'Celia', + last_name: 'Schumm', + address_1: '225 Bednar Curve', + city: 'Danielville', + country_code: 'US', + postal_code: '85137', + phone: '981-596-6748 x90188', + company: 'Wyman LLC', + address_2: '', + province: 'Georgia', + metadata: {} + } + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/customers/me/addresses' \ + + --header 'Cookie: connect.sid={sid}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "address": { + "first_name": "Celia", + "last_name": "Schumm", + "address_1": "225 Bednar Curve", + "city": "Danielville", + "country_code": "US", + "postal_code": "85137" + } + }' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: A successful response + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers: + post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer account. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.customers.create({ + first_name: 'Alec', + last_name: 'Reynolds', + email: 'user@example.com', + password: 'supersecret' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/customers' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Alec", + "last_name": "Reynolds", + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + description: A customer with the same email exists + content: + application/json: + schema: + type: object + properties: + code: + type: string + description: The error code + type: + type: string + description: The type of error + message: + type: string + description: Human-readable message with details about the error + example: + code: invalid_request_error + type: duplicate_error + message: >- + A customer with the given email already has an account. Log in + instead + '500': + $ref: '#/components/responses/500_error' + '/customers/me/addresses/{address_id}': + delete: + operationId: DeleteCustomersCustomerAddressesAddress + summary: Delete an Address + description: Removes an Address from the Customer's saved addresses. + x-authenticated: true + parameters: + - in: path + name: address_id + required: true + description: The id of the Address to remove. + schema: + type: string + x-codegen: + method: deleteAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.customers.addresses.deleteAddress(address_id) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomerAddressesAddress + summary: Update a Shipping Address + description: Updates a Customer's saved Shipping Address. + x-authenticated: true + parameters: + - in: path + name: address_id + required: true + description: The id of the Address to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/StorePostCustomersCustomerAddressesAddressReq + x-codegen: + method: updateAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.customers.addresses.updateAddress(address_id, { + first_name: 'Gina' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + + --header 'Cookie: connect.sid={sid}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Gina" + }' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/me: + get: + operationId: GetCustomersCustomer + summary: Get a Customer + description: >- + Retrieves a Customer - the Customer must be logged in to retrieve their + details. + x-authenticated: true + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.customers.retrieve() + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/customers/me' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomer + summary: Update Customer + description: Updates a Customer's saved details. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.customers.update({ + first_name: 'Laury' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/customers/me' \ + + --header 'Cookie: connect.sid={sid}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "first_name": "Laury" + }' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/me/payment-methods: + get: + operationId: GetCustomersCustomerPaymentMethods + summary: Get Payment Methods + description: >- + Retrieves a list of a Customer's saved payment methods. Payment methods + are saved with Payment Providers and it is their responsibility to fetch + saved methods. + x-authenticated: true + x-codegen: + method: listPaymentMethods + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.customers.paymentMethods.list() + + .then(({ payment_methods }) => { + console.log(payment_methods.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/customers/me/payment-methods' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersListPaymentMethodsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/me/orders: + get: + operationId: GetCustomersCustomerOrders + summary: List Orders + description: Retrieves a list of a Customer's Orders. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching orders. + schema: + type: string + - in: query + name: id + description: Id of the order to search for. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for. + schema: + type: array + items: + type: string + - in: query + name: fulfillment_status + style: form + explode: false + description: Fulfillment status to search for. + schema: + type: array + items: + type: string + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + - in: query + name: display_id + description: Display id to search for. + schema: + type: string + - in: query + name: cart_id + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + description: to search for. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + - in: query + name: tax_rate + description: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: canceled_at + description: Date comparison for when resulting collections were canceled. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: limit + description: How many orders to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The offset in the resulting orders. + schema: + type: integer + default: 0 + - in: query + name: fields + description: >- + (Comma separated string) Which fields should be included in the + resulting orders. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated string) Which relations should be expanded in the + resulting orders. + schema: + type: string + x-codegen: + method: listOrders + queryParams: StoreGetCustomersCustomerOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged + + medusa.customers.listOrders() + + .then(({ orders, limit, offset, count }) => { + console.log(orders); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/customers/me/orders' \ + + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersListOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/password-token: + post: + operationId: PostCustomersCustomerPasswordToken + summary: Request Password Reset + description: >- + Creates a reset password token to be used in a subsequent + /reset-password request. The password token should be sent out of band + e.g. via email and will not be returned. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerPasswordTokenReq' + x-codegen: + method: generatePasswordToken + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.customers.generatePasswordToken({ + email: 'user@example.com' + }) + + .then(() => { + // successful + }) + + .catch(() => { + // failed + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/customers/password-token' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com" + }' + tags: + - Customer + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/password-reset: + post: + operationId: PostCustomersResetPassword + summary: Reset Password + description: >- + Resets a Customer's password using a password token created by a + previous /password-token request. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersResetPasswordReq' + x-codegen: + method: resetPassword + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.customers.resetPassword({ + email: 'user@example.com', + password: 'supersecret', + token: 'supersecrettoken' + }) + + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/customers/password-reset' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "password": "supersecret", + "token": "supersecrettoken" + }' + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/gift-cards/{code}': + get: + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unique code. + parameters: + - in: path + name: code + required: true + description: The unique Gift Card code. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.giftCards.retrieve(code) + + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/gift-cards/{code}' + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/complete': + post: + operationId: PostOrderEditsOrderEditComplete + summary: Completes an OrderEdit + description: Completes an OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit. + schema: + type: string + x-codegen: + method: complete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orderEdits.complete(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/order-edits/{id}/complete' + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}/decline': + post: + operationId: PostOrderEditsOrderEditDecline + summary: Decline an OrderEdit + description: Declines an OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostOrderEditsOrderEditDecline' + x-codegen: + method: decline + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orderEdits.decline(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id); + }) + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/order-edits/{id}/decline' + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + '/order-edits/{id}': + get: + operationId: GetOrderEditsOrderEdit + summary: Retrieve an OrderEdit + description: Retrieves a OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orderEdits.retrieve(order_edit_id) + + .then(({ order_edit }) => { + console.log(order_edit.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/order-edits/{id}' + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/customer/confirm: + post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify an Order Claim + description: >- + Verifies the claim order token provided to the customer upon request of + order ownership + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerAcceptClaimReq' + x-codegen: + method: confirmRequest + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.confirmRequest( + token, + ) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/orders/customer/confirm' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "token": "{token}", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/cart/{cart_id}': + get: + operationId: GetOrdersOrderCartId + summary: Get by Cart ID + description: >- + Retrieves an Order by the id of the Cart that was used to create the + Order. + parameters: + - in: path + name: cart_id + required: true + description: The ID of Cart. + schema: + type: string + x-codegen: + method: retrieveByCartId + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.retrieveByCartId(cart_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders/cart/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/orders/{id}': + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the result. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.retrieve(order_id) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders: + get: + operationId: GetOrders + summary: Look Up an Order + description: Look up an order using filters. + parameters: + - in: query + name: display_id + required: true + description: The display id given to the Order. + schema: + type: number + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the result. + schema: + type: string + - in: query + name: email + style: form + explode: false + description: The email associated with this order. + required: true + schema: + type: string + format: email + - in: query + name: shipping_address + style: form + explode: false + description: The shipping address associated with this order. + schema: + type: object + properties: + postal_code: + type: string + description: The postal code of the shipping address + x-codegen: + method: lookupOrder + queryParams: StoreGetOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.orders.lookupOrder({ + display_id: 1, + email: 'user@example.com' + }) + + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/batch/customer/token: + post: + operationId: PostOrdersCustomerOrderClaim + summary: Claim an Order + description: >- + Sends an email to emails registered to orders provided with link to + transfer order ownership + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerOrderClaimReq' + x-codegen: + method: requestCustomerOrders + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.orders.claimOrders({ + display_ids, + }) + + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/batch/customer/token' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "display_ids": ["id"], + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/batch/authorize': + post: + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize PaymentSessions + description: Authorizes Payment Sessions of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq + x-codegen: + method: authorizePaymentSessionsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/{session_id}/authorize': + post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize Payment Session + description: Authorizes a Payment Session of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + - in: path + name: session_id + required: true + description: The ID of the Payment Session. + schema: + type: string + x-codegen: + method: authorizePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.authorize(payment_id, session_id) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsSessionRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}': + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Get a PaymentCollection + description: Get a Payment Collection + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: GetPaymentCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/payment-collections/{id}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/batch': + post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Payment Sessions + description: Manages Multiple Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsReq' + x-codegen: + method: managePaymentSessionsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding two new sessions + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + + // Updating one session and removing the other + + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, + ]) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions': + post: + operationId: PostPaymentCollectionsSessions + summary: Manage a Payment Session + description: Manages Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionSessionsReq' + x-codegen: + method: managePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + // Total amount = 10000 + + // Adding a payment session + + medusa.paymentCollections.managePaymentSession(payment_id, { + provider_id: "stripe" }) + + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/payment-collections/{id}/sessions/{session_id}': + post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the + Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The id of the PaymentCollection. + schema: + type: string + - in: path + name: session_id + required: true + description: The id of the Payment Session to be refreshed. + schema: + type: string + x-codegen: + method: refreshPaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, + session_id) + + .then(({ payment_session }) => { + console.log(payment_session.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsSessionRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/product-categories/{id}': + get: + operationId: GetProductCategoriesCategory + summary: Get a Product Category + description: Retrieves a Product Category. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product + category. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be retrieved in each product + category. + schema: + type: string + x-codegen: + method: retrieve + queryParams: StoreGetProductCategoryParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.productCategories.retrieve(product_category_id) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/product-categories/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGetProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-categories: + get: + operationId: GetProductCategories + summary: List Product Categories + description: Retrieve a list of product categories. + x-authenticated: false + parameters: + - in: query + name: q + description: Query used for searching product category names orhandles. + schema: + type: string + - in: query + name: parent_category_id + description: Returns categories scoped by parent + schema: + type: string + - in: query + name: offset + description: How many product categories to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of product categories returned. + schema: + type: integer + default: 100 + x-codegen: + method: list + queryParams: StoreGetProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.productCategories.list() + + .then(({ product_categories, limit, offset, count }) => { + console.log(product_categories.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/product-categories' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductCategoriesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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 types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product tags. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The tag values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product tags were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product tags were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.productTags.list() + + .then(({ product_tags }) => { + console.log(product_tags.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/product-tags' + tags: + - Product 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 + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product types were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: StoreGetProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.productTypes.list() + + .then(({ product_types }) => { + console.log(product_types.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/product-types' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Type + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductTypesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/products/{id}': + get: + operationId: GetProductsProduct + summary: Get a Product + description: Retrieves a Product. + parameters: + - in: path + name: id + required: true + description: The id of the Product. + schema: + type: string + - in: query + name: sales_channel_id + description: The sales channel used when fetching the product. + schema: + type: string + - in: query + name: cart_id + description: The ID of the customer's cart. + schema: + type: string + - in: query + name: region_id + description: >- + The ID of the region the customer is using. This is helpful to + ensure correct prices are retrieved for a region. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: >- + The 3 character ISO currency code to set prices based on. This is + helpful to ensure correct prices are retrieved for a currency. + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetProductsProductParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.products.retrieve(product_id) + + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/products/{id}' + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products: + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Products. + parameters: + - in: query + name: q + description: >- + Query used for searching products by title, description, variant's + title, variant's sku, and collection's title + schema: + type: string + - in: query + name: id + style: form + explode: false + description: product IDs to search for. + schema: + oneOf: + - type: string + - type: array + items: + type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: an array of sales channel IDs to filter the retrieved products by. + schema: + type: array + items: + type: string + - in: query + name: collection_id + style: form + explode: false + description: Collection IDs to search for + schema: + type: array + items: + type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: tags + style: form + explode: false + description: Tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: title + description: title to search for. + schema: + type: string + - in: query + name: description + description: description to search for. + schema: + type: string + - in: query + name: handle + description: handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: boolean + - in: query + name: created_at + description: Date comparison for when resulting products were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting products were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: category_id + style: form + explode: false + description: Category ids to filter by. + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id. + schema: + type: boolean + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 100 + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. + schema: + type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + x-codegen: + method: list + queryParams: StoreGetProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.products.list() + + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/products' + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/search: + post: + operationId: PostProductsSearch + summary: Search Products + description: >- + Run a search query on products using the search engine installed on + Medusa + parameters: + - in: query + name: q + required: true + description: The query to run the search with. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + x-codegen: + method: search + queryParams: StorePostSearchReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.products.search({ + q: 'Shirt' + }) + + .then(({ hits }) => { + console.log(hits.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/products/search?q=Shirt' + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostSearchRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/regions/{id}': + get: + operationId: GetRegionsRegion + summary: Get a Region + description: Retrieves a Region. + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.regions.retrieve(region_id) + + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/regions/{id}' + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions: + get: + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + parameters: + - in: query + name: offset + description: How many regions to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of regions returned. + schema: + type: integer + default: 100 + - in: query + name: created_at + description: Date comparison for when resulting regions were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting regions were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: StoreGetRegionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.regions.list() + + .then(({ regions }) => { + console.log(regions.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/regions' + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreRegionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/return-reasons/{id}': + get: + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. + parameters: + - in: path + name: id + required: true + description: The id of the Return Reason. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.returnReasons.retrieve(reason_id) + + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/return-reasons/{id}' + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /return-reasons: + get: + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.returnReasons.list() + + .then(({ return_reasons }) => { + console.log(return_reasons.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/return-reasons' + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreReturnReasonsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /returns: + post: + operationId: PostReturns + summary: Create Return + description: Creates a Return for an Order. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostReturnsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.returns.create({ + order_id, + items: [ + { + item_id, + quantity: 1 + } + ] + }) + + .then((data) => { + console.log(data.return.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/returns' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "order_id": "asfasf", + "items": [ + { + "item_id": "assfasf", + "quantity": 1 + } + ] + }' + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreReturnsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /shipping-options: + get: + operationId: GetShippingOptions + summary: Get Shipping Options + description: Retrieves a list of Shipping Options. + parameters: + - in: query + name: is_return + description: >- + Whether return Shipping Options should be included. By default all + Shipping Options are returned. + schema: + type: boolean + - in: query + name: product_ids + description: A comma separated list of Product ids to filter Shipping Options by. + schema: + type: string + - in: query + name: region_id + description: the Region to retrieve Shipping Options from. + schema: + type: string + x-codegen: + method: list + queryParams: StoreGetShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.shippingOptions.list() + + .then(({ shipping_options }) => { + console.log(shipping_options.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/shipping-options' + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreShippingOptionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/shipping-options/{cart_id}': + get: + operationId: GetShippingOptionsCartId + summary: List for Cart + description: Retrieves a list of Shipping Options available to a cart. + parameters: + - in: path + name: cart_id + required: true + description: The id of the Cart. + schema: + type: string + x-codegen: + method: listCartOptions + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.shippingOptions.listCartOptions(cart_id) + + .then(({ shipping_options }) => { + console.log(shipping_options.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/shipping-options/{cart_id}' + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreShippingOptionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /swaps: + post: + operationId: PostSwaps + summary: Create a Swap + description: >- + Creates a Swap on an Order by providing some items to return along with + some items to send back + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostSwapsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.swaps.create({ + order_id, + return_items: [ + { + item_id, + quantity: 1 + } + ], + additional_items: [ + { + variant_id, + quantity: 1 + } + ] + }) + + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST 'https://medusa-url.com/store/swaps' + \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "order_id": "asfasf", + "return_items": [ + { + "item_id": "asfas", + "quantity": 1 + } + ], + "additional_items": [ + { + "variant_id": "asfas", + "quantity": 1 + } + ] + }' + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreSwapsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/swaps/{cart_id}': + get: + operationId: GetSwapsSwapCartId + summary: Get by Cart ID + description: Retrieves a Swap by the id of the Cart used to confirm the Swap. + parameters: + - in: path + name: cart_id + required: true + description: The id of the Cart + schema: + type: string + x-codegen: + method: retrieveByCartId + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.swaps.retrieveByCartId(cart_id) + + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/swaps/{cart_id}' + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreSwapsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/variants/{variant_id}': + get: + operationId: GetVariantsVariant + summary: Get a Product Variant + description: Retrieves a Product Variant by id + parameters: + - in: path + name: variant_id + required: true + description: The id of the Product Variant. + schema: + type: string + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. + schema: + type: string + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetVariantsVariantParams + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/variants/{id}' + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreVariantsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /variants: + get: + operationId: GetVariants + summary: Get Product Variants + description: Retrieves a list of Product Variants + parameters: + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: offset + description: How many product variants to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Maximum number of Product Variants to return. + schema: + type: number + default: '100' + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search using less and greater than comparisons. + properties: + lt: + type: number + description: filter by inventory quantity less than this number + gt: + type: number + description: filter by inventory quantity greater than this number + lte: + type: number + description: >- + filter by inventory quantity less than or equal to this + number + gte: + type: number + description: >- + filter by inventory quantity greater than or equal to this + number + x-codegen: + method: list + queryParams: StoreGetVariantsParams + x-codeSamples: + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/store/variants' + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreVariantsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/carts/{id}/line-items': + post: + operationId: PostCartsCartLineItems + summary: Add a Line Item + description: >- + Generates a Line Item with a given Product Variant and adds it to the + Cart + parameters: + - in: path + name: id + required: true + description: The id of the Cart to add the Line Item to. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsReq' + x-codegen: + method: createLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + medusa.carts.lineItems.create(cart_id, { + variant_id, + quantity: 1 + }) + + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/store/carts/{id}/line-items' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "variant_id": "{variant_id}", + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' +components: + responses: + default_error: + description: Default Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + invalid_state_error: + description: Invalid State Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: >- + The request conflicted with another request. You may retry the + request with the provided Idempotency-Key. + type: QueryRunnerAlreadyReleasedError + invalid_request_error: + description: Invalid Request Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: invalid_request_error + message: Discount with code TEST already exists. + type: duplicate_error + not_found_error: + description: Not Found Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + message: Entity with id 1 was not found + type: not_found + 400_error: + description: Client Error or Multiple Errors + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' + examples: + not_allowed: + $ref: '#/components/examples/not_allowed_error' + invalid_data: + $ref: '#/components/examples/invalid_data_error' + MultipleErrors: + $ref: '#/components/examples/multiple_errors' + 500_error: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + database: + $ref: '#/components/examples/database_error' + unexpected_state: + $ref: '#/components/examples/unexpected_state_error' + invalid_argument: + $ref: '#/components/examples/invalid_argument_error' + default_error: + $ref: '#/components/examples/default_error' + unauthorized: + description: User is not authorized. Must log in first + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + incorrect_credentials: + description: User does not exist or incorrect credentials + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + examples: + not_allowed_error: + summary: Not Allowed Error + value: + message: Discount must be set to dynamic + type: not_allowed + invalid_data_error: + summary: Invalid Data Error + value: + message: first_name must be a string + type: invalid_data + multiple_errors: + summary: Multiple Errors + value: + message: >- + Provided request body contains errors. Please check the data and retry + the request + errors: + - message: first_name must be a string + type: invalid_data + - message: Discount must be set to dynamic + type: not_allowed + database_error: + summary: Database Error + value: + code: api_error + message: An error occured while hashing password + type: database_error + unexpected_state_error: + summary: Unexpected State Error + value: + message: cart.total must be defined + type: unexpected_state + invalid_argument_error: + summary: Invalid Argument Error + value: + message: cart.total must be defined + type: unexpected_state + default_error: + summary: Default Error + value: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + securitySchemes: + cookie_auth: + type: apiKey + x-displayName: Cookie Session ID + in: cookie + name: connect.sid + description: > + Use a cookie session to send authenticated requests. + + + ### How to Obtain the Cookie Session + + + If you're sending requests through a browser, using JS Client, or using + tools like Postman, the cookie session should be automatically set when + the customer is logged in. + + + If you're sending requests using cURL, you must set the Session ID in + the cookie manually. + + + To do that, send a request to [authenticate the + customer](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: + + + ```bash + + curl -v --location --request POST 'https://medusa-url.com/store/auth' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + + ``` + + + The headers will be logged in the terminal as well as the response. You + should find in the headers a Cookie header similar to this: + + + ```bash + + Set-Cookie: + connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; + + ``` + + + Copy the value after `connect.sid` (without the `;` at the end) and pass + it as a cookie in subsequent requests as the following: + + + ```bash + + curl --location --request GET + 'https://medusa-url.com/store/customers/me/orders' \ + + --header 'Cookie: connect.sid={sid}' + + ``` + + + Where `{sid}` is the value of `connect.sid` that you copied. + schemas: + AddressFields: + title: Address Fields + description: Address fields used when creating/updating an address. + type: object + properties: + company: + type: string + description: Company name + example: Acme + first_name: + type: string + description: First name + example: Arno + last_name: + type: string + description: Last name + example: Willms + address_1: + type: string + description: Address line 1 + example: 14433 Kemmer Court + address_2: + type: string + description: Address line 2 + example: Suite 369 + city: + type: string + description: City + example: South Geoffreyview + country_code: + type: string + description: The 2 character ISO code of the country in lower case + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + type: string + description: Province + example: Kentucky + postal_code: + type: string + description: Postal Code + example: 72093 + phone: + type: string + description: Phone Number + example: 16128234334802 + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + Address: + title: Address + description: An address. + type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at + properties: + id: + type: string + description: ID of the address + example: addr_01G8ZC9VS1XVE149MGH2J7QSSH + customer_id: + description: ID of the customer this address belongs to + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + company: + description: Company name + nullable: true + type: string + example: Acme + first_name: + description: First name + nullable: true + type: string + example: Arno + last_name: + description: Last name + nullable: true + type: string + example: Willms + address_1: + description: Address line 1 + nullable: true + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + nullable: true + type: string + example: Suite 369 + city: + description: City + nullable: true + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + nullable: true + type: string + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + country: + description: A country object. Available if the relation `country` is expanded. + nullable: true + $ref: '#/components/schemas/Country' + province: + description: Province + nullable: true + type: string + example: Kentucky + postal_code: + description: Postal Code + nullable: true + type: string + example: 72093 + phone: + description: Phone Number + nullable: true + type: string + example: 16128234334802 + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + BatchJob: + title: Batch Job + description: A Batch Job. + type: object + required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status + - type + - updated_at + properties: + id: + description: The unique identifier for the batch job. + type: string + example: batch_01G8T782965PYFG0751G0Z38B4 + type: + description: The type of batch job. + type: string + enum: + - product-import + - product-export + status: + description: The status of the batch job. + type: string + enum: + - created + - pre_processed + - confirmed + - processing + - completed + - canceled + - failed + default: created + created_by: + description: The unique identifier of the user that created the batch job. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: >- + A user object. Available if the relation `created_by_user` is + expanded. + nullable: true + $ref: '#/components/schemas/User' + context: + description: >- + The context of the batch job, the type of the batch job determines + what the context should contain. + nullable: true + type: object + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + nullable: true + allOf: + - type: object + example: {} + - type: object + properties: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: + type: string + file_size: + type: number + example: + errors: + - err: [] + code: unknown + message: Method not implemented. + stat_descriptors: + - key: product-export-count + name: Product count to export + message: There will be 8 products exported by this action + pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true + type: string + format: date-time + processing_at: + description: The date the job is processing at. + nullable: true + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + nullable: true + type: string + format: date-time + completed_at: + description: The date of the completion. + nullable: true + type: string + format: date-time + canceled_at: + description: The date of the concellation. + nullable: true + type: string + format: date-time + failed_at: + description: The date when the job failed. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Cart: + title: Cart + description: Represents a user cart + type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at + properties: + id: + description: The cart's ID + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + email: + description: The email associated with the cart + nullable: true + type: string + format: email + billing_address_id: + description: The billing address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The shipping address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + discounts: + description: Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + customer_id: + description: The customer's ID + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + payment_session: + description: The selected payment session in the cart. + nullable: true + $ref: '#/components/schemas/PaymentSession' + payment_sessions: + description: The payment sessions created on the cart. + type: array + items: + $ref: '#/components/schemas/PaymentSession' + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + $ref: '#/components/schemas/Payment' + shipping_methods: + description: The shipping methods added to the cart. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + type: + description: The cart's type. + type: string + enum: + - default + - swap + - draft_order + - payment_link + - claim + default: default + completed_at: + description: The date with timezone at which the cart was completed. + nullable: true + type: string + format: date-time + payment_authorized_at: + description: The date with timezone at which the payment was authorized. + nullable: true + type: string + format: date-time + idempotency_key: + description: >- + Randomly generated key used to continue the completion of a cart in + case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + context: + description: >- + The context of the cart which can include info like IP or user + agent. + nullable: true + type: object + example: + ip: '::1' + user_agent: PostmanRuntime/7.29.2 + sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + sales_channel: + description: >- + A sales channel object. Available if the relation `sales_channel` is + expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + shipping_total: + description: The total of shipping + type: integer + example: 1000 + discount_total: + description: The total of discount + type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: >- + The total amount refunded if the order associated with this cart is + returned. + type: integer + example: 0 + total: + description: The total amount of the cart + type: integer + example: 8200 + subtotal: + description: The subtotal of the cart + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + ClaimImage: + title: Claim Image + description: Represents photo documentation of a claim. + type: object + required: + - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + description: The claim image's ID + type: string + example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 + claim_item_id: + description: The ID of the claim item associated with the image + type: string + claim_item: + description: >- + A claim item object. Available if the relation `claim_item` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimItem' + url: + description: The URL of the image + type: string + format: uri + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimItem: + title: Claim Item + description: >- + Represents a claimed item along with information about the reasons for + the claim. + type: object + required: + - claim_order_id + - created_at + - deleted_at + - id + - item_id + - metadata + - note + - quantity + - reason + - updated_at + - variant_id + properties: + id: + description: The claim item's ID + type: string + example: citm_01G8ZH853Y6TFXWPG5EYE81X63 + images: + description: Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimImage' + claim_order_id: + description: The ID of the claim this item is associated with. + type: string + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + item_id: + description: The ID of the line item that the claim item refers to. + type: string + example: item_01G8ZM25TN49YV9EQBE2NC27KC + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + variant_id: + description: The ID of the product variant that is claimed. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A variant object. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + reason: + description: The reason for the claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + note: + description: 'An optional note about the claim, for additional information' + nullable: true + type: string + example: I don't like it. + quantity: + description: >- + The quantity of the item that is being claimed; must be less than or + equal to the amount purchased in the original order. + type: integer + example: 1 + tags: + description: >- + User defined tags for easy filtering and grouping. Available if the + relation 'tags' is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimTag' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimOrder: + title: Claim Order + description: >- + Claim Orders represent a group of faulty or missing items. Each claim + order consists of a subset of items associated with an original order, + and can contain additional information about fulfillments and returns. + type: object + required: + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at + properties: + id: + description: The claim's ID + type: string + example: claim_01G8ZH853Y6TFXWPG5EYE81X63 + type: + description: The claim's type + type: string + enum: + - refund + - replace + payment_status: + description: The status of the claim's payment + type: string + enum: + - na + - not_refunded + - refunded + default: na + fulfillment_status: + description: The claim's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + claim_items: + description: The items that have been claimed + type: array + items: + $ref: '#/components/schemas/ClaimItem' + additional_items: + description: >- + Refers to the new items to be shipped when the claim order has the + type `replace` + type: array + items: + $ref: '#/components/schemas/LineItem' + order_id: + description: The ID of the order that the claim comes from. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + return_order: + description: >- + A return object. Holds information about the return if the claim is + to be returned. Available if the relation 'return_order' is expanded + nullable: true + $ref: '#/components/schemas/Return' + shipping_address_id: + description: The ID of the address that the new items should be shipped to + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The shipping methods that the claim order will be shipped with. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + fulfillments: + description: The fulfillments of the new items to be shipped + type: array + items: + $ref: '#/components/schemas/Fulfillment' + refund_amount: + description: The amount that will be refunded in conjunction with the claim + nullable: true + type: integer + example: 1000 + canceled_at: + description: The date with timezone at which the claim was canceled. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the cart + associated with the claim in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + ClaimTag: + title: Claim Tag + description: >- + Claim Tags are user defined tags that can be assigned to claim items for + easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The claim tag's ID + type: string + example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 + value: + description: The value that the claim tag holds + type: string + example: Damaged + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Country: + title: Country + description: Country details + type: object + required: + - display_name + - id + - iso_2 + - iso_3 + - name + - num_code + - region_id + properties: + id: + description: The country's ID + type: string + example: 109 + iso_2: + description: The 2 character ISO code of the country in lower case + type: string + example: it + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + iso_3: + description: The 2 character ISO code of the country in lower case + type: string + example: ita + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements + description: See a list of codes. + num_code: + description: The numerical ISO code for the country. + type: string + example: 380 + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements + description: See a list of codes. + name: + description: The normalized country name in upper case. + type: string + example: ITALY + display_name: + description: The country name appropriate for display. + type: string + example: Italy + region_id: + description: The region ID this country is associated with. + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + Currency: + title: Currency + description: Currency + type: object + required: + - code + - name + - symbol + - symbol_native + properties: + code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + symbol: + description: The symbol used to indicate the currency. + type: string + example: $ + symbol_native: + description: The native symbol used to indicate the currency. + type: string + example: $ + name: + description: The written name of the currency + type: string + example: US Dollar + includes_tax: + description: '[EXPERIMENTAL] Does the currency prices include tax' + type: boolean + default: false + CustomShippingOption: + title: Custom Shipping Option + description: >- + Custom Shipping Options are 'overriden' Shipping Options. Store managers + can attach a Custom Shipping Option to a cart in order to set a custom + price for a particular Shipping Option + type: object + required: + - cart_id + - created_at + - deleted_at + - id + - metadata + - price + - shipping_option_id + - updated_at + properties: + id: + description: The custom shipping option's ID + type: string + example: cso_01G8X99XNB77DMFBJFWX6DN9V9 + price: + description: >- + The custom price set that will override the shipping option's + original price + type: integer + example: 1000 + shipping_option_id: + description: >- + The ID of the Shipping Option that the custom shipping option + overrides + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: >- + A shipping option object. Available if the relation + `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + cart_id: + description: The ID of the Cart that the custom shipping option is attached to + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + CustomerGroup: + title: Customer Group + description: Represents a customer group + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - updated_at + properties: + id: + description: The customer group's ID + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + name: + description: The name of the customer group + type: string + example: VIP + customers: + description: >- + The customers that belong to the customer group. Available if the + relation `customers` is expanded. + type: array + items: + $ref: '#/components/schemas/Customer' + price_lists: + description: >- + The price lists that are associated with the customer group. + Available if the relation `price_lists` is expanded. + type: array + items: + $ref: '#/components/schemas/PriceList' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Customer: + title: Customer + description: Represents a customer + type: object + required: + - billing_address_id + - created_at + - deleted_at + - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at + properties: + id: + description: The customer's ID + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + email: + description: The customer's email + type: string + format: email + first_name: + description: The customer's first name + nullable: true + type: string + example: Arno + last_name: + description: The customer's last name + nullable: true + type: string + example: Willms + billing_address_id: + description: The customer's billing address ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_addresses: + description: Available if the relation `shipping_addresses` is expanded. + type: array + items: + $ref: '#/components/schemas/Address' + phone: + description: The customer's phone number + nullable: true + type: string + example: 16128234334802 + has_account: + description: Whether the customer has an account or not + type: boolean + default: false + orders: + description: Available if the relation `orders` is expanded. + type: array + items: + $ref: '#/components/schemas/Order' + groups: + description: >- + The customer groups the customer belongs to. Available if the + relation `groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionCustomerGroup: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + type: object + required: + - condition_id + - created_at + - customer_group_id + - metadata + - updated_at + properties: + customer_group_id: + description: The ID of the Product Tag + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + customer_group: + description: Available if the relation `customer_group` is expanded. + nullable: true + $ref: '#/components/schemas/CustomerGroup' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductCollection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + type: object + required: + - condition_id + - created_at + - metadata + - product_collection_id + - updated_at + properties: + product_collection_id: + description: The ID of the Product Collection + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_collection: + description: Available if the relation `product_collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductTag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + type: object + required: + - condition_id + - created_at + - metadata + - product_tag_id + - updated_at + properties: + product_tag_id: + description: The ID of the Product Tag + type: string + example: ptag_01F0YESHPZYY3H4SJ3A5918SBN + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_tag: + description: Available if the relation `product_tag` is expanded. + nullable: true + $ref: '#/components/schemas/ProductTag' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductType: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + type: object + required: + - condition_id + - created_at + - metadata + - product_type_id + - updated_at + properties: + product_type_id: + description: The ID of the Product Tag + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProduct: + title: Product Discount Condition + description: Associates a discount condition with a product + type: object + required: + - condition_id + - created_at + - metadata + - product_id + - updated_at + properties: + product_id: + description: The ID of the Product Tag + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountCondition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + type: object + required: + - created_at + - deleted_at + - discount_rule_id + - id + - metadata + - operator + - type + - updated_at + properties: + id: + description: The discount condition's ID + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + operator: + description: The operator of the Condition + type: string + enum: + - in + - not_in + discount_rule_id: + description: The ID of the discount rule associated with the condition + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + discount_rule: + description: Available if the relation `discount_rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + products: + description: >- + products associated with this condition if type = products. + Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: >- + Product types associated with this condition if type = + product_types. Available if the relation `product_types` is + expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + product_tags: + description: >- + Product tags associated with this condition if type = product_tags. + Available if the relation `product_tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + product_collections: + description: >- + Product collections associated with this condition if type = + product_collections. Available if the relation `product_collections` + is expanded. + type: array + items: + $ref: '#/components/schemas/ProductCollection' + customer_groups: + description: >- + Customer groups associated with this condition if type = + customer_groups. Available if the relation `customer_groups` is + expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountRule: + title: Discount Rule + description: >- + Holds the rules that governs how a Discount is calculated when applied + to a Cart. + type: object + required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata + - type + - updated_at + - value + properties: + id: + description: The discount rule's ID + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + type: + description: >- + The type of the Discount, can be `fixed` for discounts that reduce + the price by a fixed amount, `percentage` for percentage reductions + or `free_shipping` for shipping vouchers. + type: string + enum: + - fixed + - percentage + - free_shipping + example: percentage + description: + description: A short description of the discount + nullable: true + type: string + example: 10 Percent + value: + description: >- + The value that the discount represents; this will depend on the type + of the discount + type: integer + example: 10 + allocation: + description: The scope that the discount should apply to. + nullable: true + type: string + enum: + - total + - item + example: total + conditions: + description: >- + A set of conditions that can be used to limit when the discount can + be used. Available if the relation `conditions` is expanded. + type: array + items: + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Discount: + title: Discount + description: >- + Represents a discount that can be applied to a cart for promotional + purposes. + type: object + required: + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration + properties: + id: + description: The discount's ID + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + code: + description: >- + A unique code for the discount - this will be used by the customer + to apply the discount + type: string + example: 10DISC + is_dynamic: + description: >- + A flag to indicate if multiple instances of the discount can be + generated. I.e. for newsletter discounts + type: boolean + example: false + rule_id: + description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + rule: + description: Available if the relation `rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + is_disabled: + description: >- + Whether the Discount has been disabled. Disabled discounts cannot be + applied to carts + type: boolean + example: false + parent_discount_id: + description: >- + The Discount that the discount was created from. This will always be + a dynamic discount + nullable: true + type: string + example: disc_01G8ZH853YPY9B94857DY91YGW + parent_discount: + description: Available if the relation `parent_discount` is expanded. + nullable: true + $ref: '#/components/schemas/Discount' + starts_at: + description: The time at which the discount can be used. + type: string + format: date-time + ends_at: + description: The time at which the discount can no longer be used. + nullable: true + type: string + format: date-time + valid_duration: + description: Duration the discount runs between + nullable: true + type: string + example: P3Y6M4DT12H30M5S + regions: + description: >- + The Regions in which the Discount can be used. Available if the + relation `regions` is expanded. + type: array + items: + $ref: '#/components/schemas/Region' + usage_limit: + description: The maximum number of times that a discount can be used. + nullable: true + type: integer + example: 100 + usage_count: + description: The number of times a discount has been used. + type: integer + example: 50 + default: 0 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DraftOrder: + title: DraftOrder + description: Represents a draft order + type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at + properties: + id: + description: The draft order's ID + type: string + example: dorder_01G8TJFKBG38YYFQ035MSVG03C + status: + description: The status of the draft order + type: string + enum: + - open + - completed + default: open + display_id: + description: The draft order's display ID + type: string + example: 2 + cart_id: + description: The ID of the cart associated with the draft order. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + order_id: + description: The ID of the order associated with the draft order. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + canceled_at: + description: The date the draft order was canceled at. + nullable: true + type: string + format: date-time + completed_at: + description: The date the draft order was completed at. + nullable: true + type: string + format: date-time + no_notification_order: + description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean + example: false + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the cart + associated with the draft order in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + FulfillmentItem: + title: Fulfillment Item + description: >- + Correlates a Line Item with a Fulfillment, keeping track of the quantity + of the Line Item. + type: object + required: + - fulfillment_id + - item_id + - quantity + properties: + fulfillment_id: + description: The id of the Fulfillment that the Fulfillment Item belongs to. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + item_id: + description: The id of the Line Item that the Fulfillment Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + fulfillment: + description: >- + A fulfillment object. Available if the relation `fulfillment` is + expanded. + nullable: true + $ref: '#/components/schemas/Fulfillment' + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Fulfillment. + type: integer + example: 1 + FulfillmentProvider: + title: Fulfillment Provider + description: >- + Represents a fulfillment provider plugin and holds its installation + status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the fulfillment provider as given by the plugin. + type: string + example: manual + is_installed: + description: >- + Whether the plugin is installed in the current version. Plugins that + are no longer installed are not deleted by will have this field set + to `false`. + type: boolean + default: true + Fulfillment: + title: Fulfillment + description: >- + Fulfillments are created once store operators can prepare the purchased + goods. Fulfillments will eventually be shipped and hold information + about how to track shipments. Fulfillments are created through a + provider, which is typically an external shipping aggregator, shipping + partner og 3PL, most plugins will have asynchronous communications with + these providers through webhooks in order to automatically update and + synchronize the state of Fulfillments. + type: object + required: + - canceled_at + - claim_order_id + - created_at + - data + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - provider_id + - shipped_at + - swap_id + - tracking_numbers + - updated_at + properties: + id: + description: The fulfillment's ID + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + claim_order_id: + description: The id of the Claim that the Fulfillment belongs to. + nullable: true + type: string + example: null + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + swap_id: + description: The id of the Swap that the Fulfillment belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + order_id: + description: The id of the Order that the Fulfillment belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + provider_id: + description: >- + The id of the Fulfillment Provider responsible for handling the + fulfillment + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + location_id: + description: The id of the stock location the fulfillment will be shipped from + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + items: + description: >- + The Fulfillment Items in the Fulfillment - these hold information + about how many of each Line Item has been fulfilled. Available if + the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentItem' + tracking_links: + description: >- + The Tracking Links that can be used to track the status of the + Fulfillment, these will usually be provided by the Fulfillment + Provider. Available if the relation `tracking_links` is expanded. + type: array + items: + $ref: '#/components/schemas/TrackingLink' + tracking_numbers: + description: >- + The tracking numbers that can be used to track the status of the + fulfillment. + deprecated: true + type: array + items: + type: string + data: + description: >- + This contains all the data necessary for the Fulfillment provider to + handle the fulfillment. + type: object + example: {} + shipped_at: + description: The date with timezone at which the Fulfillment was shipped. + nullable: true + type: string + format: date-time + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be sent. + nullable: true + type: boolean + example: false + canceled_at: + description: The date with timezone at which the Fulfillment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the + fulfillment in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + GiftCardTransaction: + title: Gift Card Transaction + description: >- + Gift Card Transactions are created once a Customer uses a Gift Card to + pay for their Order + type: object + required: + - amount + - created_at + - gift_card_id + - id + - is_taxable + - order_id + - tax_rate + properties: + id: + description: The gift card transaction's ID + type: string + example: gct_01G8X9A7ESKAJXG2H0E6F1MW7A + gift_card_id: + description: The ID of the Gift Card that was used in the transaction. + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + gift_card: + description: >- + A gift card object. Available if the relation `gift_card` is + expanded. + nullable: true + $ref: '#/components/schemas/GiftCard' + order_id: + description: The ID of the Order that the Gift Card was used to pay for. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + amount: + description: The amount that was used from the Gift Card. + type: integer + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + is_taxable: + description: Whether the transaction is taxable or not. + nullable: true + type: boolean + example: false + tax_rate: + description: The tax rate of the transaction + nullable: true + type: number + example: 0 + GiftCard: + title: Gift Card + description: >- + Gift Cards are redeemable and represent a value that can be used towards + the payment of an Order. + type: object + required: + - balance + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - metadata + - order_id + - region_id + - tax_rate + - updated_at + - value + properties: + id: + description: The gift card's ID + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + code: + description: >- + The unique code that identifies the Gift Card. This is used by the + Customer to redeem the value of the Gift Card. + type: string + example: 3RFT-MH2C-Y4YZ-XMN4 + value: + description: The value that the Gift Card represents. + type: integer + example: 10 + balance: + description: The remaining value on the Gift Card. + type: integer + example: 10 + region_id: + description: The id of the Region in which the Gift Card is available. + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + order_id: + description: The id of the Order that the Gift Card was purchased in. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + is_disabled: + description: >- + Whether the Gift Card has been disabled. Disabled Gift Cards cannot + be applied to carts. + type: boolean + default: false + ends_at: + description: The time at which the Gift Card can no longer be used. + nullable: true + type: string + format: date-time + tax_rate: + description: The gift card's tax rate that will be applied on calculating totals + nullable: true + type: number + example: 0 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + IdempotencyKey: + title: Idempotency Key + description: >- + Idempotency Key is used to continue a process in case of any failure + that might occur. + type: object + required: + - created_at + - id + - idempotency_key + - locked_at + - recovery_point + - response_code + - response_body + - request_method + - request_params + - request_path + properties: + id: + description: The idempotency key's ID + type: string + example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A + idempotency_key: + description: >- + The unique randomly generated key used to determine the state of a + process. + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: Date which the idempotency key was locked. + type: string + format: date-time + locked_at: + description: Date which the idempotency key was locked. + nullable: true + type: string + format: date-time + request_method: + description: The method of the request + nullable: true + type: string + example: POST + request_params: + description: The parameters passed to the request + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + request_path: + description: The request's path + nullable: true + type: string + example: /store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete + response_code: + description: The response's code. + nullable: true + type: string + example: 200 + response_body: + description: The response's body + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + recovery_point: + description: Where to continue from. + type: string + default: started + Image: + title: Image + description: Images holds a reference to a URL at which the image file can be found. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + type: string + description: The image's ID + example: img_01G749BFYR6T8JTVW6SGW3K3E6 + url: + description: The URL at which the image file can be found. + type: string + format: uri + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Invite: + title: Invite + description: Represents an invite + type: object + required: + - accepted + - created_at + - deleted_at + - expires_at + - id + - metadata + - role + - token + - updated_at + - user_email + properties: + id: + type: string + description: The invite's ID + example: invite_01G8TKE4XYCTHSCK2GDEP47RE1 + user_email: + description: The email of the user being invited. + type: string + format: email + role: + description: The user's role. + nullable: true + type: string + enum: + - admin + - member + - developer + default: member + accepted: + description: Whether the invite was accepted or not. + type: boolean + default: false + token: + description: The token used to accept the invite. + type: string + expires_at: + description: The date the invite expires at. + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemAdjustment: + title: Line Item Adjustment + description: Represents a Line Item Adjustment + type: object + required: + - amount + - description + - discount_id + - id + - item_id + - metadata + properties: + id: + description: The Line Item Adjustment's ID + type: string + example: lia_01G8TKE4XYCTHSCK2GDEP47RE1 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + description: + description: The line item's adjustment description + type: string + example: Adjusted item's price. + discount_id: + description: The ID of the discount associated with the adjustment + nullable: true + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + discount: + description: Available if the relation `discount` is expanded. + nullable: true + $ref: '#/components/schemas/Discount' + amount: + description: The adjustment amount + type: integer + example: 1000 + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemTaxLine: + title: Line Item Tax Line + description: Represents a Line Item Tax Line + type: object + required: + - code + - created_at + - id + - item_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItem: + title: Line Item + description: >- + Line Items represent purchasable units that can be added to a Cart for + checkout. When Line Items are purchased they will get copied to the + resulting order and can eventually be referenced in Fulfillments and + Returns. Line Items may also be created when processing Swaps and + Claims. + type: object + required: + - allow_discounts + - cart_id + - claim_order_id + - created_at + - description + - fulfilled_quantity + - has_shipping + - id + - is_giftcard + - is_return + - metadata + - order_edit_id + - order_id + - original_item_id + - quantity + - returned_quantity + - shipped_quantity + - should_merge + - swap_id + - thumbnail + - title + - unit_price + - updated_at + - variant_id + properties: + id: + description: The line item's ID + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + cart_id: + description: The ID of the Cart that the Line Item belongs to. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + order_id: + description: The ID of the Order that the Line Item belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + swap_id: + description: The id of the Swap that the Line Item belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + claim_order_id: + description: The id of the Claim that the Line Item belongs to. + nullable: true + type: string + example: null + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemTaxLine' + adjustments: + description: Available if the relation `adjustments` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemAdjustment' + original_item_id: + description: The id of the original line item + nullable: true + type: string + order_edit_id: + description: The ID of the order edit to which a cloned item belongs + nullable: true + type: string + order_edit: + description: >- + The order edit joined. Available if the relation `order_edit` is + expanded. + nullable: true + $ref: '#/components/schemas/OrderEdit' + title: + description: >- + The title of the Line Item, this should be easily identifiable by + the Customer. + type: string + example: Medusa Coffee Mug + description: + description: A more detailed description of the contents of the Line Item. + nullable: true + type: string + example: One Size + thumbnail: + description: A URL string to a small image of the contents of the Line Item. + nullable: true + type: string + format: uri + example: >- + https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png + is_return: + description: Is the item being returned + type: boolean + default: false + is_giftcard: + description: Flag to indicate if the Line Item is a Gift Card. + type: boolean + default: false + should_merge: + description: >- + Flag to indicate if new Line Items with the same variant should be + merged or added as an additional Line Item. + type: boolean + default: true + allow_discounts: + description: >- + Flag to indicate if the Line Item should be included when doing + discount calculations. + type: boolean + default: true + has_shipping: + description: >- + Flag to indicate if the Line Item has fulfillment associated with + it. + nullable: true + type: boolean + example: false + unit_price: + description: >- + The price of one unit of the content in the Line Item. This should + be in the currency defined by the Cart/Order/Swap/Claim that the + Line Item belongs to. + type: integer + example: 8000 + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: >- + A product variant object. The Product Variant contained in the Line + Item. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + quantity: + description: The quantity of the content in the Line Item. + type: integer + example: 1 + fulfilled_quantity: + description: The quantity of the Line Item that has been fulfilled. + nullable: true + type: integer + example: 0 + returned_quantity: + description: The quantity of the Line Item that has been returned. + nullable: true + type: integer + example: 0 + shipped_quantity: + description: The quantity of the Line Item that has been shipped. + nullable: true + type: integer + example: 0 + refundable: + description: >- + The amount that can be refunded from the given Line Item. Takes + taxes and discounts into consideration. + type: integer + example: 0 + subtotal: + description: The subtotal of the line item + type: integer + example: 8000 + tax_total: + description: The total of tax of the line item + type: integer + example: 0 + total: + description: The total amount of the line item + type: integer + example: 8000 + original_total: + description: The original total amount of the line item + type: integer + example: 8000 + original_tax_total: + description: The original tax total amount of the line item + type: integer + example: 0 + discount_total: + description: The total of discount of the line item + type: integer + example: 0 + gift_card_total: + description: The total of the gift card of the line item + type: integer + example: 0 + includes_tax: + description: '[EXPERIMENTAL] Indicates if the line item unit_price include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + MoneyAmount: + title: Money Amount + description: >- + Money Amounts represents an amount that a given Product Variant can be + purcased for. Each Money Amount either has a Currency or Region + associated with it to indicate the pricing in a given Currency or, for + fully region-based pricing, the given price in a specific Region. If + region-based pricing is used the amount will be in the currency defined + for the Reigon. + type: object + required: + - amount + - created_at + - currency_code + - deleted_at + - id + - max_quantity + - min_quantity + - price_list_id + - region_id + - updated_at + - variant_id + properties: + id: + description: The money amount's ID + type: string + example: ma_01F0YESHRFQNH5S8Q0PK84YYZN + currency_code: + description: The 3 character currency code that the Money Amount is given in. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount: + description: >- + The amount in the smallest currecny unit (e.g. cents 100 cents to + charge $1) that the Product Variant will cost. + type: integer + example: 100 + min_quantity: + description: >- + The minimum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. + nullable: true + type: integer + example: 1 + max_quantity: + description: >- + The maximum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. + nullable: true + type: integer + example: 1 + price_list_id: + description: The ID of the price list associated with the money amount + nullable: true + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + price_list: + description: Available if the relation `price_list` is expanded. + nullable: true + $ref: '#/components/schemas/PriceList' + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: >- + The Product Variant contained in the Line Item. Available if the + relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + region_id: + description: The region's ID + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Note: + title: Note + description: >- + Notes are elements which we can use in association with different + resources to allow users to describe additional information in relation + to these. + type: object + required: + - author_id + - created_at + - deleted_at + - id + - metadata + - resource_id + - resource_type + - updated_at + - value + properties: + id: + description: The note's ID + type: string + example: note_01G8TM8ENBMC7R90XRR1G6H26Q + resource_type: + description: The type of resource that the Note refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Note refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + value: + description: The contents of the note. + type: string + example: This order must be fulfilled on Monday + author_id: + description: The ID of the author (user) + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + author: + description: Available if the relation `author` is expanded. + nullable: true + $ref: '#/components/schemas/User' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + NotificationProvider: + title: Notification Provider + description: >- + Represents a notification provider plugin and holds its installation + status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the notification provider as given by the plugin. + type: string + example: sendgrid + is_installed: + description: >- + Whether the plugin is installed in the current version. Plugins that + are no longer installed are not deleted by will have this field set + to `false`. + type: boolean + default: true + Notification: + title: Notification + description: >- + Notifications a communications sent via Notification Providers as a + reaction to internal events such as `order.placed`. Notifications can be + used to show a chronological timeline for communications sent to a + Customer regarding an Order, and enables resends. + type: object + required: + - created_at + - customer_id + - data + - event_name + - id + - parent_id + - provider_id + - resource_type + - resource_id + - to + - updated_at + properties: + id: + description: The notification's ID + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + event_name: + description: The name of the event that the notification was sent for. + nullable: true + type: string + example: order.placed + resource_type: + description: The type of resource that the Notification refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Notification refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + customer_id: + description: The ID of the Customer that the Notification was sent to. + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + to: + description: >- + The address that the Notification was sent to. This will usually be + an email address, but represent other addresses such as a chat bot + user id + type: string + example: user@example.com + data: + description: >- + The data that the Notification was sent with. This contains all the + data necessary for the Notification Provider to initiate a resend. + type: object + example: {} + parent_id: + description: The notification's parent ID + nullable: true + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + parent_notification: + description: Available if the relation `parent_notification` is expanded. + nullable: true + $ref: '#/components/schemas/Notification' + resends: + description: >- + The resends that have been completed after the original + Notification. Available if the relation `resends` is expanded. + type: array + items: + $ref: '#/components/schemas/Notification' + provider_id: + description: The id of the Notification Provider that handles the Notification. + nullable: true + type: string + example: sengrid + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/NotificationProvider' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + OAuth: + title: OAuth + description: Represent an OAuth app + type: object + required: + - application_name + - data + - display_name + - id + - install_url + - uninstall_url + properties: + id: + description: The app's ID + type: string + example: example_app + display_name: + description: The app's display name + type: string + example: Example app + application_name: + description: The app's name + type: string + example: example + install_url: + description: The URL to install the app + nullable: true + type: string + format: uri + uninstall_url: + description: The URL to uninstall the app + nullable: true + type: string + format: uri + data: + description: Any data necessary to the app. + nullable: true + type: object + example: {} + OrderEdit: + title: Order Edit + description: Order edit keeps track of order items changes. + type: object + required: + - canceled_at + - canceled_by + - confirmed_by + - confirmed_at + - created_at + - created_by + - declined_at + - declined_by + - declined_reason + - id + - internal_note + - order_id + - payment_collection_id + - requested_at + - requested_by + - status + - updated_at + properties: + id: + description: The order edit's ID + type: string + example: oe_01G8TJSYT9M6AVS5N4EMNFS1EK + order_id: + description: The ID of the order that is edited + type: string + example: order_01G2SG30J8C85S4A5CHM2S1NS2 + order: + description: Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + changes: + description: Available if the relation `changes` is expanded. + type: array + items: + $ref: '#/components/schemas/OrderItemChange' + internal_note: + description: An optional note with additional details about the order edit. + nullable: true + type: string + example: Included two more items B to the order. + created_by: + description: >- + The unique identifier of the user or customer who created the order + edit. + type: string + requested_by: + description: >- + The unique identifier of the user or customer who requested the + order edit. + nullable: true + type: string + requested_at: + description: The date with timezone at which the edit was requested. + nullable: true + type: string + format: date-time + confirmed_by: + description: >- + The unique identifier of the user or customer who confirmed the + order edit. + nullable: true + type: string + confirmed_at: + description: The date with timezone at which the edit was confirmed. + nullable: true + type: string + format: date-time + declined_by: + description: >- + The unique identifier of the user or customer who declined the order + edit. + nullable: true + type: string + declined_at: + description: The date with timezone at which the edit was declined. + nullable: true + type: string + format: date-time + declined_reason: + description: An optional note why the order edit is declined. + nullable: true + type: string + canceled_by: + description: >- + The unique identifier of the user or customer who cancelled the + order edit. + nullable: true + type: string + canceled_at: + description: The date with timezone at which the edit was cancelled. + nullable: true + type: string + format: date-time + subtotal: + description: The total of subtotal + type: integer + example: 8000 + discount_total: + description: The total of discount + type: integer + example: 800 + shipping_total: + description: The total of the shipping amount + type: integer + example: 800 + gift_card_total: + description: The total of the gift card amount + type: integer + example: 800 + gift_card_tax_total: + description: The total of the gift card tax amount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + total: + description: The total amount of the edited order. + type: integer + example: 8200 + difference_due: + description: >- + The difference between the total amount of the order and total + amount of edited order. + type: integer + example: 8200 + status: + description: The status of the order edit. + type: string + enum: + - confirmed + - declined + - requested + - created + - canceled + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + payment_collection_id: + description: The ID of the payment collection + nullable: true + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + nullable: true + $ref: '#/components/schemas/PaymentCollection' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + OrderItemChange: + title: Order Item Change + description: Represents an order edit item change + type: object + required: + - created_at + - deleted_at + - id + - line_item_id + - order_edit_id + - original_line_item_id + - type + - updated_at + properties: + id: + description: The order item change's ID + type: string + example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The order item change's status + type: string + enum: + - item_add + - item_remove + - item_update + order_edit_id: + description: The ID of the order edit + type: string + example: oe_01G2SG30J8C85S4A5CHM2S1NS2 + order_edit: + description: Available if the relation `order_edit` is expanded. + nullable: true + $ref: '#/components/schemas/OrderEdit' + original_line_item_id: + description: The ID of the original line item in the order + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + original_line_item: + description: Available if the relation `original_line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + line_item_id: + description: The ID of the cloned line item. + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + line_item: + description: Available if the relation `line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Order: + title: Order + description: Represents an order + type: object + required: + - billing_address_id + - canceled_at + - cart_id + - created_at + - currency_code + - customer_id + - draft_order_id + - display_id + - email + - external_id + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - object + - payment_status + - region_id + - shipping_address_id + - status + - tax_rate + - updated_at + properties: + id: + description: The order's ID + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + status: + description: The order's status + type: string + enum: + - pending + - completed + - archived + - canceled + - requires_action + default: pending + fulfillment_status: + description: The order's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + payment_status: + description: The order's payment status + type: string + enum: + - not_paid + - awaiting + - captured + - partially_refunded + - refunded + - canceled + - requires_action + default: not_paid + display_id: + description: The order's display ID + type: integer + example: 2 + cart_id: + description: The ID of the cart associated with the order + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + customer_id: + description: The ID of the customer associated with the order + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + email: + description: The email associated with the order + type: string + format: email + billing_address_id: + description: The ID of the billing address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The ID of the shipping address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character currency code that is used in the order + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The order's tax rate + nullable: true + type: number + example: 0 + discounts: + description: >- + The discounts used in the order. Available if the relation + `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: >- + The gift cards used in the order. Available if the relation + `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + shipping_methods: + description: >- + The shipping methods used in the order. Available if the relation + `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + payments: + description: >- + The payments used in the order. Available if the relation `payments` + is expanded. + type: array + items: + $ref: '#/components/schemas/Payment' + fulfillments: + description: >- + The fulfillments used in the order. Available if the relation + `fulfillments` is expanded. + type: array + items: + $ref: '#/components/schemas/Fulfillment' + returns: + description: >- + The returns associated with the order. Available if the relation + `returns` is expanded. + type: array + items: + $ref: '#/components/schemas/Return' + claims: + description: >- + The claims associated with the order. Available if the relation + `claims` is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimOrder' + refunds: + description: >- + The refunds associated with the order. Available if the relation + `refunds` is expanded. + type: array + items: + $ref: '#/components/schemas/Refund' + swaps: + description: >- + The swaps associated with the order. Available if the relation + `swaps` is expanded. + type: array + items: + $ref: '#/components/schemas/Swap' + draft_order_id: + description: The ID of the draft order this order is associated with. + nullable: true + type: string + example: null + draft_order: + description: >- + A draft order object. Available if the relation `draft_order` is + expanded. + nullable: true + $ref: '#/components/schemas/DraftOrder' + items: + description: >- + The line items that belong to the order. Available if the relation + `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + edits: + description: >- + Order edits done on the order. Available if the relation `edits` is + expanded. + type: array + items: + $ref: '#/components/schemas/OrderEdit' + gift_card_transactions: + description: >- + The gift card transactions used in the order. Available if the + relation `gift_card_transactions` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCardTransaction' + canceled_at: + description: The date the order was canceled on. + nullable: true + type: string + format: date-time + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: >- + Randomly generated key used to continue the processing of the order + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + external_id: + description: The ID of an external order. + nullable: true + type: string + example: null + sales_channel_id: + description: The ID of the sales channel this order is associated with. + nullable: true + type: string + example: null + sales_channel: + description: >- + A sales channel object. Available if the relation `sales_channel` is + expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + shipping_total: + type: integer + description: The total of shipping + example: 1000 + discount_total: + description: The total of discount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order is returned. + type: integer + example: 0 + total: + description: The total amount of the order + type: integer + example: 8200 + subtotal: + description: The subtotal of the order + type: integer + example: 8000 + paid_total: + description: The total amount paid + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + returnable_items: + description: >- + The items that are returnable as part of the order, order swaps or + order claims + type: array + items: + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentCollection: + title: Payment Collection + description: Payment Collection + type: object + required: + - amount + - authorized_amount + - created_at + - created_by + - currency_code + - deleted_at + - description + - id + - metadata + - region_id + - status + - type + - updated_at + properties: + id: + description: The payment collection's ID + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The type of the payment collection + type: string + enum: + - order_edit + status: + description: The type of the payment collection + type: string + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - canceled + description: + description: Description of the payment collection + nullable: true + type: string + amount: + description: Amount of the payment collection. + type: integer + authorized_amount: + description: Authorized amount of the payment collection. + nullable: true + type: integer + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + payment_sessions: + description: Available if the relation `payment_sessions` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentSession' + payments: + description: Available if the relation `payments` is expanded. + type: array + items: + $ref: '#/components/schemas/Payment' + created_by: + description: The ID of the user that created the payment collection. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentProvider: + title: Payment Provider + description: Represents a Payment Provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the payment provider as given by the plugin. + type: string + example: manual + is_installed: + description: >- + Whether the plugin is installed in the current version. Plugins that + are no longer installed are not deleted by will have this field set + to `false`. + type: boolean + default: true + PaymentSession: + title: Payment Session + description: >- + Payment Sessions are created when a Customer initilizes the checkout + flow, and can be used to hold the state of a payment flow. Each Payment + Session is controlled by a Payment Provider, who is responsible for the + communication with external payment services. Authorized Payment + Sessions will eventually get promoted to Payments to indicate that they + are authorized for capture/refunds/etc. + type: object + required: + - amount + - cart_id + - created_at + - data + - id + - is_initiated + - is_selected + - idempotency_key + - payment_authorized_at + - provider_id + - status + - updated_at + properties: + id: + description: The payment session's ID + type: string + example: ps_01G901XNSRM2YS3ASN9H5KG3FZ + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + provider_id: + description: >- + The id of the Payment Provider that is responsible for the Payment + Session + type: string + example: manual + is_selected: + description: >- + A flag to indicate if the Payment Session has been selected as the + method that will be used to complete the purchase. + nullable: true + type: boolean + example: true + is_initiated: + description: >- + A flag to indicate if a communication with the third party provider + has been initiated. + type: boolean + default: false + example: true + status: + description: >- + Indicates the status of the Payment Session. Will default to + `pending`, and will eventually become `authorized`. Payment Sessions + may have the status of `requires_more` to indicate that further + actions are to be completed by the Customer. + type: string + enum: + - authorized + - pending + - requires_more + - error + - canceled + example: pending + data: + description: >- + The data required for the Payment Provider to identify, modify and + process the Payment Session. Typically this will be an object that + holds an id to the external payment session, but can be an empty + object if the Payment Provider doesn't hold any state. + type: object + example: {} + idempotency_key: + description: >- + Randomly generated key used to continue the completion of a cart in + case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + amount: + description: The amount that the Payment Session has been authorized for. + nullable: true + type: integer + example: 100 + payment_authorized_at: + description: The date with timezone at which the Payment Session was authorized. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + Payment: + title: Payment + description: >- + Payments represent an amount authorized with a given payment method, + Payments can be captured, canceled or refunded. + type: object + required: + - amount + - amount_refunded + - canceled_at + - captured_at + - cart_id + - created_at + - currency_code + - data + - id + - idempotency_key + - metadata + - order_id + - provider_id + - swap_id + - updated_at + properties: + id: + description: The payment's ID + type: string + example: pay_01G2SJNT6DEEWDFNAJ4XWDTHKE + swap_id: + description: The ID of the Swap that the Payment is used for. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + order_id: + description: The ID of the Order that the Payment is used for. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + amount: + description: The amount that the Payment has been authorized for. + type: integer + example: 100 + currency_code: + description: The 3 character ISO currency code that the Payment is completed in. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount_refunded: + description: >- + The amount of the original Payment amount that has been refunded + back to the Customer. + type: integer + default: 0 + example: 0 + provider_id: + description: The id of the Payment Provider that is responsible for the Payment + type: string + example: manual + data: + description: >- + The data required for the Payment Provider to identify, modify and + process the Payment. Typically this will be an object that holds an + id to the external payment session, but can be an empty object if + the Payment Provider doesn't hold any state. + type: object + example: {} + captured_at: + description: The date with timezone at which the Payment was captured. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Payment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: >- + Randomly generated key used to continue the completion of a payment + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PriceList: + title: Price List + description: >- + Price Lists represents a set of prices that overrides the default price + for one or more product variants. + type: object + required: + - created_at + - deleted_at + - description + - ends_at + - id + - name + - starts_at + - status + - type + - updated_at + properties: + id: + description: The price list's ID + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + name: + description: The price list's name + type: string + example: VIP Prices + description: + description: The price list's description + type: string + example: Prices for VIP customers + type: + description: >- + The type of Price List. This can be one of either `sale` or + `override`. + type: string + enum: + - sale + - override + default: sale + status: + description: The status of the Price List + type: string + enum: + - active + - draft + default: draft + starts_at: + description: The date with timezone that the Price List starts being valid. + nullable: true + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + nullable: true + type: string + format: date-time + customer_groups: + description: >- + The Customer Groups that the Price List applies to. Available if the + relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + prices: + description: >- + The Money Amounts that are associated with the Price List. Available + if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + includes_tax: + description: '[EXPERIMENTAL] Does the price list prices include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductCategory: + title: ProductCategory + description: Represents a product category + x-resourceId: ProductCategory + type: object + required: + - category_children + - created_at + - deleted_at + - handle + - id + - is_active + - is_internal + - mpath + - name + - parent_category_id + - updated_at + properties: + id: + description: The product category's ID + type: string + example: pcat_01G2SG30J8C85S4A5CHM2S1NS2 + name: + description: The product category's name + type: string + example: Regular Fit + handle: + description: >- + A unique string that identifies the Product Category - can for + example be used in slug structures. + type: string + example: regular-fit + mpath: + description: >- + A string for Materialized Paths - used for finding ancestors and + descendents + nullable: true + type: string + example: pcat_id1.pcat_id2.pcat_id3 + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + default: false + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + default: false + category_children: + description: Available if the relation `category_children` are expanded. + type: array + items: + $ref: '#/components/schemas/ProductCategory' + parent_category_id: + description: The ID of the parent category. + nullable: true + type: string + default: null + parent_category: + description: >- + A product category object. Available if the relation + `parent_category` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCategory' + products: + description: >- + Products associated with category. Available if the relation + `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductCollection: + title: Product Collection + description: Product Collections represents a group of Products that are related. + type: object + required: + - created_at + - deleted_at + - handle + - id + - metadata + - title + - updated_at + properties: + id: + description: The product collection's ID + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + title: + description: The title that the Product Collection is identified by. + type: string + example: Summer Collection + handle: + description: >- + A unique string that identifies the Product Collection - can for + example be used in slug structures. + nullable: true + type: string + example: summer-collection + products: + description: >- + The Products contained in the Product Collection. Available if the + relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOptionValue: + title: Product Option Value + description: >- + A value given to a Product Variant's option set. Product Variant have a + Product Option Value for each of the Product Options defined on the + Product. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - option_id + - updated_at + - value + - variant_id + properties: + id: + description: The product option value's ID + type: string + example: optval_01F0YESHR7S6ECD03RF6W12DSJ + value: + description: >- + The value that the Product Variant has defined for the specific + Product Option (e.g. if the Product Option is \"Size\" this value + could be `Small`, `Medium` or `Large`). + type: string + example: large + option_id: + description: >- + The ID of the Product Option that the Product Option Value is + defined for. + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + option: + description: Available if the relation `option` is expanded. + nullable: true + $ref: '#/components/schemas/ProductOption' + variant_id: + description: >- + The ID of the Product Variant that the Product Option Value is + defined for. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOption: + title: Product Option + description: >- + Product Options define properties that may vary between different + variants of a Product. Common Product Options are "Size" and "Color", + but Medusa doesn't limit what Product Options that can be defined. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - product_id + - title + - updated_at + properties: + id: + description: The product option's ID + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + title: + description: The title that the Product Option is defined by (e.g. `Size`). + type: string + example: Size + values: + description: >- + The Product Option Values that are defined for the Product Option. + Available if the relation `values` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + product_id: + description: The ID of the Product that the Product Option is defined for. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTag: + title: Product Tag + description: Product Tags can be added to Products for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product tag's ID + type: string + example: ptag_01G8K2MTMG9168F2B70S1TAVK3 + value: + description: The value that the Product Tag represents + type: string + example: Pants + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTaxRate: + title: Product Tax Rate + description: >- + Associates a tax rate with a product to indicate that the product is + taxed in a certain way + type: object + required: + - created_at + - metadata + - product_id + - rate_id + - updated_at + properties: + product_id: + description: The ID of the Product + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTypeTaxRate: + title: Product Type Tax Rate + description: >- + Associates a tax rate with a product type to indicate that the product + type is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_type_id + - rate_id + - updated_at + properties: + product_type_id: + description: The ID of the Product type + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + rate_id: + description: The id of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductType: + title: Product Type + description: >- + Product Type can be added to Products for filtering and reporting + purposes. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product type's ID + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + value: + description: The value that the Product Type represents. + type: string + example: Clothing + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductVariantInventoryItem: + title: Product Variant Inventory Item + description: >- + Product Variant Inventory Items link variants with inventory items and + denote the number of inventory items constituting a variant. + type: object + required: + - created_at + - deleted_at + - id + - inventory_item_id + - required_quantity + - updated_at + - variant_id + properties: + id: + description: The product variant inventory item's ID + type: string + example: pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A + inventory_item_id: + description: The id of the inventory item + type: string + variant_id: + description: The id of the variant. + type: string + variant: + description: >- + A ProductVariant object. Available if the relation `variant` is + expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + required_quantity: + description: >- + The quantity of an inventory item required for one quantity of the + variant. + type: integer + default: 1 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductVariant: + title: Product Variant + description: >- + Product Variants represent a Product with a specific set of Product + Option configurations. The maximum number of Product Variants that a + Product can have is given by the number of available Product Option + combinations. + type: object + required: + - allow_backorder + - barcode + - created_at + - deleted_at + - ean + - height + - hs_code + - id + - inventory_quantity + - length + - manage_inventory + - material + - metadata + - mid_code + - origin_country + - product_id + - sku + - title + - upc + - updated_at + - weight + - width + properties: + id: + description: The product variant's ID + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + title: + description: >- + A title that can be displayed for easy identification of the Product + Variant. + type: string + example: Small + product_id: + description: The ID of the Product that the Product Variant belongs to. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + prices: + description: >- + The Money Amounts defined for the Product Variant. Each Money Amount + represents a price in a given currency or a price in a specific + Region. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + sku: + description: >- + The unique stock keeping unit used to identify the Product Variant. + This will usually be a unqiue identifer for the item that is to be + shipped, and can be referenced across multiple systems. + nullable: true + type: string + example: shirt-123 + barcode: + description: >- + A generic field for a GTIN number that can be used to identify the + Product Variant. + nullable: true + type: string + example: null + ean: + description: >- + An EAN barcode number that can be used to identify the Product + Variant. + nullable: true + type: string + example: null + upc: + description: >- + A UPC barcode number that can be used to identify the Product + Variant. + nullable: true + type: string + example: null + variant_rank: + description: The ranking of this variant + nullable: true + type: number + default: 0 + inventory_quantity: + description: The current quantity of the item that is stocked. + type: integer + example: 100 + allow_backorder: + description: >- + Whether the Product Variant should be purchasable when + `inventory_quantity` is 0. + type: boolean + default: false + manage_inventory: + description: Whether Medusa should manage inventory for the Product Variant. + type: boolean + default: true + hs_code: + description: >- + The Harmonized System code of the Product Variant. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + nullable: true + type: string + example: null + origin_country: + description: >- + The country in which the Product Variant was produced. May be used + by Fulfillment Providers to pass customs information to shipping + carriers. + nullable: true + type: string + example: null + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Product Variant. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: >- + The material and composition that the Product Variant is made of, + May be used by Fulfillment Providers to pass customs information to + shipping carriers. + nullable: true + type: string + example: null + weight: + description: >- + The weight of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + length: + description: >- + The length of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + height: + description: >- + The height of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + width: + description: >- + The width of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + options: + description: >- + The Product Option Values specified for the Product Variant. + Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + inventory_items: + description: >- + The Inventory Items related to the product variant. Available if the + relation `inventory_items` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariantInventoryItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Product: + title: Product + description: >- + Products are a grouping of Product Variants that have common properties + such as images and descriptions. Products can have multiple options + which define the properties that Product Variants differ by. + type: object + required: + - collection_id + - created_at + - deleted_at + - description + - discountable + - external_id + - handle + - height + - hs_code + - id + - is_giftcard + - length + - material + - metadata + - mid_code + - origin_country + - profile_id + - status + - subtitle + - type_id + - thumbnail + - title + - updated_at + - weight + - width + properties: + id: + description: The product's ID + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + title: + description: >- + A title that can be displayed for easy identification of the + Product. + type: string + example: Medusa Coffee Mug + subtitle: + description: >- + An optional subtitle that can be used to further specify the + Product. + nullable: true + type: string + description: + description: A short description of the Product. + nullable: true + type: string + example: Every programmer's best friend. + handle: + description: A unique identifier for the Product (e.g. for slug structure). + nullable: true + type: string + example: coffee-mug + is_giftcard: + description: >- + Whether the Product represents a Gift Card. Products that represent + Gift Cards will automatically generate a redeemable Gift Card code + once they are purchased. + type: boolean + default: false + status: + description: The status of the product + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + images: + description: >- + Images of the Product. Available if the relation `images` is + expanded. + type: array + items: + $ref: '#/components/schemas/Image' + thumbnail: + description: A URL to an image file that can be used to identify the Product. + nullable: true + type: string + format: uri + options: + description: >- + The Product Options that are defined for the Product. Product + Variants of the Product will have a unique combination of Product + Option Values. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOption' + variants: + description: >- + The Product Variants that belong to the Product. Each will have a + unique combination of Product Option Values. Available if the + relation `variants` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariant' + categories: + description: >- + The product's associated categories. Available if the relation + `categories` are expanded. + type: array + items: + $ref: '#/components/schemas/ProductCategory' + profile_id: + description: >- + The ID of the Shipping Profile that the Product belongs to. Shipping + Profiles have a set of defined Shipping Options that can be used to + Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + weight: + description: >- + The weight of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + length: + description: >- + The length of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + height: + description: >- + The height of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + width: + description: >- + The width of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + hs_code: + description: >- + The Harmonized System code of the Product Variant. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + nullable: true + type: string + example: null + origin_country: + description: >- + The country in which the Product Variant was produced. May be used + by Fulfillment Providers to pass customs information to shipping + carriers. + nullable: true + type: string + example: null + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Product Variant. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: >- + The material and composition that the Product Variant is made of, + May be used by Fulfillment Providers to pass customs information to + shipping carriers. + nullable: true + type: string + example: null + collection_id: + description: The Product Collection that the Product belongs to + nullable: true + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + collection: + description: >- + A product collection object. Available if the relation `collection` + is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + type_id: + description: The Product type that the Product belongs to + nullable: true + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: Available if the relation `type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + tags: + description: >- + The Product Tags assigned to the Product. Available if the relation + `tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + discountable: + description: >- + Whether the Product can be discounted. Discounts will not apply to + Line Items of this Product when this flag is set to `false`. + type: boolean + default: true + external_id: + description: The external ID of the product + nullable: true + type: string + example: null + sales_channels: + description: >- + The sales channels the product is associated with. Available if the + relation `sales_channels` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PublishableApiKeySalesChannel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + type: object + required: + - publishable_key_id + - sales_channel_id + properties: + sales_channel_id: + description: The sales channel's ID + type: string + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + description: The publishable API key's ID + type: string + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + PublishableApiKey: + title: Publishable API key + description: >- + Publishable API key defines scopes (i.e. resources) that are available + within a request. + type: object + required: + - created_at + - created_by + - id + - revoked_by + - revoked_at + - title + - updated_at + properties: + id: + description: The key's ID + type: string + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + description: The unique identifier of the user that created the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by: + description: The unique identifier of the user that revoked the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_at: + description: The date with timezone at which the key was revoked. + nullable: true + type: string + format: date-time + title: + description: The key's title. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + Refund: + title: Refund + description: >- + Refund represent an amount of money transfered back to the Customer for + a given reason. Refunds may occur in relation to Returns, Swaps and + Claims, but can also be initiated by a store operator. + type: object + required: + - amount + - created_at + - id + - idempotency_key + - metadata + - note + - order_id + - payment_id + - reason + - updated_at + properties: + id: + description: The refund's ID + type: string + example: ref_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Refund is related to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + $ref: '#/components/schemas/Payment' + amount: + description: The amount that has be refunded to the Customer. + type: integer + example: 1000 + note: + description: An optional note explaining why the amount was refunded. + nullable: true + type: string + example: I didn't like it + reason: + description: >- + The reason given for the Refund, will automatically be set when + processed as part of a Swap, Claim or Return. + type: string + enum: + - discount + - return + - swap + - claim + - other + example: return + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the refund + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Region: + title: Region + description: >- + Regions hold settings for how Customers in a given geographical location + shop. The is, for example, where currencies and tax rates are defined. A + Region can consist of multiple countries to accomodate common shopping + settings across countries. + type: object + required: + - automatic_taxes + - created_at + - currency_code + - deleted_at + - gift_cards_taxable + - id + - metadata + - name + - tax_code + - tax_provider_id + - tax_rate + - updated_at + properties: + id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + name: + description: >- + The name of the region as displayed to the customer. If the Region + only has one country it is recommended to write the country name. + type: string + example: EU + currency_code: + description: The 3 character currency code that the Region uses. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The tax rate that should be charged on purchases in the Region. + type: number + example: 0 + tax_rates: + description: >- + The tax rates that are included in the Region. Available if the + relation `tax_rates` is expanded. + type: array + items: + $ref: '#/components/schemas/TaxRate' + tax_code: + description: >- + The tax code used on purchases in the Region. This may be used by + other systems for accounting purposes. + nullable: true + type: string + example: null + gift_cards_taxable: + description: Whether the gift cards are taxable or not in this region. + type: boolean + default: true + automatic_taxes: + description: Whether taxes should be automated in this region. + type: boolean + default: true + countries: + description: >- + The countries that are included in the Region. Available if the + relation `countries` is expanded. + type: array + items: + $ref: '#/components/schemas/Country' + tax_provider_id: + description: The ID of the tax provider used in this region + nullable: true + type: string + example: null + tax_provider: + description: Available if the relation `tax_provider` is expanded. + nullable: true + $ref: '#/components/schemas/TaxProvider' + payment_providers: + description: >- + The Payment Providers that can be used to process Payments in the + Region. Available if the relation `payment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + fulfillment_providers: + description: >- + The Fulfillment Providers that can be used to fulfill orders in the + Region. Available if the relation `fulfillment_providers` is + expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentProvider' + includes_tax: + description: '[EXPERIMENTAL] Does the prices for the region include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnItem: + title: Return Item + description: >- + Correlates a Line Item with a Return, keeping track of the quantity of + the Line Item that will be returned. + type: object + required: + - is_requested + - item_id + - metadata + - note + - quantity + - reason_id + - received_quantity + - requested_quantity + - return_id + properties: + return_id: + description: The id of the Return that the Return Item belongs to. + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + item_id: + description: The id of the Line Item that the Return Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + return_order: + description: Available if the relation `return_order` is expanded. + nullable: true + $ref: '#/components/schemas/Return' + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Return. + type: integer + example: 1 + is_requested: + description: >- + Whether the Return Item was requested initially or received + unexpectedly in the warehouse. + type: boolean + default: true + requested_quantity: + description: The quantity that was originally requested to be returned. + nullable: true + type: integer + example: 1 + received_quantity: + description: The quantity that was received in the warehouse. + nullable: true + type: integer + example: 1 + reason_id: + description: The ID of the reason for returning the item. + nullable: true + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + reason: + description: Available if the relation `reason` is expanded. + nullable: true + $ref: '#/components/schemas/ReturnReason' + note: + description: An optional note with additional details about the Return. + nullable: true + type: string + example: I didn't like it. + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnReason: + title: Return Reason + description: >- + A Reason for why a given product is returned. A Return Reason can be + used on Return Items in order to indicate why a Line Item was returned. + type: object + required: + - created_at + - deleted_at + - description + - id + - label + - metadata + - parent_return_reason_id + - updated_at + - value + properties: + id: + description: The return reason's ID + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + value: + description: The value to identify the reason by. + type: string + example: damaged + label: + description: A text that can be displayed to the Customer as a reason. + type: string + example: Damaged goods + description: + description: A description of the Reason. + nullable: true + type: string + example: Items that are damaged + parent_return_reason_id: + description: The ID of the parent reason. + nullable: true + type: string + example: null + parent_return_reason: + description: Available if the relation `parent_return_reason` is expanded. + nullable: true + $ref: '#/components/schemas/ReturnReason' + return_reason_children: + description: Available if the relation `return_reason_children` is expanded. + $ref: '#/components/schemas/ReturnReason' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Return: + title: Return + description: >- + Return orders hold information about Line Items that a Customer wishes + to send back, along with how the items will be returned. Returns can be + used as part of a Swap. + type: object + required: + - claim_order_id + - created_at + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - received_at + - refund_amount + - shipping_data + - status + - swap_id + - updated_at + properties: + id: + description: The return's ID + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + status: + description: Status of the Return. + type: string + enum: + - requested + - received + - requires_action + - canceled + default: requested + items: + description: >- + The Return Items that will be shipped back to the warehouse. + Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/ReturnItem' + swap_id: + description: The ID of the Swap that the Return is a part of. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + claim_order_id: + description: The ID of the Claim that the Return is a part of. + nullable: true + type: string + example: null + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + order_id: + description: The ID of the Order that the Return is made from. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + shipping_method: + description: >- + The Shipping Method that will be used to send the Return back. Can + be null if the Customer facilitates the return shipment themselves. + Available if the relation `shipping_method` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingMethod' + shipping_data: + description: >- + Data about the return shipment as provided by the Fulfilment + Provider that handles the return shipment. + nullable: true + type: object + example: {} + location_id: + description: The id of the stock location the return will be added back. + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + refund_amount: + description: The amount that should be refunded as a result of the return. + type: integer + example: 1000 + no_notification: + description: >- + When set to true, no notification will be sent related to this + return. + nullable: true + type: boolean + example: false + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the return + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + received_at: + description: The date with timezone at which the return was received. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + SalesChannelLocation: + title: Sales Channel Stock Location + description: Sales Channel Stock Location link sales channels with stock locations. + type: object + required: + - created_at + - deleted_at + - id + - location_id + - sales_channel_id + - updated_at + properties: + id: + description: The Sales Channel Stock Location's ID + type: string + example: scloc_01G8X9A7ESKAJXG2H0E6F1MW7A + sales_channel_id: + description: The id of the Sales Channel + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + location_id: + description: The id of the Location Stock. + type: string + sales_channel: + description: >- + The sales channel the location is associated with. Available if the + relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + SalesChannel: + title: Sales Channel + description: A Sales Channel + type: object + required: + - created_at + - deleted_at + - description + - id + - is_disabled + - name + - updated_at + properties: + id: + description: The sales channel's ID + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + name: + description: The name of the sales channel. + type: string + example: Market + description: + description: The description of the sales channel. + nullable: true + type: string + example: Multi-vendor market + is_disabled: + description: Specify if the sales channel is enabled or disabled. + type: boolean + default: false + locations: + description: >- + The Stock Locations related to the sales channel. Available if the + relation `locations` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannelLocation' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingMethodTaxLine: + title: Shipping Method Tax Line + description: Shipping Method Tax Line + type: object + required: + - code + - created_at + - id + - shipping_method_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + shipping_method_id: + description: The ID of the line item + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_method: + description: Available if the relation `shipping_method` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingMethod' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingMethod: + title: Shipping Method + description: >- + Shipping Methods represent a way in which an Order or Return can be + shipped. Shipping Methods are built from a Shipping Option, but may + contain additional details, that can be necessary for the Fulfillment + Provider to handle the shipment. + type: object + required: + - cart_id + - claim_order_id + - data + - id + - order_id + - price + - return_id + - shipping_option_id + - swap_id + properties: + id: + description: The shipping method's ID + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_option_id: + description: >- + The id of the Shipping Option that the Shipping Method is built + from. + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Shipping Method is used on. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + claim_order_id: + description: The id of the Claim that the Shipping Method is used on. + nullable: true + type: string + example: null + claim_order: + description: >- + A claim order object. Available if the relation `claim_order` is + expanded. + nullable: true + $ref: '#/components/schemas/ClaimOrder' + cart_id: + description: The id of the Cart that the Shipping Method is used on. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + swap_id: + description: The id of the Swap that the Shipping Method is used on. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + $ref: '#/components/schemas/Swap' + return_id: + description: The id of the Return that the Shipping Method is used on. + nullable: true + type: string + example: null + return_order: + description: >- + A return object. Available if the relation `return_order` is + expanded. + nullable: true + $ref: '#/components/schemas/Return' + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethodTaxLine' + price: + description: >- + The amount to charge for the Shipping Method. The currency of the + price is defined by the Region that the Order that the Shipping + Method belongs to is a part of. + type: integer + example: 200 + data: + description: >- + Additional data that the Fulfillment Provider needs to fulfill the + shipment. This is used in combination with the Shipping Options + data, and may contain information such as a drop point id. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' + type: boolean + default: false + subtotal: + description: The subtotal of the shipping + type: integer + example: 8000 + total: + description: The total amount of the shipping + type: integer + example: 8200 + tax_total: + description: The total of tax + type: integer + example: 0 + ShippingOptionRequirement: + title: Shipping Option Requirement + description: >- + A requirement that a Cart must satisfy for the Shipping Option to be + available to the Cart. + type: object + required: + - amount + - deleted_at + - id + - shipping_option_id + - type + properties: + id: + description: The shipping option requirement's ID + type: string + example: sor_01G1G5V29AB4CTNDRFSRWSRKWD + shipping_option_id: + description: >- + The id of the Shipping Option that the hipping option requirement + belongs to + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + type: + description: >- + The type of the requirement, this defines how the value will be + compared to the Cart's total. `min_subtotal` requirements define the + minimum subtotal that is needed for the Shipping Option to be + available, while the `max_subtotal` defines the maximum subtotal + that the Cart can have for the Shipping Option to be available. + type: string + enum: + - min_subtotal + - max_subtotal + example: min_subtotal + amount: + description: The amount to compare the Cart subtotal to. + type: integer + example: 100 + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingOption: + title: Shipping Option + description: >- + Shipping Options represent a way in which an Order or Return can be + shipped. Shipping Options have an associated Fulfillment Provider that + will be used when the fulfillment of an Order is initiated. Shipping + Options themselves cannot be added to Carts, but serve as a template for + Shipping Methods. This distinction makes it possible to customize + individual Shipping Methods with additional information. + type: object + required: + - admin_only + - amount + - created_at + - data + - deleted_at + - id + - is_return + - metadata + - name + - price_type + - profile_id + - provider_id + - region_id + - updated_at + properties: + id: + description: The shipping option's ID + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + name: + description: >- + The name given to the Shipping Option - this may be displayed to the + Customer. + type: string + example: PostFake Standard + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + profile_id: + description: >- + The ID of the Shipping Profile that the shipping option belongs to. + Shipping Profiles have a set of defined Shipping Options that can be + used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + provider_id: + description: >- + The id of the Fulfillment Provider, that will be used to process + Fulfillments from the Shipping Option. + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + price_type: + description: >- + The type of pricing calculation that is used when creatin Shipping + Methods from the Shipping Option. Can be `flat_rate` for fixed + prices or `calculated` if the Fulfillment Provider can provide price + calulations. + type: string + enum: + - flat_rate + - calculated + example: flat_rate + amount: + description: >- + The amount to charge for shipping when the Shipping Option price + type is `flat_rate`. + nullable: true + type: integer + example: 200 + is_return: + description: >- + Flag to indicate if the Shipping Option can be used for Return + shipments. + type: boolean + default: false + admin_only: + description: >- + Flag to indicate if the Shipping Option usage is restricted to admin + users. + type: boolean + default: false + requirements: + description: >- + The requirements that must be satisfied for the Shipping Option to + be available for a Cart. Available if the relation `requirements` is + expanded. + type: array + items: + $ref: '#/components/schemas/ShippingOptionRequirement' + data: + description: >- + The data needed for the Fulfillment Provider to identify the + Shipping Option. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Does the shipping option price include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingProfile: + title: Shipping Profile + description: >- + Shipping Profiles have a set of defined Shipping Options that can be + used to fulfill a given set of Products. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - type + - updated_at + properties: + id: + description: The shipping profile's ID + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + name: + description: >- + The name given to the Shipping profile - this may be displayed to + the Customer. + type: string + example: Default Shipping Profile + type: + description: >- + The type of the Shipping Profile, may be `default`, `gift_card` or + `custom`. + type: string + enum: + - default + - gift_card + - custom + example: default + products: + description: >- + The Products that the Shipping Profile defines Shipping Options for. + Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + shipping_options: + description: >- + The Shipping Options that can be used to fulfill the Products in the + Shipping Profile. Available if the relation `shipping_options` is + expanded. + type: array + items: + $ref: '#/components/schemas/ShippingOption' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingTaxRate: + title: Shipping Tax Rate + description: >- + Associates a tax rate with a shipping option to indicate that the + shipping option is taxed in a certain way + type: object + required: + - created_at + - metadata + - rate_id + - shipping_option_id + - updated_at + properties: + shipping_option_id: + description: The ID of the Shipping Option + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + StagedJob: + title: Staged Job + description: A staged job resource + type: object + required: + - data + - event_name + - id + - options + properties: + id: + description: The staged job's ID + type: string + example: job_01F0YET7BZTARY9MKN1SJ7AAXF + event_name: + description: The name of the event + type: string + example: order.placed + data: + description: Data necessary for the job + type: object + example: {} + option: + description: The staged job's option + type: object + example: {} + Store: + title: Store + description: 'Holds settings for the Store, such as name, currencies, etc.' + type: object + required: + - created_at + - default_currency_code + - default_location_id + - id + - invite_link_template + - metadata + - name + - payment_link_template + - swap_link_template + - updated_at + properties: + id: + description: The store's ID + type: string + example: store_01G1G5V21KADXNGH29BJMAJ4B4 + name: + description: The name of the Store - this may be displayed to the Customer. + type: string + example: Medusa Store + default_currency_code: + description: The 3 character currency code that is the default of the store. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + default_currency: + description: Available if the relation `default_currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + currencies: + description: >- + The currencies that are enabled for the Store. Available if the + relation `currencies` is expanded. + type: array + items: + $ref: '#/components/schemas/Currency' + swap_link_template: + description: >- + A template to generate Swap links from. Use {{cart_id}} to include + the Swap's `cart_id` in the link. + nullable: true + type: string + example: null + payment_link_template: + description: >- + A template to generate Payment links from. Use {{cart_id}} to + include the payment's `cart_id` in the link. + nullable: true + type: string + example: null + invite_link_template: + description: A template to generate Invite links from + nullable: true + type: string + example: null + default_location_id: + description: The location ID the store is associated with. + nullable: true + type: string + example: null + default_sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + default_sales_channel: + description: >- + A sales channel object. Available if the relation + `default_sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Swap: + title: Swap + description: >- + Swaps can be created when a Customer wishes to exchange Products that + they have purchased to different Products. Swaps consist of a Return of + previously purchased Products and a Fulfillment of new Products, the + amount paid for the Products being returned will be used towards payment + for the new Products. In the case where the amount paid for the the + Products being returned exceed the amount to be paid for the new + Products, a Refund will be issued for the difference. + type: object + required: + - allow_backorder + - canceled_at + - cart_id + - confirmed_at + - created_at + - deleted_at + - difference_due + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - shipping_address_id + - updated_at + properties: + id: + description: The swap's ID + type: string + example: swap_01F0YET86Y9G92D3YDR9Y6V676 + fulfillment_status: + description: The status of the Fulfillment of the Swap. + type: string + enum: + - not_fulfilled + - fulfilled + - shipped + - partially_shipped + - canceled + - requires_action + example: not_fulfilled + payment_status: + description: >- + The status of the Payment of the Swap. The payment may either refer + to the refund of an amount or the authorization of a new amount. + type: string + enum: + - not_paid + - awaiting + - captured + - confirmed + - canceled + - difference_refunded + - partially_refunded + - refunded + - requires_action + example: not_paid + order_id: + description: >- + The ID of the Order where the Line Items to be returned where + purchased. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + $ref: '#/components/schemas/Order' + additional_items: + description: >- + The new Line Items to ship to the Customer. Available if the + relation `additional_items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + return_order: + description: >- + A return order object. The Return that is issued for the return part + of the Swap. Available if the relation `return_order` is expanded. + nullable: true + $ref: '#/components/schemas/Return' + fulfillments: + description: >- + The Fulfillments used to send the new Line Items. Available if the + relation `fulfillments` is expanded. + type: array + items: + $ref: '#/components/schemas/Fulfillment' + payment: + description: >- + The Payment authorized when the Swap requires an additional amount + to be charged from the Customer. Available if the relation `payment` + is expanded. + nullable: true + $ref: '#/components/schemas/Payment' + difference_due: + description: >- + The difference that is paid or refunded as a result of the Swap. May + be negative when the amount paid for the returned items exceed the + total of the new Products. + nullable: true + type: integer + example: 0 + shipping_address_id: + description: >- + The Address to send the new Line Items to - in most cases this will + be the same as the shipping address on the Order. + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: >- + The Shipping Methods used to fulfill the additional items purchased. + Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + cart_id: + description: The id of the Cart that the Customer will use to confirm the Swap. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + confirmed_at: + description: >- + The date with timezone at which the Swap was confirmed by the + Customer. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + nullable: true + type: string + format: date-time + no_notification: + description: 'If set to true, no notification will be sent related to this swap' + nullable: true + type: boolean + example: false + allow_backorder: + description: 'If true, swaps can be completed with items out of stock' + type: boolean + default: false + idempotency_key: + description: >- + Randomly generated key used to continue the completion of the swap + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxLine: + title: Tax Line + description: Line item that specifies an amount of tax to add to a line item. + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The tax line's ID + type: string + example: tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxProvider: + title: Tax Provider + description: The tax service used to calculate taxes + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the tax provider as given by the plugin. + type: string + example: manual + is_installed: + description: >- + Whether the plugin is installed in the current version. Plugins that + are no longer installed are not deleted by will have this field set + to `false`. + type: boolean + default: true + TaxRate: + title: Tax Rate + description: >- + A Tax Rate can be used to associate a certain rate to charge on products + within a given Region + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - region_id + - updated_at + properties: + id: + description: The tax rate's ID + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + rate: + description: The numeric rate to charge + nullable: true + type: number + example: 10 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + region_id: + description: The id of the Region that the rate belongs to + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + products: + description: >- + The products that belong to this tax rate. Available if the relation + `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: >- + The product types that belong to this tax rate. Available if the + relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + shipping_options: + type: array + description: >- + The shipping options that belong to this tax rate. Available if the + relation `shipping_options` is expanded. + items: + $ref: '#/components/schemas/ShippingOption' + product_count: + description: The count of products + type: integer + example: 10 + product_type_count: + description: The count of product types + type: integer + example: 2 + shipping_option_count: + description: The count of shipping options + type: integer + example: 1 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TrackingLink: + title: Tracking Link + description: >- + Tracking Link holds information about tracking numbers for a + Fulfillment. Tracking Links can optionally contain a URL that can be + visited to see the status of the shipment. + type: object + required: + - created_at + - deleted_at + - fulfillment_id + - id + - idempotency_key + - metadata + - tracking_number + - updated_at + - url + properties: + id: + description: The tracking link's ID + type: string + example: tlink_01G8ZH853Y6TFXWPG5EYE81X63 + url: + description: The URL at which the status of the shipment can be tracked. + nullable: true + type: string + format: uri + tracking_number: + description: The tracking number given by the shipping carrier. + type: string + format: RH370168054CN + fulfillment_id: + description: The id of the Fulfillment that the Tracking Link references. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + fulfillment: + description: Available if the relation `fulfillment` is expanded. + nullable: true + $ref: '#/components/schemas/Fulfillment' + idempotency_key: + description: >- + Randomly generated key used to continue the completion of a process + in case of failure. + nullable: true + type: string + externalDocs: + url: >- + https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + User: + title: User + description: Represents a User who can manage store settings. + type: object + required: + - api_token + - created_at + - deleted_at + - email + - first_name + - id + - last_name + - metadata + - role + - updated_at + properties: + id: + description: The user's ID + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + role: + description: The user's role + type: string + enum: + - admin + - member + - developer + default: member + email: + description: The email of the User + type: string + format: email + first_name: + description: The first name of the User + nullable: true + type: string + example: Levi + last_name: + description: The last name of the User + nullable: true + type: string + example: Bogan + api_token: + description: An API token associated with the user. + nullable: true + type: string + example: null + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: >- + The Harmonized System code of the Inventory Item. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + origin_country: + description: >- + The country in which the Inventory Item was produced. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Inventory Item. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + type: string + material: + description: >- + The material and composition that the Inventory Item is made of, May + be used by Fulfillment Providers to pass customs information to + shipping carriers. + type: string + weight: + description: >- + The weight of the Inventory Item. May be used in shipping rate + calculations. + type: number + height: + description: >- + The height of the Inventory Item. May be used in shipping rate + calculations. + type: number + width: + description: >- + The width of the Inventory Item. May be used in shipping rate + calculations. + type: number + length: + description: >- + The length of the Inventory Item. May be used in shipping rate + calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + ReservationItemDTO: + title: Reservation item + description: Represents a reservation of an inventory item at a stock location + type: object + required: + - id + - location_id + - inventory_item_id + - quantity + properties: + id: + description: The id of the reservation item + type: string + location_id: + description: The id of the location of the reservation + type: string + inventory_item_id: + description: The id of the inventory item the reservation relates to + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: >- + the total stock quantity of an inventory item at the given location + ID + type: number + reserved_quantity: + description: >- + the reserved stock quantity of an inventory item at the given + location ID + type: number + incoming_quantity: + description: >- + the incoming stock quantity of an inventory item at the given + location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + PricedVariant: + title: Priced Product Variant + type: object + allOf: + - $ref: '#/components/schemas/ProductVariant' + - type: object + properties: + original_price: + type: number + description: >- + The original price of the variant without any discounted prices + applied. + calculated_price: + type: number + description: The calculated price of the variant. Can be a discounted price. + original_price_incl_tax: + type: number + description: The original price of the variant including taxes. + calculated_price_incl_tax: + type: number + description: The calculated price of the variant including taxes. + original_tax: + type: number + description: The taxes applied on the original price. + calculated_tax: + type: number + description: The taxes applied on the calculated price. + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + PricedProduct: + title: Priced Product + type: object + allOf: + - $ref: '#/components/schemas/Product' + - type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + StockLocationAddressDTO: + title: Stock Location Address + description: Represents a Stock Location Address + type: object + required: + - address_1 + - country_code + - created_at + - updated_at + properties: + id: + type: string + description: The stock location address' ID + example: laddr_51G4ZW853Y6TFXWPG5ENJ81X42 + address_1: + type: string + description: Stock location address + example: '35, Jhon Doe Ave' + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + StockLocationDTO: + title: Stock Location + description: Represents a Stock Location + type: object + required: + - id + - name + - address_id + - created_at + - updated_at + properties: + id: + type: string + description: The stock location's ID + example: sloc_51G4ZW853Y6TFXWPG5ENJ81X42 + address_id: + type: string + description: Stock location address' ID + example: laddr_05B2ZE853Y6FTXWPW85NJ81A44 + name: + type: string + description: The name of the stock location + example: Main Warehouse + address: + description: The Address of the Stock Location + allOf: + - $ref: '#/components/schemas/StockLocationAddressDTO' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + StockLocationAddressInput: + title: Stock Location Address Input + description: Represents a Stock Location Address Input + type: object + required: + - address_1 + - country_code + properties: + address_1: + type: string + description: Stock location address + example: '35, Jhon Doe Ave' + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + CreateStockLocationInput: + title: Create Stock Location Input + description: Represents the Input to create a Stock Location + type: object + required: + - name + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + UpdateStockLocationInput: + title: Update Stock Location Input + description: Represents the Input to update a Stock Location + type: object + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + MultipleErrors: + title: Multiple Errors + type: object + properties: + errors: + type: array + description: Array of errors + items: + $ref: '#/components/schemas/Error' + message: + type: string + default: >- + Provided request body contains errors. Please check the data and + retry the request + Error: + title: Response Error + type: object + properties: + code: + type: string + description: A slug code to indicate the type of the error. + message: + type: string + description: Description of the error that occurred. + type: + type: string + description: A slug indicating the type of the error. + StorePostAuthReq: + type: object + required: + - email + - password + properties: + email: + type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. + StoreAuthRes: + type: object + properties: + customer: + $ref: '#/components/schemas/Customer' + StoreGetAuthEmailRes: + type: object + properties: + exists: + type: boolean + description: Whether email exists or not. + StorePostCartsCartShippingMethodReq: + type: object + required: + - option_id + properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: >- + Used to hold any data that the shipping method may need to process + the fulfillment of the order. Look at the documentation for your + installed fulfillment providers to find out what to send. + StorePostCartReq: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Cart in. + sales_channel_id: + type: string + description: '[EXPERIMENTAL] The ID of the Sales channel to create the Cart in.' + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: >- + https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + items: + description: >- + An optional array of `variant_id`, `quantity` pairs to generate Line + Items from. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The id of the Product Variant to generate a Line Item from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: >- + An optional object to provide context to the Cart. The `context` + field is automatically populated with `ip` and `user_agent` + type: object + example: + ip: '::1' + user_agent: Chrome + StoreCartsRes: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + StoreCompleteCartRes: + 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 + allOf: + - description: >- + Cart was successfully authorized and order was placed + successfully. + - $ref: '#/components/schemas/Order' + - type: object + allOf: + - description: >- + Cart was successfully authorized but requires further + actions. + - $ref: '#/components/schemas/Cart' + - type: object + allOf: + - description: >- + When cart is used for a swap and it has been completed + successfully. + - $ref: '#/components/schemas/Swap' + StorePostCartsCartPaymentSessionReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + 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: + type: object + required: + - code + properties: + code: + description: The code that a Gift Card is identified by. + type: string + discounts: + description: An array of Discount codes to add to the Cart. + type: array + items: + type: object + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The ID of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. + type: object + example: + ip: '::1' + user_agent: Chrome + StorePostCartsCartLineItemsItemReq: + type: object + required: + - quantity + properties: + quantity: + type: number + description: The quantity to set the Line Item to. + StorePostCartsCartPaymentSessionUpdateReq: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. + StoreCollectionsListRes: + 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 + StoreCollectionsRes: + type: object + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + 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 + StoreCustomersRes: + type: object + properties: + customer: + $ref: '#/components/schemas/Customer' + StoreCustomersListOrdersRes: + type: object + properties: + orders: + type: array + items: + $ref: '#/components/schemas/Order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreCustomersListPaymentMethodsRes: + type: object + properties: + payment_methods: + type: array + items: + type: object + properties: + provider_id: + type: string + description: >- + The id of the Payment Provider where the payment method is + saved. + data: + type: object + description: >- + The data needed for the Payment Provider to use the saved + payment method. + 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 + StoreGiftCardsRes: + type: object + properties: + gift_card: + $ref: '#/components/schemas/GiftCard' + StorePostOrderEditsOrderEditDecline: + type: object + properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. + StoreOrderEditsRes: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + StorePostCustomersCustomerAcceptClaimReq: + type: object + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + StoreOrdersRes: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + 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 + StorePaymentCollectionsRes: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + StorePaymentCollectionsSessionRes: + type: object + properties: + payment_session: + $ref: '#/components/schemas/PaymentSession' + StorePostPaymentCollectionsBatchSessionsReq: + type: object + required: + - sessions + properties: + sessions: + description: >- + An array of payment sessions related to the Payment Collection. If + the session_id is not provided, existing sessions not present will + be deleted and the provided ones will be created. + type: array + items: + type: object + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + StorePaymentCollectionSessionsReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + StoreGetProductCategoriesCategoryRes: + type: object + properties: + product_category: + $ref: '#/components/schemas/ProductCategory' + StoreProductCategoriesListRes: + type: object + properties: + product_categories: + type: array + items: + $ref: '#/components/schemas/ProductCategory' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreProductTypesListRes: + type: object + properties: + product_types: + type: array + items: + $ref: '#/components/schemas/ProductType' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreProductsRes: + type: object + properties: + product: + $ref: '#/components/schemas/PricedProduct' + StorePostSearchRes: + type: object + properties: + hits: + type: array + description: >- + Array of results. The format of the items depends on the search + engine installed on the server. + StoreProductsListRes: + type: object + properties: + products: + type: array + items: + $ref: '#/components/schemas/PricedProduct' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreRegionsListRes: + type: object + properties: + regions: + type: array + items: + $ref: '#/components/schemas/Region' + StoreRegionsRes: + type: object + properties: + region: + $ref: '#/components/schemas/Region' + StoreReturnReasonsListRes: + type: object + properties: + return_reasons: + type: array + items: + $ref: '#/components/schemas/ReturnReason' + StoreReturnReasonsRes: + type: object + properties: + return_reason: + $ref: '#/components/schemas/ReturnReason' + StorePostReturnsReq: + type: object + required: + - order_id + - items + properties: + order_id: + type: string + description: The ID of the Order to create the Return from. + items: + description: The items to include in the Return. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item from the Order. + type: string + quantity: + description: The quantity to return. + type: integer + reason_id: + description: The ID of the return reason. + type: string + note: + description: A note to add to the item returned. + type: string + return_shipping: + description: >- + If the Return is to be handled by the store operator the Customer + can choose a Return Shipping Method. Alternatvely the Customer can + handle the Return themselves. + type: object + required: + - option_id + properties: + option_id: + type: string + description: >- + The ID of the Shipping Option to create the Shipping Method + from. + StoreReturnsRes: + type: object + properties: + return: + $ref: '#/components/schemas/Return' + StoreShippingOptionsListRes: + type: object + properties: + shipping_options: + type: array + items: + $ref: '#/components/schemas/ShippingOption' + StorePostSwapsReq: + type: object + required: + - order_id + - return_items + - additional_items + properties: + order_id: + type: string + description: The ID of the Order to create the Swap for. + return_items: + description: The items to include in the Return. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item from the Order. + type: string + quantity: + description: The quantity to swap. + type: integer + reason_id: + description: The ID of the reason of this return. + type: string + note: + description: The note to add to the item being swapped. + type: string + return_shipping_option: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + additional_items: + description: The items to exchange the returned items to. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to send. + type: string + quantity: + description: The quantity to send of the variant. + type: integer + StoreSwapsRes: + type: object + properties: + swap: + $ref: '#/components/schemas/Swap' + StoreVariantsRes: + type: object + properties: + variant: + $ref: '#/components/schemas/PricedVariant' + StoreVariantsListRes: + type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + StorePostCartsCartLineItemsReq: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: The id of the Product Variant to generate the Line Item from. + quantity: + type: number + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: >- + An optional key-value map with additional details about the Line + Item. diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml new file mode 100644 index 0000000000..1a3df1f561 --- /dev/null +++ b/docs/api/store-spec3.yaml @@ -0,0 +1,11437 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Medusa Storefront API + description: | + API reference for Medusa's Storefront endpoints. All endpoints are prefixed with `/store`. + + ## Authentication + + To send requests as an authenticated customer, you must use the Cookie Session ID. + + + + ## Expanding Fields + + In many endpoints you'll find an `expand` query parameter that can be passed to the endpoint. You can use the `expand` query parameter to unpack an entity's relations and return them in the response. + + For example, when you list customers you can also retrieve their groups by passing to the `expand` query parameter the value `groups`. + + You can expand more than one relation by separating the relations in the `expand` query parameter with a comma. For example, to retrieve both the orders and the groups of a customer, pass to the `expand` query parameter the value `groups,orders`. + + Please note that the parameters you pass to `expand` replace any relations that are expanded by default. + + ## Selecting Fields + + In many endpoints you'll find a `fields` query parameter that can be passed to the endpoint. You can use the `fields` query parameter to specify which fields in the entity should be returned in the response. + + You can pass more than one field by seperating the field names in the `fields` query parameter with a comma. + + Only the fields you pass to `field` will be retrieved and returned in the response. Any fields that are returned by default will not be returned in this case. This does not affect relations. + + For example, to only select the `title` and `description` fields of a product, pass to the `fields` query parameter the value `title,description`. + + ## Pagination + + ### Query Parameters + + In listing endpoints, such as list customers or list products, you can control the pagination using the query parameters `limit` and `offset`. + + `limit` is used to specify the maximum number of items that can be return in the response. `offset` is used to specify how many items to skip before returning the resulting entities. + + You can use the `offset` query parameter to change between pages. For example, if the limit is 50, at page 1 the offset should be 0; at page 2 the offset should be 50, and so on. + + ### Response Fields + + In listing fields, aside from the entities retrieved, there are three pagination-related fields returned: `count`, `limit`, and `offset`. + + Similarly to the query parameters, `limit` is the maximum number of items that can be returned in the response, and `field` is the number of items that were skipped before the entities in the result. + + `count` is the total number of available items of this entity. It can be used to determine how many pages are there. + + For example, if the `count` is 100 and the `limit` is 50, you can divide the `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. + license: + name: MIT + url: https://github.com/medusajs/medusa/blob/master/LICENSE +tags: + - name: Auth + description: Auth endpoints that allow authorization of customers and manages their sessions. + - name: Cart + description: Cart endpoints that allow handling carts in Medusa. + - name: Collection + description: Collection endpoints that allow handling collections in Medusa. + - name: Customer + description: Customer endpoints that allow handling customers in Medusa. + - name: Gift Card + description: Gift Card endpoints that allow handling gift cards in Medusa. + - name: Order + description: Order endpoints that allow handling orders in Medusa. + - name: Product + description: Product endpoints that allow handling products in Medusa. + - name: Product Variant + description: Product Variant endpoints that allow handling product variants in Medusa. + - name: Region + description: Region endpoints that allow handling regions in Medusa. + - name: Return Reason + description: Return Reason endpoints that allow handling return reasons in Medusa. + - name: Return + description: Return endpoints that allow handling returns in Medusa. + - name: Shipping Option + description: Shipping Option endpoints that allow handling shipping options in Medusa. + - name: Swap + description: Swap endpoints that allow handling swaps in Medusa. +servers: + - url: https://api.medusa-commerce.com/store +paths: + /auth: + post: + operationId: PostAuth + summary: Customer Login + description: Logs a Customer in and authorizes them to view their details. Successful authentication will set a session cookie in the Customer's browser. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostAuthReq' + x-codegen: + method: authenticate + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.auth.authenticate({ + email: 'user@example.com', + password: 'user@example.com' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/incorrect_credentials' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteAuth + summary: Customer Log out + description: Destroys a Customer's authenticated session. + x-authenticated: true + x-codegen: + method: deleteSession + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/auth' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetAuth + summary: Get Current Customer + description: Gets the currently logged in Customer. + x-authenticated: true + x-codegen: + method: getSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.auth.getSession() + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/auth' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreAuthRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /auth/{email}: + get: + operationId: GetAuthEmail + summary: Check if email exists + description: Checks if a Customer with the given email has signed up. + parameters: + - in: path + name: email + schema: + type: string + format: email + required: true + description: The email to check if exists. + x-codegen: + method: exists + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.auth.exists('user@example.com') + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/auth/user@example.com' \ + --header 'Cookie: connect.sid={sid}' + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGetAuthEmailRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts/{id}/shipping-methods: + post: + operationId: PostCartsCartShippingMethod + description: Adds a Shipping Method to the Cart. + summary: Add a Shipping Method + parameters: + - in: path + name: id + required: true + description: The cart ID. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartShippingMethodReq' + x-codegen: + method: addShippingMethod + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.addShippingMethod(cart_id, { + option_id + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "option_id": "{option_id}", + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts/{id}/taxes: + post: + summary: Calculate Cart Taxes + operationId: PostCartsCartTaxes + description: Calculates taxes for a cart. Depending on the cart's region this may involve making 3rd party API calls to a Tax Provider service. + parameters: + - in: path + name: id + required: true + description: The Cart ID. + schema: + type: string + x-codegen: + method: calculateTaxes + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/taxes' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts/{id}/complete: + post: + summary: Complete a Cart + operationId: PostCartsCartComplete + description: Completes a cart. The following steps will be performed. Payment authorization is attempted and if more work is required, we simply return the cart for further updates. If payment is authorized and order is not yet created, we make sure to do so. The completion of a cart can be performed idempotently with a provided header `Idempotency-Key`. If not provided, we will generate one for the request. + parameters: + - in: path + name: id + required: true + description: The Cart id. + schema: + type: string + x-codegen: + method: complete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.complete(cart_id) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/complete' + tags: + - 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: + $ref: '#/components/schemas/StoreCompleteCartRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts: + post: + summary: Create a Cart + operationId: PostCart + description: Creates a Cart within the given region and with the initial items. If no `region_id` is provided the cart will be associated with the first Region available. If no items are provided the cart will be empty after creation. If a user is logged in the cart's customer id and email will be set. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.create() + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts' + tags: + - Cart + responses: + '200': + description: Successfully created a new Cart + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts/{id}/payment-sessions: + post: + operationId: PostCartsCartPaymentSessions + summary: Create Payment Sessions + description: Creates Payment Sessions for each of the available Payment Providers in the Cart's Region. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codegen: + method: createPaymentSessions + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.createPaymentSessions(cart_id) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts/{id}/discounts/{code}: + delete: + operationId: DeleteCartsCartDiscountsDiscount + description: Removes a Discount from a Cart. + summary: Remove Discount + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: code + required: true + description: The unique Discount code. + schema: + type: string + x-codegen: + method: deleteDiscount + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.deleteDiscount(cart_id, code) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/discounts/{code}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: deleteLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.lineItems.delete(cart_id, line_id) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartLineItemsItem + summary: Update a Line Item + description: Updates a Line Item if the desired quantity can be fulfilled. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsItemReq' + x-codegen: + method: updateLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.lineItems.update(cart_id, line_id, { + quantity: 1 + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /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-codegen: + method: deletePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.deletePaymentSession(cart_id, 'manual') + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the payment provider. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionUpdateReq' + x-codegen: + method: updatePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.updatePaymentSession(cart_id, 'manual', { + data: { + } + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "data": {} + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts/{id}: + get: + operationId: GetCartsCart + summary: Get a Cart + description: Retrieves a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.retrieve(cart_id) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/carts/{id}' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCartsCart + summary: Update a Cart + description: Updates a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.update(cart_id, { + email: 'user@example.com' + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts/{id}/payment-sessions/{provider_id}/refresh: + post: + operationId: PostCartsCartPaymentSessionsSession + summary: Refresh a Payment Session + description: Refreshes a Payment Session to ensure that it is in sync with the Cart - this is usually not necessary. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the Payment Provider that created the Payment Session to be refreshed. + schema: + type: string + x-codegen: + method: refreshPaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.refreshPaymentSession(cart_id, 'manual') + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts/{id}/payment-session: + post: + operationId: PostCartsCartPaymentSession + summary: Select a Payment Session + description: Selects a Payment Session as the session intended to be used towards the completion of the Cart. + parameters: + - in: path + name: id + required: true + description: The ID of the Cart. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionReq' + x-codegen: + method: setPaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.setPaymentSession(cart_id, { + provider_id: 'manual' + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "provider_id": "manual" + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /collections/{id}: + get: + operationId: GetCollectionsCollection + summary: Get a Collection + description: Retrieves a Product Collection. + parameters: + - in: path + name: id + required: true + description: The id of the Product Collection + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.collections.retrieve(collection_id) + .then(({ collection }) => { + console.log(collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/collections/{id}' + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /collections: + get: + operationId: GetCollections + summary: List Collections + description: Retrieve a list of Product Collection. + parameters: + - in: query + name: offset + description: The number of collections to skip before starting to collect the collections set + schema: + type: integer + default: 0 + - in: query + name: limit + description: The number of collections to return + schema: + type: integer + default: 10 + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: StoreGetCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.collections.list() + .then(({ collections, limit, offset, count }) => { + console.log(collections.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/collections' + tags: + - Collection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCollectionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/me/addresses: + post: + operationId: PostCustomersCustomerAddresses + summary: Add a Shipping Address + description: Adds a Shipping Address to a Customer's saved addresses. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesReq' + x-codegen: + method: addAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.addresses.addAddress({ + address: { + first_name: 'Celia', + last_name: 'Schumm', + address_1: '225 Bednar Curve', + city: 'Danielville', + country_code: 'US', + postal_code: '85137', + phone: '981-596-6748 x90188', + company: 'Wyman LLC', + address_2: '', + province: 'Georgia', + metadata: {} + } + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses' \ + --header 'Cookie: connect.sid={sid}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "address": { + "first_name": "Celia", + "last_name": "Schumm", + "address_1": "225 Bednar Curve", + "city": "Danielville", + "country_code": "US", + "postal_code": "85137" + } + }' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: A successful response + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers: + post: + operationId: PostCustomers + summary: Create a Customer + description: Creates a Customer account. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.customers.create({ + first_name: 'Alec', + last_name: 'Reynolds', + email: 'user@example.com', + password: 'supersecret' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Alec", + "last_name": "Reynolds", + "email": "user@example.com", + "password": "supersecret" + }' + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + description: A customer with the same email exists + content: + application/json: + schema: + type: object + properties: + code: + type: string + description: The error code + type: + type: string + description: The type of error + message: + type: string + description: Human-readable message with details about the error + example: + code: invalid_request_error + type: duplicate_error + message: A customer with the given email already has an account. Log in instead + '500': + $ref: '#/components/responses/500_error' + /customers/me/addresses/{address_id}: + delete: + operationId: DeleteCustomersCustomerAddressesAddress + summary: Delete an Address + description: Removes an Address from the Customer's saved addresses. + x-authenticated: true + parameters: + - in: path + name: address_id + required: true + description: The id of the Address to remove. + schema: + type: string + x-codegen: + method: deleteAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.addresses.deleteAddress(address_id) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomerAddressesAddress + summary: Update a Shipping Address + description: Updates a Customer's saved Shipping Address. + x-authenticated: true + parameters: + - in: path + name: address_id + required: true + description: The id of the Address to update. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesAddressReq' + x-codegen: + method: updateAddress + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.addresses.updateAddress(address_id, { + first_name: 'Gina' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ + --header 'Cookie: connect.sid={sid}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Gina" + }' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/me: + get: + operationId: GetCustomersCustomer + summary: Get a Customer + description: Retrieves a Customer - the Customer must be logged in to retrieve their details. + x-authenticated: true + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.retrieve() + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/customers/me' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostCustomersCustomer + summary: Update Customer + description: Updates a Customer's saved details. + x-authenticated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerReq' + x-codegen: + method: update + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.update({ + first_name: 'Laury' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/me' \ + --header 'Cookie: connect.sid={sid}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "first_name": "Laury" + }' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/me/payment-methods: + get: + operationId: GetCustomersCustomerPaymentMethods + summary: Get Payment Methods + description: Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods. + x-authenticated: true + x-codegen: + method: listPaymentMethods + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.paymentMethods.list() + .then(({ payment_methods }) => { + console.log(payment_methods.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/customers/me/payment-methods' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersListPaymentMethodsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/me/orders: + get: + operationId: GetCustomersCustomerOrders + summary: List Orders + description: Retrieves a list of a Customer's Orders. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching orders. + schema: + type: string + - in: query + name: id + description: Id of the order to search for. + schema: + type: string + - in: query + name: status + style: form + explode: false + description: Status to search for. + schema: + type: array + items: + type: string + - in: query + name: fulfillment_status + style: form + explode: false + description: Fulfillment status to search for. + schema: + type: array + items: + type: string + - in: query + name: payment_status + style: form + explode: false + description: Payment status to search for. + schema: + type: array + items: + type: string + - in: query + name: display_id + description: Display id to search for. + schema: + type: string + - in: query + name: cart_id + description: to search for. + schema: + type: string + - in: query + name: email + description: to search for. + schema: + type: string + - in: query + name: region_id + description: to search for. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + - in: query + name: tax_rate + description: to search for. + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting collections were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting collections were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: canceled_at + description: Date comparison for when resulting collections were canceled. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: limit + description: How many orders to return. + schema: + type: integer + default: 10 + - in: query + name: offset + description: The offset in the resulting orders. + schema: + type: integer + default: 0 + - in: query + name: fields + description: (Comma separated string) Which fields should be included in the resulting orders. + schema: + type: string + - in: query + name: expand + description: (Comma separated string) Which relations should be expanded in the resulting orders. + schema: + type: string + x-codegen: + method: listOrders + queryParams: StoreGetCustomersCustomerOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged + medusa.customers.listOrders() + .then(({ orders, limit, offset, count }) => { + console.log(orders); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/customers/me/orders' \ + --header 'Cookie: connect.sid={sid}' + security: + - cookie_auth: [] + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersListOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/password-token: + post: + operationId: PostCustomersCustomerPasswordToken + summary: Request Password Reset + description: Creates a reset password token to be used in a subsequent /reset-password request. The password token should be sent out of band e.g. via email and will not be returned. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerPasswordTokenReq' + x-codegen: + method: generatePasswordToken + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.customers.generatePasswordToken({ + email: 'user@example.com' + }) + .then(() => { + // successful + }) + .catch(() => { + // failed + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/password-token' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com" + }' + tags: + - Customer + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /customers/password-reset: + post: + operationId: PostCustomersResetPassword + summary: Reset Password + description: Resets a Customer's password using a password token created by a previous /password-token request. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersResetPasswordReq' + x-codegen: + method: resetPassword + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.customers.resetPassword({ + email: 'user@example.com', + password: 'supersecret', + token: 'supersecrettoken' + }) + .then(({ customer }) => { + console.log(customer.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/password-reset' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret", + "token": "supersecrettoken" + }' + tags: + - Customer + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCustomersRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /gift-cards/{code}: + get: + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unique code. + parameters: + - in: path + name: code + required: true + description: The unique Gift Card code. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.giftCards.retrieve(code) + .then(({ gift_card }) => { + console.log(gift_card.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/gift-cards/{code}' + tags: + - Gift Card + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGiftCardsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits/{id}/complete: + post: + operationId: PostOrderEditsOrderEditComplete + summary: Completes an OrderEdit + description: Completes an OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the Order Edit. + schema: + type: string + x-codegen: + method: complete + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orderEdits.complete(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/complete' + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits/{id}/decline: + post: + operationId: PostOrderEditsOrderEditDecline + summary: Decline an OrderEdit + description: Declines an OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostOrderEditsOrderEditDecline' + x-codegen: + method: decline + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orderEdits.decline(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id); + }) + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/decline' + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '500': + $ref: '#/components/responses/500_error' + /order-edits/{id}: + get: + operationId: GetOrderEditsOrderEdit + summary: Retrieve an OrderEdit + description: Retrieves a OrderEdit. + parameters: + - in: path + name: id + required: true + description: The ID of the OrderEdit. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orderEdits.retrieve(order_edit_id) + .then(({ order_edit }) => { + console.log(order_edit.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/order-edits/{id}' + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderEditsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/customer/confirm: + post: + operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept + summary: Verify an Order Claim + description: Verifies the claim order token provided to the customer upon request of order ownership + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerAcceptClaimReq' + x-codegen: + method: confirmRequest + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.orders.confirmRequest( + token, + ) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/orders/customer/confirm' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "token": "{token}", + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Order + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/cart/{cart_id}: + get: + operationId: GetOrdersOrderCartId + summary: Get by Cart ID + description: Retrieves an Order by the id of the Cart that was used to create the Order. + parameters: + - in: path + name: cart_id + required: true + description: The ID of Cart. + schema: + type: string + x-codegen: + method: retrieveByCartId + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orders.retrieveByCartId(cart_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/orders/cart/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/{id}: + get: + operationId: GetOrdersOrder + summary: Get an Order + description: Retrieves an Order + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the result. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orders.retrieve(order_id) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/orders/{id}' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders: + get: + operationId: GetOrders + summary: Look Up an Order + description: Look up an order using filters. + parameters: + - in: query + name: display_id + required: true + description: The display id given to the Order. + schema: + type: number + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in the result. + schema: + type: string + - in: query + name: email + style: form + explode: false + description: The email associated with this order. + required: true + schema: + type: string + format: email + - in: query + name: shipping_address + style: form + explode: false + description: The shipping address associated with this order. + schema: + type: object + properties: + postal_code: + type: string + description: The postal code of the shipping address + x-codegen: + method: lookupOrder + queryParams: StoreGetOrdersParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.orders.lookupOrder({ + display_id: 1, + email: 'user@example.com' + }) + .then(({ order }) => { + console.log(order.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrdersRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /orders/batch/customer/token: + post: + operationId: PostOrdersCustomerOrderClaim + summary: Claim an Order + description: Sends an email to emails registered to orders provided with link to transfer order ownership + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCustomersCustomerOrderClaimReq' + x-codegen: + method: requestCustomerOrders + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.orders.claimOrders({ + display_ids, + }) + .then(() => { + // successful + }) + .catch(() => { + // an error occurred + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/batch/customer/token' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "display_ids": ["id"], + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Invite + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payment-collections/{id}/sessions/batch/authorize: + post: + operationId: PostPaymentCollectionsSessionsBatchAuthorize + summary: Authorize PaymentSessions + description: Authorizes Payment Sessions of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq' + x-codegen: + method: authorizePaymentSessionsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.paymentCollections.authorize(payment_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payment-collections/{id}/sessions/{session_id}/authorize: + post: + operationId: PostPaymentCollectionsSessionsSessionAuthorize + summary: Authorize Payment Session + description: Authorizes a Payment Session of a Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + - in: path + name: session_id + required: true + description: The ID of the Payment Session. + schema: + type: string + x-codegen: + method: authorizePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.paymentCollections.authorize(payment_id, session_id) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsSessionRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payment-collections/{id}: + get: + operationId: GetPaymentCollectionsPaymentCollection + summary: Get a PaymentCollection + description: Get a Payment Collection + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the PaymentCollection. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: GetPaymentCollectionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.paymentCollections.retrieve(paymentCollectionId) + .then(({ payment_collection }) => { + console.log(payment_collection.id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/payment-collections/{id}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payment-collections/{id}/sessions/batch: + post: + operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch + summary: Manage Payment Sessions + description: Manages Multiple Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collections. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsReq' + x-codegen: + method: managePaymentSessionsBatch + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + // Total amount = 10000 + // Adding two new sessions + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 5000, + }, + { + provider_id: "manual", + amount: 5000, + }, + ]) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + // Updating one session and removing the other + medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ + { + provider_id: "stripe", + amount: 10000, + session_id: "ps_123456" + }, + ]) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payment-collections/{id}/sessions: + post: + operationId: PostPaymentCollectionsSessions + summary: Manage a Payment Session + description: Manages Payment Sessions from Payment Collections. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Payment Collection. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionSessionsReq' + x-codegen: + method: managePaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + // Total amount = 10000 + // Adding a payment session + medusa.paymentCollections.managePaymentSession(payment_id, { provider_id: "stripe" }) + .then(({ payment_collection }) => { + console.log(payment_collection.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions' + security: + - api_token: [] + - cookie_auth: [] + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /payment-collections/{id}/sessions/{session_id}: + post: + operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession + summary: Refresh a Payment Session + description: Refreshes a Payment Session to ensure that it is in sync with the Payment Collection. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The id of the PaymentCollection. + schema: + type: string + - in: path + name: session_id + required: true + description: The id of the Payment Session to be refreshed. + schema: + type: string + x-codegen: + method: refreshPaymentSession + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id) + .then(({ payment_session }) => { + console.log(payment_session.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + tags: + - PaymentCollection + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePaymentCollectionsSessionRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-categories/{id}: + get: + operationId: GetProductCategoriesCategory + summary: Get a Product Category + description: Retrieves a Product Category. + x-authenticated: false + parameters: + - in: path + name: id + required: true + description: The ID of the Product Category + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product category. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be retrieved in each product category. + schema: + type: string + x-codegen: + method: retrieve + queryParams: StoreGetProductCategoryParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.productCategories.retrieve(product_category_id) + .then(({ product_category }) => { + console.log(product_category.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/product-categories/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreGetProductCategoriesCategoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-categories: + get: + operationId: GetProductCategories + summary: List Product Categories + description: Retrieve a list of product categories. + x-authenticated: false + parameters: + - in: query + name: q + description: Query used for searching product category names orhandles. + schema: + type: string + - in: query + name: parent_category_id + description: Returns categories scoped by parent + schema: + type: string + - in: query + name: offset + description: How many product categories to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of product categories returned. + schema: + type: integer + default: 100 + x-codegen: + method: list + queryParams: StoreGetProductCategoriesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.productCategories.list() + .then(({ product_categories, limit, offset, count }) => { + console.log(product_categories.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/product-categories' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductCategoriesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/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 types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product tags. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The tag values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product tags were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product tags were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.productTags.list() + .then(({ product_tags }) => { + console.log(product_tags.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/product-tags' + tags: + - Product 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 + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /product-types: + get: + operationId: GetProductTypes + summary: List Product Types + description: Retrieve a list of Product Types. + x-authenticated: true + parameters: + - in: query + name: limit + description: The number of types to return. + schema: + type: integer + default: 20 + - in: query + name: offset + description: The number of items to skip before the results. + schema: + type: integer + default: 0 + - in: query + name: order + description: The field to sort items by. + schema: + type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string + - in: query + name: value + style: form + explode: false + description: The type values to search for + schema: + type: array + items: + type: string + - in: query + name: id + style: form + explode: false + description: The type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: q + description: A query string to search values for + schema: + type: string + - in: query + name: created_at + description: Date comparison for when resulting product types were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting product types were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: StoreGetProductTypesParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.productTypes.list() + .then(({ product_types }) => { + console.log(product_types.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/product-types' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Type + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductTypesListRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/{id}: + get: + operationId: GetProductsProduct + summary: Get a Product + description: Retrieves a Product. + parameters: + - in: path + name: id + required: true + description: The id of the Product. + schema: + type: string + - in: query + name: sales_channel_id + description: The sales channel used when fetching the product. + schema: + type: string + - in: query + name: cart_id + description: The ID of the customer's cart. + schema: + type: string + - in: query + name: region_id + description: The ID of the region the customer is using. This is helpful to ensure correct prices are retrieved for a region. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product of the result. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. This is helpful to ensure correct prices are retrieved for a currency. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetProductsProductParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.products.retrieve(product_id) + .then(({ product }) => { + console.log(product.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/products/{id}' + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products: + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Products. + parameters: + - in: query + name: q + description: Query used for searching products by title, description, variant's title, variant's sku, and collection's title + schema: + type: string + - in: query + name: id + style: form + explode: false + description: product IDs to search for. + schema: + oneOf: + - type: string + - type: array + items: + type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: an array of sales channel IDs to filter the retrieved products by. + schema: + type: array + items: + type: string + - in: query + name: collection_id + style: form + explode: false + description: Collection IDs to search for + schema: + type: array + items: + type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to search for + schema: + type: array + items: + type: string + - in: query + name: tags + style: form + explode: false + description: Tag IDs to search for + schema: + type: array + items: + type: string + - in: query + name: title + description: title to search for. + schema: + type: string + - in: query + name: description + description: description to search for. + schema: + type: string + - in: query + name: handle + description: handle to search for. + schema: + type: string + - in: query + name: is_giftcard + description: Search for giftcards using is_giftcard=true. + schema: + type: boolean + - in: query + name: created_at + description: Date comparison for when resulting products were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting products were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: category_id + style: form + explode: false + description: Category ids to filter by. + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id. + schema: + type: boolean + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + default: 100 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product of the result. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in each product of the result. + schema: + type: string + - in: query + name: order + description: the field used to order the products. + schema: + type: string + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + x-codegen: + method: list + queryParams: StoreGetProductsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.products.list() + .then(({ products, limit, offset, count }) => { + console.log(products.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/products' + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreProductsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /products/search: + post: + operationId: PostProductsSearch + summary: Search Products + description: Run a search query on products using the search engine installed on Medusa + parameters: + - in: query + name: q + required: true + description: The query to run the search with. + schema: + type: string + - in: query + name: offset + description: How many products to skip in the result. + schema: + type: integer + - in: query + name: limit + description: Limit the number of products returned. + schema: + type: integer + x-codegen: + method: search + queryParams: StorePostSearchReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.products.search({ + q: 'Shirt' + }) + .then(({ hits }) => { + console.log(hits.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/products/search?q=Shirt' + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostSearchRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions/{id}: + get: + operationId: GetRegionsRegion + summary: Get a Region + description: Retrieves a Region. + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.regions.retrieve(region_id) + .then(({ region }) => { + console.log(region.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/regions/{id}' + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreRegionsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /regions: + get: + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + parameters: + - in: query + name: offset + description: How many regions to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of regions returned. + schema: + type: integer + default: 100 + - in: query + name: created_at + description: Date comparison for when resulting regions were created. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + - in: query + name: updated_at + description: Date comparison for when resulting regions were updated. + schema: + type: object + properties: + lt: + type: string + description: filter by dates less than this date + format: date + gt: + type: string + description: filter by dates greater than this date + format: date + lte: + type: string + description: filter by dates less than or equal to this date + format: date + gte: + type: string + description: filter by dates greater than or equal to this date + format: date + x-codegen: + method: list + queryParams: StoreGetRegionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.regions.list() + .then(({ regions }) => { + console.log(regions.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/regions' + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreRegionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /return-reasons/{id}: + get: + operationId: GetReturnReasonsReason + summary: Get a Return Reason + description: Retrieves a Return Reason. + parameters: + - in: path + name: id + required: true + description: The id of the Return Reason. + schema: + type: string + x-codegen: + method: retrieve + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.returnReasons.retrieve(reason_id) + .then(({ return_reason }) => { + console.log(return_reason.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/return-reasons/{id}' + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreReturnReasonsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /return-reasons: + get: + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. + x-codegen: + method: list + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.returnReasons.list() + .then(({ return_reasons }) => { + console.log(return_reasons.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/return-reasons' + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreReturnReasonsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /returns: + post: + operationId: PostReturns + summary: Create Return + description: Creates a Return for an Order. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostReturnsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.returns.create({ + order_id, + items: [ + { + item_id, + quantity: 1 + } + ] + }) + .then((data) => { + console.log(data.return.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/returns' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "order_id": "asfasf", + "items": [ + { + "item_id": "assfasf", + "quantity": 1 + } + ] + }' + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreReturnsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /shipping-options: + get: + operationId: GetShippingOptions + summary: Get Shipping Options + description: Retrieves a list of Shipping Options. + parameters: + - in: query + name: is_return + description: Whether return Shipping Options should be included. By default all Shipping Options are returned. + schema: + type: boolean + - in: query + name: product_ids + description: A comma separated list of Product ids to filter Shipping Options by. + schema: + type: string + - in: query + name: region_id + description: the Region to retrieve Shipping Options from. + schema: + type: string + x-codegen: + method: list + queryParams: StoreGetShippingOptionsParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.shippingOptions.list() + .then(({ shipping_options }) => { + console.log(shipping_options.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/shipping-options' + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreShippingOptionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /shipping-options/{cart_id}: + get: + operationId: GetShippingOptionsCartId + summary: List for Cart + description: Retrieves a list of Shipping Options available to a cart. + parameters: + - in: path + name: cart_id + required: true + description: The id of the Cart. + schema: + type: string + x-codegen: + method: listCartOptions + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.shippingOptions.listCartOptions(cart_id) + .then(({ shipping_options }) => { + console.log(shipping_options.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/shipping-options/{cart_id}' + tags: + - Shipping Option + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreShippingOptionsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /swaps: + post: + operationId: PostSwaps + summary: Create a Swap + description: Creates a Swap on an Order by providing some items to return along with some items to send back + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostSwapsReq' + x-codegen: + method: create + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.swaps.create({ + order_id, + return_items: [ + { + item_id, + quantity: 1 + } + ], + additional_items: [ + { + variant_id, + quantity: 1 + } + ] + }) + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/swaps' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "order_id": "asfasf", + "return_items": [ + { + "item_id": "asfas", + "quantity": 1 + } + ], + "additional_items": [ + { + "variant_id": "asfas", + "quantity": 1 + } + ] + }' + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreSwapsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /swaps/{cart_id}: + get: + operationId: GetSwapsSwapCartId + summary: Get by Cart ID + description: Retrieves a Swap by the id of the Cart used to confirm the Swap. + parameters: + - in: path + name: cart_id + required: true + description: The id of the Cart + schema: + type: string + x-codegen: + method: retrieveByCartId + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.swaps.retrieveByCartId(cart_id) + .then(({ swap }) => { + console.log(swap.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/swaps/{cart_id}' + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreSwapsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /variants/{variant_id}: + get: + operationId: GetVariantsVariant + summary: Get a Product Variant + description: Retrieves a Product Variant by id + parameters: + - in: path + name: variant_id + required: true + description: The id of the Product Variant. + schema: + type: string + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + style: form + explode: false + description: The 3 character ISO currency code to set prices based on. + schema: + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetVariantsVariantParams + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/variants/{id}' + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreVariantsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /variants: + get: + operationId: GetVariants + summary: Get Product Variants + description: Retrieves a list of Product Variants + parameters: + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: offset + description: How many product variants to skip in the result. + schema: + type: number + default: '0' + - in: query + name: limit + description: Maximum number of Product Variants to return. + schema: + type: number + default: '100' + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search using less and greater than comparisons. + properties: + lt: + type: number + description: filter by inventory quantity less than this number + gt: + type: number + description: filter by inventory quantity greater than this number + lte: + type: number + description: filter by inventory quantity less than or equal to this number + gte: + type: number + description: filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: StoreGetVariantsParams + x-codeSamples: + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/store/variants' + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreVariantsListRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /carts/{id}/line-items: + post: + operationId: PostCartsCartLineItems + summary: Add a Line Item + description: Generates a Line Item with a given Product Variant and adds it to the Cart + parameters: + - in: path + name: id + required: true + description: The id of the Cart to add the Line Item to. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsReq' + x-codegen: + method: createLineItem + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.carts.lineItems.create(cart_id, { + variant_id, + quantity: 1 + }) + .then(({ cart }) => { + console.log(cart.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "variant_id": "{variant_id}", + "quantity": 1 + }' + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartsRes' + '400': + $ref: '#/components/responses/400_error' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' +components: + responses: + default_error: + description: Default Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + invalid_state_error: + description: Invalid State Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: unknown_error + message: The request conflicted with another request. You may retry the request with the provided Idempotency-Key. + type: QueryRunnerAlreadyReleasedError + invalid_request_error: + description: Invalid Request Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: invalid_request_error + message: Discount with code TEST already exists. + type: duplicate_error + not_found_error: + description: Not Found Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + message: Entity with id 1 was not found + type: not_found + 400_error: + description: Client Error or Multiple Errors + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Error' + - $ref: '#/components/schemas/MultipleErrors' + examples: + not_allowed: + $ref: '#/components/examples/not_allowed_error' + invalid_data: + $ref: '#/components/examples/invalid_data_error' + MultipleErrors: + $ref: '#/components/examples/multiple_errors' + 500_error: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + database: + $ref: '#/components/examples/database_error' + unexpected_state: + $ref: '#/components/examples/unexpected_state_error' + invalid_argument: + $ref: '#/components/examples/invalid_argument_error' + default_error: + $ref: '#/components/examples/default_error' + unauthorized: + description: User is not authorized. Must log in first + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + incorrect_credentials: + description: User does not exist or incorrect credentials + content: + text/plain: + schema: + type: string + default: Unauthorized + example: Unauthorized + examples: + not_allowed_error: + summary: Not Allowed Error + value: + message: Discount must be set to dynamic + type: not_allowed + invalid_data_error: + summary: Invalid Data Error + value: + message: first_name must be a string + type: invalid_data + multiple_errors: + summary: Multiple Errors + value: + message: Provided request body contains errors. Please check the data and retry the request + errors: + - message: first_name must be a string + type: invalid_data + - message: Discount must be set to dynamic + type: not_allowed + database_error: + summary: Database Error + value: + code: api_error + message: An error occured while hashing password + type: database_error + unexpected_state_error: + summary: Unexpected State Error + value: + message: cart.total must be defined + type: unexpected_state + invalid_argument_error: + summary: Invalid Argument Error + value: + message: cart.total must be defined + type: unexpected_state + default_error: + summary: Default Error + value: + code: unknown_error + message: An unknown error occurred. + type: unknown_error + securitySchemes: + cookie_auth: + type: apiKey + x-displayName: Cookie Session ID + in: cookie + name: connect.sid + description: | + Use a cookie session to send authenticated requests. + + ### How to Obtain the Cookie Session + + If you're sending requests through a browser, using JS Client, or using tools like Postman, the cookie session should be automatically set when the customer is logged in. + + If you're sending requests using cURL, you must set the Session ID in the cookie manually. + + To do that, send a request to [authenticate the customer](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: + + ```bash + curl -v --location --request POST 'https://medusa-url.com/store/auth' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@example.com", + "password": "supersecret" + }' + ``` + + The headers will be logged in the terminal as well as the response. You should find in the headers a Cookie header similar to this: + + ```bash + Set-Cookie: connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; + ``` + + Copy the value after `connect.sid` (without the `;` at the end) and pass it as a cookie in subsequent requests as the following: + + ```bash + curl --location --request GET 'https://medusa-url.com/store/customers/me/orders' \ + --header 'Cookie: connect.sid={sid}' + ``` + + Where `{sid}` is the value of `connect.sid` that you copied. + schemas: + AddressFields: + title: Address Fields + description: Address fields used when creating/updating an address. + type: object + properties: + company: + type: string + description: Company name + example: Acme + first_name: + type: string + description: First name + example: Arno + last_name: + type: string + description: Last name + example: Willms + address_1: + type: string + description: Address line 1 + example: 14433 Kemmer Court + address_2: + type: string + description: Address line 2 + example: Suite 369 + city: + type: string + description: City + example: South Geoffreyview + country_code: + type: string + description: The 2 character ISO code of the country in lower case + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + province: + type: string + description: Province + example: Kentucky + postal_code: + type: string + description: Postal Code + example: 72093 + phone: + type: string + description: Phone Number + example: 16128234334802 + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + Address: + title: Address + description: An address. + type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at + properties: + id: + type: string + description: ID of the address + example: addr_01G8ZC9VS1XVE149MGH2J7QSSH + customer_id: + description: ID of the customer this address belongs to + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: Available if the relation `customer` is expanded. + nullable: true + type: object + company: + description: Company name + nullable: true + type: string + example: Acme + first_name: + description: First name + nullable: true + type: string + example: Arno + last_name: + description: Last name + nullable: true + type: string + example: Willms + address_1: + description: Address line 1 + nullable: true + type: string + example: 14433 Kemmer Court + address_2: + description: Address line 2 + nullable: true + type: string + example: Suite 369 + city: + description: City + nullable: true + type: string + example: South Geoffreyview + country_code: + description: The 2 character ISO code of the country in lower case + nullable: true + type: string + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + example: st + country: + description: A country object. Available if the relation `country` is expanded. + nullable: true + $ref: '#/components/schemas/Country' + province: + description: Province + nullable: true + type: string + example: Kentucky + postal_code: + description: Postal Code + nullable: true + type: string + example: 72093 + phone: + description: Phone Number + nullable: true + type: string + example: 16128234334802 + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + BatchJob: + title: Batch Job + description: A Batch Job. + type: object + required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status + - type + - updated_at + properties: + id: + description: The unique identifier for the batch job. + type: string + example: batch_01G8T782965PYFG0751G0Z38B4 + type: + description: The type of batch job. + type: string + enum: + - product-import + - product-export + status: + description: The status of the batch job. + type: string + enum: + - created + - pre_processed + - confirmed + - processing + - completed + - canceled + - failed + default: created + created_by: + description: The unique identifier of the user that created the batch job. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + created_by_user: + description: A user object. Available if the relation `created_by_user` is expanded. + nullable: true + $ref: '#/components/schemas/User' + context: + description: The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true + type: object + example: + shape: + prices: + - region: null + currency_code: eur + dynamicImageColumnCount: 4 + dynamicOptionColumnCount: 2 + list_config: + skip: 0 + take: 50 + order: + created_at: DESC + relations: + - variants + - variant.prices + - images + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + nullable: true + allOf: + - type: object + example: {} + - type: object + properties: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: + type: string + file_size: + type: number + example: + errors: + - err: [] + code: unknown + message: Method not implemented. + stat_descriptors: + - key: product-export-count + name: Product count to export + message: There will be 8 products exported by this action + pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true + type: string + format: date-time + processing_at: + description: The date the job is processing at. + nullable: true + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + nullable: true + type: string + format: date-time + completed_at: + description: The date of the completion. + nullable: true + type: string + format: date-time + canceled_at: + description: The date of the concellation. + nullable: true + type: string + format: date-time + failed_at: + description: The date when the job failed. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was last updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Cart: + title: Cart + description: Represents a user cart + type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at + properties: + id: + description: The cart's ID + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + email: + description: The email associated with the cart + nullable: true + type: string + format: email + billing_address_id: + description: The billing address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The shipping address's ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + discounts: + description: Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + customer_id: + description: The customer's ID + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + type: object + payment_session: + description: The selected payment session in the cart. + nullable: true + type: object + payment_sessions: + description: The payment sessions created on the cart. + type: array + items: + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object + shipping_methods: + description: The shipping methods added to the cart. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + type: + description: The cart's type. + type: string + enum: + - default + - swap + - draft_order + - payment_link + - claim + default: default + completed_at: + description: The date with timezone at which the cart was completed. + nullable: true + type: string + format: date-time + payment_authorized_at: + description: The date with timezone at which the payment was authorized. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + context: + description: The context of the cart which can include info like IP or user agent. + nullable: true + type: object + example: + ip: '::1' + user_agent: PostmanRuntime/7.29.2 + sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + sales_channel: + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + shipping_total: + description: The total of shipping + type: integer + example: 1000 + discount_total: + description: The total of discount + type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order associated with this cart is returned. + type: integer + example: 0 + total: + description: The total amount of the cart + type: integer + example: 8200 + subtotal: + description: The subtotal of the cart + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + ClaimImage: + title: Claim Image + description: Represents photo documentation of a claim. + type: object + required: + - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + description: The claim image's ID + type: string + example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 + claim_item_id: + description: The ID of the claim item associated with the image + type: string + claim_item: + description: A claim item object. Available if the relation `claim_item` is expanded. + nullable: true + type: object + url: + description: The URL of the image + type: string + format: uri + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimItem: + title: Claim Item + description: Represents a claimed item along with information about the reasons for the claim. + type: object + required: + - claim_order_id + - created_at + - deleted_at + - id + - item_id + - metadata + - note + - quantity + - reason + - updated_at + - variant_id + properties: + id: + description: The claim item's ID + type: string + example: citm_01G8ZH853Y6TFXWPG5EYE81X63 + images: + description: Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimImage' + claim_order_id: + description: The ID of the claim this item is associated with. + type: string + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + item_id: + description: The ID of the line item that the claim item refers to. + type: string + example: item_01G8ZM25TN49YV9EQBE2NC27KC + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + variant_id: + description: The ID of the product variant that is claimed. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A variant object. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + reason: + description: The reason for the claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + note: + description: An optional note about the claim, for additional information + nullable: true + type: string + example: I don't like it. + quantity: + description: The quantity of the item that is being claimed; must be less than or equal to the amount purchased in the original order. + type: integer + example: 1 + tags: + description: User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded. + type: array + items: + $ref: '#/components/schemas/ClaimTag' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ClaimOrder: + title: Claim Order + description: Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. + type: object + required: + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at + properties: + id: + description: The claim's ID + type: string + example: claim_01G8ZH853Y6TFXWPG5EYE81X63 + type: + description: The claim's type + type: string + enum: + - refund + - replace + payment_status: + description: The status of the claim's payment + type: string + enum: + - na + - not_refunded + - refunded + default: na + fulfillment_status: + description: The claim's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + claim_items: + description: The items that have been claimed + type: array + items: + $ref: '#/components/schemas/ClaimItem' + additional_items: + description: Refers to the new items to be shipped when the claim order has the type `replace` + type: array + items: + $ref: '#/components/schemas/LineItem' + order_id: + description: The ID of the order that the claim comes from. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + return_order: + description: A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + nullable: true + type: object + shipping_address_id: + description: The ID of the address that the new items should be shipped to + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The shipping methods that the claim order will be shipped with. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + fulfillments: + description: The fulfillments of the new items to be shipped + type: array + items: + type: object + refund_amount: + description: The amount that will be refunded in conjunction with the claim + nullable: true + type: integer + example: 1000 + canceled_at: + description: The date with timezone at which the claim was canceled. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + no_notification: + description: Flag for describing whether or not notifications related to this should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + ClaimTag: + title: Claim Tag + description: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The claim tag's ID + type: string + example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 + value: + description: The value that the claim tag holds + type: string + example: Damaged + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Country: + title: Country + description: Country details + type: object + required: + - display_name + - id + - iso_2 + - iso_3 + - name + - num_code + - region_id + properties: + id: + description: The country's ID + type: string + example: 109 + iso_2: + description: The 2 character ISO code of the country in lower case + type: string + example: it + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + iso_3: + description: The 2 character ISO code of the country in lower case + type: string + example: ita + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements + description: See a list of codes. + num_code: + description: The numerical ISO code for the country. + type: string + example: 380 + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements + description: See a list of codes. + name: + description: The normalized country name in upper case. + type: string + example: ITALY + display_name: + description: The country name appropriate for display. + type: string + example: Italy + region_id: + description: The region ID this country is associated with. + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + Currency: + title: Currency + description: Currency + type: object + required: + - code + - name + - symbol + - symbol_native + properties: + code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + symbol: + description: The symbol used to indicate the currency. + type: string + example: $ + symbol_native: + description: The native symbol used to indicate the currency. + type: string + example: $ + name: + description: The written name of the currency + type: string + example: US Dollar + includes_tax: + description: '[EXPERIMENTAL] Does the currency prices include tax' + type: boolean + default: false + CustomShippingOption: + title: Custom Shipping Option + description: Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option + type: object + required: + - cart_id + - created_at + - deleted_at + - id + - metadata + - price + - shipping_option_id + - updated_at + properties: + id: + description: The custom shipping option's ID + type: string + example: cso_01G8X99XNB77DMFBJFWX6DN9V9 + price: + description: The custom price set that will override the shipping option's original price + type: integer + example: 1000 + shipping_option_id: + description: The ID of the Shipping Option that the custom shipping option overrides + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: A shipping option object. Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + cart_id: + description: The ID of the Cart that the custom shipping option is attached to + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + CustomerGroup: + title: Customer Group + description: Represents a customer group + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - updated_at + properties: + id: + description: The customer group's ID + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + name: + description: The name of the customer group + type: string + example: VIP + customers: + description: The customers that belong to the customer group. Available if the relation `customers` is expanded. + type: array + items: + type: object + price_lists: + description: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Customer: + title: Customer + description: Represents a customer + type: object + required: + - billing_address_id + - created_at + - deleted_at + - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at + properties: + id: + description: The customer's ID + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + email: + description: The customer's email + type: string + format: email + first_name: + description: The customer's first name + nullable: true + type: string + example: Arno + last_name: + description: The customer's last name + nullable: true + type: string + example: Willms + billing_address_id: + description: The customer's billing address ID + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_addresses: + description: Available if the relation `shipping_addresses` is expanded. + type: array + items: + $ref: '#/components/schemas/Address' + phone: + description: The customer's phone number + nullable: true + type: string + example: 16128234334802 + has_account: + description: Whether the customer has an account or not + type: boolean + default: false + orders: + description: Available if the relation `orders` is expanded. + type: array + items: + type: object + groups: + description: The customer groups the customer belongs to. Available if the relation `groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionCustomerGroup: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + type: object + required: + - condition_id + - created_at + - customer_group_id + - metadata + - updated_at + properties: + customer_group_id: + description: The ID of the Product Tag + type: string + example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + customer_group: + description: Available if the relation `customer_group` is expanded. + nullable: true + $ref: '#/components/schemas/CustomerGroup' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductCollection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + type: object + required: + - condition_id + - created_at + - metadata + - product_collection_id + - updated_at + properties: + product_collection_id: + description: The ID of the Product Collection + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_collection: + description: Available if the relation `product_collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductTag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + type: object + required: + - condition_id + - created_at + - metadata + - product_tag_id + - updated_at + properties: + product_tag_id: + description: The ID of the Product Tag + type: string + example: ptag_01F0YESHPZYY3H4SJ3A5918SBN + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_tag: + description: Available if the relation `product_tag` is expanded. + nullable: true + $ref: '#/components/schemas/ProductTag' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProductType: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + type: object + required: + - condition_id + - created_at + - metadata + - product_type_id + - updated_at + properties: + product_type_id: + description: The ID of the Product Tag + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountConditionProduct: + title: Product Discount Condition + description: Associates a discount condition with a product + type: object + required: + - condition_id + - created_at + - metadata + - product_id + - updated_at + properties: + product_id: + description: The ID of the Product Tag + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + condition_id: + description: The ID of the Discount Condition + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + discount_condition: + description: Available if the relation `discount_condition` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountCondition' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountCondition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + type: object + required: + - created_at + - deleted_at + - discount_rule_id + - id + - metadata + - operator + - type + - updated_at + properties: + id: + description: The discount condition's ID + type: string + example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + operator: + description: The operator of the Condition + type: string + enum: + - in + - not_in + discount_rule_id: + description: The ID of the discount rule associated with the condition + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + discount_rule: + description: Available if the relation `discount_rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + products: + description: products associated with this condition if type = products. Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + product_tags: + description: Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + product_collections: + description: Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductCollection' + customer_groups: + description: Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DiscountRule: + title: Discount Rule + description: Holds the rules that governs how a Discount is calculated when applied to a Cart. + type: object + required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata + - type + - updated_at + - value + properties: + id: + description: The discount rule's ID + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + type: + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. + type: string + enum: + - fixed + - percentage + - free_shipping + example: percentage + description: + description: A short description of the discount + nullable: true + type: string + example: 10 Percent + value: + description: The value that the discount represents; this will depend on the type of the discount + type: integer + example: 10 + allocation: + description: The scope that the discount should apply to. + nullable: true + type: string + enum: + - total + - item + example: total + conditions: + description: A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Discount: + title: Discount + description: Represents a discount that can be applied to a cart for promotional purposes. + type: object + required: + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration + properties: + id: + description: The discount's ID + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + code: + description: A unique code for the discount - this will be used by the customer to apply the discount + type: string + example: 10DISC + is_dynamic: + description: A flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts + type: boolean + example: false + rule_id: + description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string + example: dru_01F0YESMVK96HVX7N419E3CJ7C + rule: + description: Available if the relation `rule` is expanded. + nullable: true + $ref: '#/components/schemas/DiscountRule' + is_disabled: + description: Whether the Discount has been disabled. Disabled discounts cannot be applied to carts + type: boolean + example: false + parent_discount_id: + description: The Discount that the discount was created from. This will always be a dynamic discount + nullable: true + type: string + example: disc_01G8ZH853YPY9B94857DY91YGW + parent_discount: + description: Available if the relation `parent_discount` is expanded. + nullable: true + type: object + starts_at: + description: The time at which the discount can be used. + type: string + format: date-time + ends_at: + description: The time at which the discount can no longer be used. + nullable: true + type: string + format: date-time + valid_duration: + description: Duration the discount runs between + nullable: true + type: string + example: P3Y6M4DT12H30M5S + regions: + description: The Regions in which the Discount can be used. Available if the relation `regions` is expanded. + type: array + items: + $ref: '#/components/schemas/Region' + usage_limit: + description: The maximum number of times that a discount can be used. + nullable: true + type: integer + example: 100 + usage_count: + description: The number of times a discount has been used. + type: integer + example: 50 + default: 0 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + DraftOrder: + title: DraftOrder + description: Represents a draft order + type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at + properties: + id: + description: The draft order's ID + type: string + example: dorder_01G8TJFKBG38YYFQ035MSVG03C + status: + description: The status of the draft order + type: string + enum: + - open + - completed + default: open + display_id: + description: The draft order's display ID + type: string + example: 2 + cart_id: + description: The ID of the cart associated with the draft order. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the order associated with the draft order. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + canceled_at: + description: The date the draft order was canceled at. + nullable: true + type: string + format: date-time + completed_at: + description: The date the draft order was completed at. + nullable: true + type: string + format: date-time + no_notification_order: + description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + FulfillmentItem: + title: Fulfillment Item + description: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. + type: object + required: + - fulfillment_id + - item_id + - quantity + properties: + fulfillment_id: + description: The id of the Fulfillment that the Fulfillment Item belongs to. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + item_id: + description: The id of the Line Item that the Fulfillment Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + fulfillment: + description: A fulfillment object. Available if the relation `fulfillment` is expanded. + nullable: true + type: object + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Fulfillment. + type: integer + example: 1 + FulfillmentProvider: + title: Fulfillment Provider + description: Represents a fulfillment provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the fulfillment provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + Fulfillment: + title: Fulfillment + description: Fulfillments are created once store operators can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a provider, which is typically an external shipping aggregator, shipping partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. + type: object + required: + - canceled_at + - claim_order_id + - created_at + - data + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - provider_id + - shipped_at + - swap_id + - tracking_numbers + - updated_at + properties: + id: + description: The fulfillment's ID + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + claim_order_id: + description: The id of the Claim that the Fulfillment belongs to. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Fulfillment belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + order_id: + description: The id of the Order that the Fulfillment belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + provider_id: + description: The id of the Fulfillment Provider responsible for handling the fulfillment + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + location_id: + description: The id of the stock location the fulfillment will be shipped from + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + items: + description: The Fulfillment Items in the Fulfillment - these hold information about how many of each Line Item has been fulfilled. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentItem' + tracking_links: + description: The Tracking Links that can be used to track the status of the Fulfillment, these will usually be provided by the Fulfillment Provider. Available if the relation `tracking_links` is expanded. + type: array + items: + $ref: '#/components/schemas/TrackingLink' + tracking_numbers: + description: The tracking numbers that can be used to track the status of the fulfillment. + deprecated: true + type: array + items: + type: string + data: + description: This contains all the data necessary for the Fulfillment provider to handle the fulfillment. + type: object + example: {} + shipped_at: + description: The date with timezone at which the Fulfillment was shipped. + nullable: true + type: string + format: date-time + no_notification: + description: Flag for describing whether or not notifications related to this should be sent. + nullable: true + type: boolean + example: false + canceled_at: + description: The date with timezone at which the Fulfillment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of the fulfillment in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + GiftCardTransaction: + title: Gift Card Transaction + description: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order + type: object + required: + - amount + - created_at + - gift_card_id + - id + - is_taxable + - order_id + - tax_rate + properties: + id: + description: The gift card transaction's ID + type: string + example: gct_01G8X9A7ESKAJXG2H0E6F1MW7A + gift_card_id: + description: The ID of the Gift Card that was used in the transaction. + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + gift_card: + description: A gift card object. Available if the relation `gift_card` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Gift Card was used to pay for. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + amount: + description: The amount that was used from the Gift Card. + type: integer + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + is_taxable: + description: Whether the transaction is taxable or not. + nullable: true + type: boolean + example: false + tax_rate: + description: The tax rate of the transaction + nullable: true + type: number + example: 0 + GiftCard: + title: Gift Card + description: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. + type: object + required: + - balance + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - metadata + - order_id + - region_id + - tax_rate + - updated_at + - value + properties: + id: + description: The gift card's ID + type: string + example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ + code: + description: The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card. + type: string + example: 3RFT-MH2C-Y4YZ-XMN4 + value: + description: The value that the Gift Card represents. + type: integer + example: 10 + balance: + description: The remaining value on the Gift Card. + type: integer + example: 10 + region_id: + description: The id of the Region in which the Gift Card is available. + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + order_id: + description: The id of the Order that the Gift Card was purchased in. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + is_disabled: + description: Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts. + type: boolean + default: false + ends_at: + description: The time at which the Gift Card can no longer be used. + nullable: true + type: string + format: date-time + tax_rate: + description: The gift card's tax rate that will be applied on calculating totals + nullable: true + type: number + example: 0 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + IdempotencyKey: + title: Idempotency Key + description: Idempotency Key is used to continue a process in case of any failure that might occur. + type: object + required: + - created_at + - id + - idempotency_key + - locked_at + - recovery_point + - response_code + - response_body + - request_method + - request_params + - request_path + properties: + id: + description: The idempotency key's ID + type: string + example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A + idempotency_key: + description: The unique randomly generated key used to determine the state of a process. + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: Date which the idempotency key was locked. + type: string + format: date-time + locked_at: + description: Date which the idempotency key was locked. + nullable: true + type: string + format: date-time + request_method: + description: The method of the request + nullable: true + type: string + example: POST + request_params: + description: The parameters passed to the request + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + request_path: + description: The request's path + nullable: true + type: string + example: /store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete + response_code: + description: The response's code. + nullable: true + type: string + example: 200 + response_body: + description: The response's body + nullable: true + type: object + example: + id: cart_01G8ZH853Y6TFXWPG5EYE81X63 + recovery_point: + description: Where to continue from. + type: string + default: started + Image: + title: Image + description: Images holds a reference to a URL at which the image file can be found. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - url + properties: + id: + type: string + description: The image's ID + example: img_01G749BFYR6T8JTVW6SGW3K3E6 + url: + description: The URL at which the image file can be found. + type: string + format: uri + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Invite: + title: Invite + description: Represents an invite + type: object + required: + - accepted + - created_at + - deleted_at + - expires_at + - id + - metadata + - role + - token + - updated_at + - user_email + properties: + id: + type: string + description: The invite's ID + example: invite_01G8TKE4XYCTHSCK2GDEP47RE1 + user_email: + description: The email of the user being invited. + type: string + format: email + role: + description: The user's role. + nullable: true + type: string + enum: + - admin + - member + - developer + default: member + accepted: + description: Whether the invite was accepted or not. + type: boolean + default: false + token: + description: The token used to accept the invite. + type: string + expires_at: + description: The date the invite expires at. + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemAdjustment: + title: Line Item Adjustment + description: Represents a Line Item Adjustment + type: object + required: + - amount + - description + - discount_id + - id + - item_id + - metadata + properties: + id: + description: The Line Item Adjustment's ID + type: string + example: lia_01G8TKE4XYCTHSCK2GDEP47RE1 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + description: + description: The line item's adjustment description + type: string + example: Adjusted item's price. + discount_id: + description: The ID of the discount associated with the adjustment + nullable: true + type: string + example: disc_01F0YESMW10MGHWJKZSDDMN0VN + discount: + description: Available if the relation `discount` is expanded. + nullable: true + $ref: '#/components/schemas/Discount' + amount: + description: The adjustment amount + type: integer + example: 1000 + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItemTaxLine: + title: Line Item Tax Line + description: Represents a Line Item Tax Line + type: object + required: + - code + - created_at + - id + - item_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + item_id: + description: The ID of the line item + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + LineItem: + title: Line Item + description: Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. + type: object + required: + - allow_discounts + - cart_id + - claim_order_id + - created_at + - description + - fulfilled_quantity + - has_shipping + - id + - is_giftcard + - is_return + - metadata + - order_edit_id + - order_id + - original_item_id + - quantity + - returned_quantity + - shipped_quantity + - should_merge + - swap_id + - thumbnail + - title + - unit_price + - updated_at + - variant_id + properties: + id: + description: The line item's ID + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + cart_id: + description: The ID of the Cart that the Line Item belongs to. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Line Item belongs to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Line Item belongs to. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + claim_order_id: + description: The id of the Claim that the Line Item belongs to. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemTaxLine' + adjustments: + description: Available if the relation `adjustments` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItemAdjustment' + original_item_id: + description: The id of the original line item + nullable: true + type: string + order_edit_id: + description: The ID of the order edit to which a cloned item belongs + nullable: true + type: string + order_edit: + description: The order edit joined. Available if the relation `order_edit` is expanded. + nullable: true + type: object + title: + description: The title of the Line Item, this should be easily identifiable by the Customer. + type: string + example: Medusa Coffee Mug + description: + description: A more detailed description of the contents of the Line Item. + nullable: true + type: string + example: One Size + thumbnail: + description: A URL string to a small image of the contents of the Line Item. + nullable: true + type: string + format: uri + example: https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png + is_return: + description: Is the item being returned + type: boolean + default: false + is_giftcard: + description: Flag to indicate if the Line Item is a Gift Card. + type: boolean + default: false + should_merge: + description: Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item. + type: boolean + default: true + allow_discounts: + description: Flag to indicate if the Line Item should be included when doing discount calculations. + type: boolean + default: true + has_shipping: + description: Flag to indicate if the Line Item has fulfillment associated with it. + nullable: true + type: boolean + example: false + unit_price: + description: The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to. + type: integer + example: 8000 + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true + $ref: '#/components/schemas/ProductVariant' + quantity: + description: The quantity of the content in the Line Item. + type: integer + example: 1 + fulfilled_quantity: + description: The quantity of the Line Item that has been fulfilled. + nullable: true + type: integer + example: 0 + returned_quantity: + description: The quantity of the Line Item that has been returned. + nullable: true + type: integer + example: 0 + shipped_quantity: + description: The quantity of the Line Item that has been shipped. + nullable: true + type: integer + example: 0 + refundable: + description: The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration. + type: integer + example: 0 + subtotal: + description: The subtotal of the line item + type: integer + example: 8000 + tax_total: + description: The total of tax of the line item + type: integer + example: 0 + total: + description: The total amount of the line item + type: integer + example: 8000 + original_total: + description: The original total amount of the line item + type: integer + example: 8000 + original_tax_total: + description: The original tax total amount of the line item + type: integer + example: 0 + discount_total: + description: The total of discount of the line item + type: integer + example: 0 + gift_card_total: + description: The total of the gift card of the line item + type: integer + example: 0 + includes_tax: + description: '[EXPERIMENTAL] Indicates if the line item unit_price include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + MoneyAmount: + title: Money Amount + description: Money Amounts represents an amount that a given Product Variant can be purcased for. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. + type: object + required: + - amount + - created_at + - currency_code + - deleted_at + - id + - max_quantity + - min_quantity + - price_list_id + - region_id + - updated_at + - variant_id + properties: + id: + description: The money amount's ID + type: string + example: ma_01F0YESHRFQNH5S8Q0PK84YYZN + currency_code: + description: The 3 character currency code that the Money Amount is given in. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount: + description: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. + type: integer + example: 100 + min_quantity: + description: The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. + nullable: true + type: integer + example: 1 + max_quantity: + description: The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. + nullable: true + type: integer + example: 1 + price_list_id: + description: The ID of the price list associated with the money amount + nullable: true + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + price_list: + description: Available if the relation `price_list` is expanded. + nullable: true + type: object + variant_id: + description: The id of the Product Variant contained in the Line Item. + nullable: true + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true + type: object + region_id: + description: The region's ID + nullable: true + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Note: + title: Note + description: Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. + type: object + required: + - author_id + - created_at + - deleted_at + - id + - metadata + - resource_id + - resource_type + - updated_at + - value + properties: + id: + description: The note's ID + type: string + example: note_01G8TM8ENBMC7R90XRR1G6H26Q + resource_type: + description: The type of resource that the Note refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Note refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + value: + description: The contents of the note. + type: string + example: This order must be fulfilled on Monday + author_id: + description: The ID of the author (user) + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + author: + description: Available if the relation `author` is expanded. + nullable: true + $ref: '#/components/schemas/User' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + NotificationProvider: + title: Notification Provider + description: Represents a notification provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the notification provider as given by the plugin. + type: string + example: sendgrid + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + Notification: + title: Notification + description: Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. + type: object + required: + - created_at + - customer_id + - data + - event_name + - id + - parent_id + - provider_id + - resource_type + - resource_id + - to + - updated_at + properties: + id: + description: The notification's ID + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + event_name: + description: The name of the event that the notification was sent for. + nullable: true + type: string + example: order.placed + resource_type: + description: The type of resource that the Notification refers to. + type: string + example: order + resource_id: + description: The ID of the resource that the Notification refers to. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + customer_id: + description: The ID of the Customer that the Notification was sent to. + nullable: true + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + $ref: '#/components/schemas/Customer' + to: + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id + type: string + example: user@example.com + data: + description: The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend. + type: object + example: {} + parent_id: + description: The notification's parent ID + nullable: true + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + parent_notification: + description: Available if the relation `parent_notification` is expanded. + nullable: true + type: object + resends: + description: The resends that have been completed after the original Notification. Available if the relation `resends` is expanded. + type: array + items: + type: object + provider_id: + description: The id of the Notification Provider that handles the Notification. + nullable: true + type: string + example: sengrid + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/NotificationProvider' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + OAuth: + title: OAuth + description: Represent an OAuth app + type: object + required: + - application_name + - data + - display_name + - id + - install_url + - uninstall_url + properties: + id: + description: The app's ID + type: string + example: example_app + display_name: + description: The app's display name + type: string + example: Example app + application_name: + description: The app's name + type: string + example: example + install_url: + description: The URL to install the app + nullable: true + type: string + format: uri + uninstall_url: + description: The URL to uninstall the app + nullable: true + type: string + format: uri + data: + description: Any data necessary to the app. + nullable: true + type: object + example: {} + OrderEdit: + title: Order Edit + description: Order edit keeps track of order items changes. + type: object + required: + - canceled_at + - canceled_by + - confirmed_by + - confirmed_at + - created_at + - created_by + - declined_at + - declined_by + - declined_reason + - id + - internal_note + - order_id + - payment_collection_id + - requested_at + - requested_by + - status + - updated_at + properties: + id: + description: The order edit's ID + type: string + example: oe_01G8TJSYT9M6AVS5N4EMNFS1EK + order_id: + description: The ID of the order that is edited + type: string + example: order_01G2SG30J8C85S4A5CHM2S1NS2 + order: + description: Available if the relation `order` is expanded. + nullable: true + type: object + changes: + description: Available if the relation `changes` is expanded. + type: array + items: + $ref: '#/components/schemas/OrderItemChange' + internal_note: + description: An optional note with additional details about the order edit. + nullable: true + type: string + example: Included two more items B to the order. + created_by: + description: The unique identifier of the user or customer who created the order edit. + type: string + requested_by: + description: The unique identifier of the user or customer who requested the order edit. + nullable: true + type: string + requested_at: + description: The date with timezone at which the edit was requested. + nullable: true + type: string + format: date-time + confirmed_by: + description: The unique identifier of the user or customer who confirmed the order edit. + nullable: true + type: string + confirmed_at: + description: The date with timezone at which the edit was confirmed. + nullable: true + type: string + format: date-time + declined_by: + description: The unique identifier of the user or customer who declined the order edit. + nullable: true + type: string + declined_at: + description: The date with timezone at which the edit was declined. + nullable: true + type: string + format: date-time + declined_reason: + description: An optional note why the order edit is declined. + nullable: true + type: string + canceled_by: + description: The unique identifier of the user or customer who cancelled the order edit. + nullable: true + type: string + canceled_at: + description: The date with timezone at which the edit was cancelled. + nullable: true + type: string + format: date-time + subtotal: + description: The total of subtotal + type: integer + example: 8000 + discount_total: + description: The total of discount + type: integer + example: 800 + shipping_total: + description: The total of the shipping amount + type: integer + example: 800 + gift_card_total: + description: The total of the gift card amount + type: integer + example: 800 + gift_card_tax_total: + description: The total of the gift card tax amount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + total: + description: The total amount of the edited order. + type: integer + example: 8200 + difference_due: + description: The difference between the total amount of the order and total amount of edited order. + type: integer + example: 8200 + status: + description: The status of the order edit. + type: string + enum: + - confirmed + - declined + - requested + - created + - canceled + items: + description: Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + payment_collection_id: + description: The ID of the payment collection + nullable: true + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + nullable: true + $ref: '#/components/schemas/PaymentCollection' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + OrderItemChange: + title: Order Item Change + description: Represents an order edit item change + type: object + required: + - created_at + - deleted_at + - id + - line_item_id + - order_edit_id + - original_line_item_id + - type + - updated_at + properties: + id: + description: The order item change's ID + type: string + example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The order item change's status + type: string + enum: + - item_add + - item_remove + - item_update + order_edit_id: + description: The ID of the order edit + type: string + example: oe_01G2SG30J8C85S4A5CHM2S1NS2 + order_edit: + description: Available if the relation `order_edit` is expanded. + nullable: true + type: object + original_line_item_id: + description: The ID of the original line item in the order + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + original_line_item: + description: Available if the relation `original_line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + line_item_id: + description: The ID of the cloned line item. + nullable: true + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + line_item: + description: Available if the relation `line_item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + Order: + title: Order + description: Represents an order + type: object + required: + - billing_address_id + - canceled_at + - cart_id + - created_at + - currency_code + - customer_id + - draft_order_id + - display_id + - email + - external_id + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - object + - payment_status + - region_id + - shipping_address_id + - status + - tax_rate + - updated_at + properties: + id: + description: The order's ID + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + status: + description: The order's status + type: string + enum: + - pending + - completed + - archived + - canceled + - requires_action + default: pending + fulfillment_status: + description: The order's fulfillment status + type: string + enum: + - not_fulfilled + - partially_fulfilled + - fulfilled + - partially_shipped + - shipped + - partially_returned + - returned + - canceled + - requires_action + default: not_fulfilled + payment_status: + description: The order's payment status + type: string + enum: + - not_paid + - awaiting + - captured + - partially_refunded + - refunded + - canceled + - requires_action + default: not_paid + display_id: + description: The order's display ID + type: integer + example: 2 + cart_id: + description: The ID of the cart associated with the order + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + customer_id: + description: The ID of the customer associated with the order + type: string + example: cus_01G2SG30J8C85S4A5CHM2S1NS2 + customer: + description: A customer object. Available if the relation `customer` is expanded. + nullable: true + type: object + email: + description: The email associated with the order + type: string + format: email + billing_address_id: + description: The ID of the billing address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + billing_address: + description: Available if the relation `billing_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_address_id: + description: The ID of the shipping address associated with the order + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character currency code that is used in the order + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The order's tax rate + nullable: true + type: number + example: 0 + discounts: + description: The discounts used in the order. Available if the relation `discounts` is expanded. + type: array + items: + $ref: '#/components/schemas/Discount' + gift_cards: + description: The gift cards used in the order. Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' + shipping_methods: + description: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + payments: + description: The payments used in the order. Available if the relation `payments` is expanded. + type: array + items: + type: object + fulfillments: + description: The fulfillments used in the order. Available if the relation `fulfillments` is expanded. + type: array + items: + type: object + returns: + description: The returns associated with the order. Available if the relation `returns` is expanded. + type: array + items: + type: object + claims: + description: The claims associated with the order. Available if the relation `claims` is expanded. + type: array + items: + type: object + refunds: + description: The refunds associated with the order. Available if the relation `refunds` is expanded. + type: array + items: + type: object + swaps: + description: The swaps associated with the order. Available if the relation `swaps` is expanded. + type: array + items: + type: object + draft_order_id: + description: The ID of the draft order this order is associated with. + nullable: true + type: string + example: null + draft_order: + description: A draft order object. Available if the relation `draft_order` is expanded. + nullable: true + type: object + items: + description: The line items that belong to the order. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + edits: + description: Order edits done on the order. Available if the relation `edits` is expanded. + type: array + items: + type: object + gift_card_transactions: + description: The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCardTransaction' + canceled_at: + description: The date the order was canceled on. + nullable: true + type: string + format: date-time + no_notification: + description: Flag for describing whether or not notifications related to this should be send. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the processing of the order in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + external_id: + description: The ID of an external order. + nullable: true + type: string + example: null + sales_channel_id: + description: The ID of the sales channel this order is associated with. + nullable: true + type: string + example: null + sales_channel: + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + shipping_total: + type: integer + description: The total of shipping + example: 1000 + discount_total: + description: The total of discount + type: integer + example: 800 + tax_total: + description: The total of tax + type: integer + example: 0 + refunded_total: + description: The total amount refunded if the order is returned. + type: integer + example: 0 + total: + description: The total amount of the order + type: integer + example: 8200 + subtotal: + description: The subtotal of the order + type: integer + example: 8000 + paid_total: + description: The total amount paid + type: integer + example: 8000 + refundable_amount: + description: The amount that can be refunded + type: integer + example: 8200 + gift_card_total: + description: The total of gift cards + type: integer + example: 0 + gift_card_tax_total: + description: The total of gift cards with taxes + type: integer + example: 0 + returnable_items: + description: The items that are returnable as part of the order, order swaps or order claims + type: array + items: + $ref: '#/components/schemas/LineItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentCollection: + title: Payment Collection + description: Payment Collection + type: object + required: + - amount + - authorized_amount + - created_at + - created_by + - currency_code + - deleted_at + - description + - id + - metadata + - region_id + - status + - type + - updated_at + properties: + id: + description: The payment collection's ID + type: string + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + description: The type of the payment collection + type: string + enum: + - order_edit + status: + description: The type of the payment collection + type: string + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - canceled + description: + description: Description of the payment collection + nullable: true + type: string + amount: + description: Amount of the payment collection. + type: integer + authorized_amount: + description: Authorized amount of the payment collection. + nullable: true + type: integer + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + nullable: true + $ref: '#/components/schemas/Region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + payment_sessions: + description: Available if the relation `payment_sessions` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentSession' + payments: + description: Available if the relation `payments` is expanded. + type: array + items: + $ref: '#/components/schemas/Payment' + created_by: + description: The ID of the user that created the payment collection. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PaymentProvider: + title: Payment Provider + description: Represents a Payment Provider plugin and holds its installation status. + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the payment provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + PaymentSession: + title: Payment Session + description: Payment Sessions are created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, who is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. + type: object + required: + - amount + - cart_id + - created_at + - data + - id + - is_initiated + - is_selected + - idempotency_key + - payment_authorized_at + - provider_id + - status + - updated_at + properties: + id: + description: The payment session's ID + type: string + example: ps_01G901XNSRM2YS3ASN9H5KG3FZ + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + $ref: '#/components/schemas/Cart' + provider_id: + description: The id of the Payment Provider that is responsible for the Payment Session + type: string + example: manual + is_selected: + description: A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase. + nullable: true + type: boolean + example: true + is_initiated: + description: A flag to indicate if a communication with the third party provider has been initiated. + type: boolean + default: false + example: true + status: + description: Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer. + type: string + enum: + - authorized + - pending + - requires_more + - error + - canceled + example: pending + data: + description: The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. + type: object + example: {} + idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + amount: + description: The amount that the Payment Session has been authorized for. + nullable: true + type: integer + example: 100 + payment_authorized_at: + description: The date with timezone at which the Payment Session was authorized. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + Payment: + title: Payment + description: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. + type: object + required: + - amount + - amount_refunded + - canceled_at + - captured_at + - cart_id + - created_at + - currency_code + - data + - id + - idempotency_key + - metadata + - order_id + - provider_id + - swap_id + - updated_at + properties: + id: + description: The payment's ID + type: string + example: pay_01G2SJNT6DEEWDFNAJ4XWDTHKE + swap_id: + description: The ID of the Swap that the Payment is used for. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + cart_id: + description: The id of the Cart that the Payment Session is created for. + nullable: true + type: string + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Payment is used for. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + amount: + description: The amount that the Payment has been authorized for. + type: integer + example: 100 + currency_code: + description: The 3 character ISO currency code that the Payment is completed in. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + amount_refunded: + description: The amount of the original Payment amount that has been refunded back to the Customer. + type: integer + default: 0 + example: 0 + provider_id: + description: The id of the Payment Provider that is responsible for the Payment + type: string + example: manual + data: + description: The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. + type: object + example: {} + captured_at: + description: The date with timezone at which the Payment was captured. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Payment was canceled. + nullable: true + type: string + format: date-time + idempotency_key: + description: Randomly generated key used to continue the completion of a payment in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PriceList: + title: Price List + description: Price Lists represents a set of prices that overrides the default price for one or more product variants. + type: object + required: + - created_at + - deleted_at + - description + - ends_at + - id + - name + - starts_at + - status + - type + - updated_at + properties: + id: + description: The price list's ID + type: string + example: pl_01G8X3CKJXCG5VXVZ87H9KC09W + name: + description: The price list's name + type: string + example: VIP Prices + description: + description: The price list's description + type: string + example: Prices for VIP customers + type: + description: The type of Price List. This can be one of either `sale` or `override`. + type: string + enum: + - sale + - override + default: sale + status: + description: The status of the Price List + type: string + enum: + - active + - draft + default: draft + starts_at: + description: The date with timezone that the Price List starts being valid. + nullable: true + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + nullable: true + type: string + format: date-time + customer_groups: + description: The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded. + type: array + items: + $ref: '#/components/schemas/CustomerGroup' + prices: + description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + includes_tax: + description: '[EXPERIMENTAL] Does the price list prices include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductCategory: + title: ProductCategory + description: Represents a product category + x-resourceId: ProductCategory + type: object + required: + - category_children + - created_at + - deleted_at + - handle + - id + - is_active + - is_internal + - mpath + - name + - parent_category_id + - updated_at + properties: + id: + description: The product category's ID + type: string + example: pcat_01G2SG30J8C85S4A5CHM2S1NS2 + name: + description: The product category's name + type: string + example: Regular Fit + handle: + description: A unique string that identifies the Product Category - can for example be used in slug structures. + type: string + example: regular-fit + mpath: + description: A string for Materialized Paths - used for finding ancestors and descendents + nullable: true + type: string + example: pcat_id1.pcat_id2.pcat_id3 + is_internal: + type: boolean + description: A flag to make product category an internal category for admins + default: false + is_active: + type: boolean + description: A flag to make product category visible/hidden in the store front + default: false + category_children: + description: Available if the relation `category_children` are expanded. + type: array + items: + type: object + parent_category_id: + description: The ID of the parent category. + nullable: true + type: string + default: null + parent_category: + description: A product category object. Available if the relation `parent_category` is expanded. + nullable: true + type: object + products: + description: Products associated with category. Available if the relation `products` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductCollection: + title: Product Collection + description: Product Collections represents a group of Products that are related. + type: object + required: + - created_at + - deleted_at + - handle + - id + - metadata + - title + - updated_at + properties: + id: + description: The product collection's ID + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + title: + description: The title that the Product Collection is identified by. + type: string + example: Summer Collection + handle: + description: A unique string that identifies the Product Collection - can for example be used in slug structures. + nullable: true + type: string + example: summer-collection + products: + description: The Products contained in the Product Collection. Available if the relation `products` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOptionValue: + title: Product Option Value + description: A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - option_id + - updated_at + - value + - variant_id + properties: + id: + description: The product option value's ID + type: string + example: optval_01F0YESHR7S6ECD03RF6W12DSJ + value: + description: The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is \"Size\" this value could be `Small`, `Medium` or `Large`). + type: string + example: large + option_id: + description: The ID of the Product Option that the Product Option Value is defined for. + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + option: + description: Available if the relation `option` is expanded. + nullable: true + type: object + variant_id: + description: The ID of the Product Variant that the Product Option Value is defined for. + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + variant: + description: Available if the relation `variant` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductOption: + title: Product Option + description: Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - product_id + - title + - updated_at + properties: + id: + description: The product option's ID + type: string + example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 + title: + description: The title that the Product Option is defined by (e.g. `Size`). + type: string + example: Size + values: + description: The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + product_id: + description: The ID of the Product that the Product Option is defined for. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTag: + title: Product Tag + description: Product Tags can be added to Products for easy filtering and grouping. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product tag's ID + type: string + example: ptag_01G8K2MTMG9168F2B70S1TAVK3 + value: + description: The value that the Product Tag represents + type: string + example: Pants + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTaxRate: + title: Product Tax Rate + description: Associates a tax rate with a product to indicate that the product is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_id + - rate_id + - updated_at + properties: + product_id: + description: The ID of the Product + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: Available if the relation `product` is expanded. + nullable: true + $ref: '#/components/schemas/Product' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductTypeTaxRate: + title: Product Type Tax Rate + description: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way + type: object + required: + - created_at + - metadata + - product_type_id + - rate_id + - updated_at + properties: + product_type_id: + description: The ID of the Product type + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + product_type: + description: Available if the relation `product_type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + rate_id: + description: The id of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductType: + title: Product Type + description: Product Type can be added to Products for filtering and reporting purposes. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - updated_at + - value + properties: + id: + description: The product type's ID + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + value: + description: The value that the Product Type represents. + type: string + example: Clothing + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ProductVariantInventoryItem: + title: Product Variant Inventory Item + description: Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant. + type: object + required: + - created_at + - deleted_at + - id + - inventory_item_id + - required_quantity + - updated_at + - variant_id + properties: + id: + description: The product variant inventory item's ID + type: string + example: pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A + inventory_item_id: + description: The id of the inventory item + type: string + variant_id: + description: The id of the variant. + type: string + variant: + description: A ProductVariant object. Available if the relation `variant` is expanded. + nullable: true + type: object + required_quantity: + description: The quantity of an inventory item required for one quantity of the variant. + type: integer + default: 1 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ProductVariant: + title: Product Variant + description: Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. + type: object + required: + - allow_backorder + - barcode + - created_at + - deleted_at + - ean + - height + - hs_code + - id + - inventory_quantity + - length + - manage_inventory + - material + - metadata + - mid_code + - origin_country + - product_id + - sku + - title + - upc + - updated_at + - weight + - width + properties: + id: + description: The product variant's ID + type: string + example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 + title: + description: A title that can be displayed for easy identification of the Product Variant. + type: string + example: Small + product_id: + description: The ID of the Product that the Product Variant belongs to. + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + product: + description: A product object. Available if the relation `product` is expanded. + nullable: true + type: object + prices: + description: The Money Amounts defined for the Product Variant. Each Money Amount represents a price in a given currency or a price in a specific Region. Available if the relation `prices` is expanded. + type: array + items: + $ref: '#/components/schemas/MoneyAmount' + sku: + description: The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems. + nullable: true + type: string + example: shirt-123 + barcode: + description: A generic field for a GTIN number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + ean: + description: An EAN barcode number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + upc: + description: A UPC barcode number that can be used to identify the Product Variant. + nullable: true + type: string + example: null + variant_rank: + description: The ranking of this variant + nullable: true + type: number + default: 0 + inventory_quantity: + description: The current quantity of the item that is stocked. + type: integer + example: 100 + allow_backorder: + description: Whether the Product Variant should be purchasable when `inventory_quantity` is 0. + type: boolean + default: false + manage_inventory: + description: Whether Medusa should manage inventory for the Product Variant. + type: boolean + default: true + hs_code: + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + origin_country: + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + weight: + description: The weight of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + length: + description: The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: The height of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + width: + description: The width of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + options: + description: The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOptionValue' + inventory_items: + description: The Inventory Items related to the product variant. Available if the relation `inventory_items` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariantInventoryItem' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Product: + title: Product + description: Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. + type: object + required: + - collection_id + - created_at + - deleted_at + - description + - discountable + - external_id + - handle + - height + - hs_code + - id + - is_giftcard + - length + - material + - metadata + - mid_code + - origin_country + - profile_id + - status + - subtitle + - type_id + - thumbnail + - title + - updated_at + - weight + - width + properties: + id: + description: The product's ID + type: string + example: prod_01G1G5V2MBA328390B5AXJ610F + title: + description: A title that can be displayed for easy identification of the Product. + type: string + example: Medusa Coffee Mug + subtitle: + description: An optional subtitle that can be used to further specify the Product. + nullable: true + type: string + description: + description: A short description of the Product. + nullable: true + type: string + example: Every programmer's best friend. + handle: + description: A unique identifier for the Product (e.g. for slug structure). + nullable: true + type: string + example: coffee-mug + is_giftcard: + description: Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased. + type: boolean + default: false + status: + description: The status of the product + type: string + enum: + - draft + - proposed + - published + - rejected + default: draft + images: + description: Images of the Product. Available if the relation `images` is expanded. + type: array + items: + $ref: '#/components/schemas/Image' + thumbnail: + description: A URL to an image file that can be used to identify the Product. + nullable: true + type: string + format: uri + options: + description: The Product Options that are defined for the Product. Product Variants of the Product will have a unique combination of Product Option Values. Available if the relation `options` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductOption' + variants: + description: The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. Available if the relation `variants` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductVariant' + categories: + description: The product's associated categories. Available if the relation `categories` are expanded. + type: array + items: + $ref: '#/components/schemas/ProductCategory' + profile_id: + description: The ID of the Shipping Profile that the Product belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + weight: + description: The weight of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + length: + description: The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: The height of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + width: + description: The width of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + hs_code: + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + origin_country: + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + material: + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true + type: string + example: null + collection_id: + description: The Product Collection that the Product belongs to + nullable: true + type: string + example: pcol_01F0YESBFAZ0DV6V831JXWH0BG + collection: + description: A product collection object. Available if the relation `collection` is expanded. + nullable: true + $ref: '#/components/schemas/ProductCollection' + type_id: + description: The Product type that the Product belongs to + nullable: true + type: string + example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A + type: + description: Available if the relation `type` is expanded. + nullable: true + $ref: '#/components/schemas/ProductType' + tags: + description: The Product Tags assigned to the Product. Available if the relation `tags` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductTag' + discountable: + description: Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`. + type: boolean + default: true + external_id: + description: The external ID of the product + nullable: true + type: string + example: null + sales_channels: + description: The sales channels the product is associated with. Available if the relation `sales_channels` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + PublishableApiKeySalesChannel: + title: Publishable API key sales channel + description: Holds mapping between Publishable API keys and Sales Channels + type: object + required: + - publishable_key_id + - sales_channel_id + properties: + sales_channel_id: + description: The sales channel's ID + type: string + example: sc_01G1G5V21KADXNGH29BJMAJ4B4 + publishable_key_id: + description: The publishable API key's ID + type: string + example: pak_01G1G5V21KADXNGH29BJMAJ4B4 + PublishableApiKey: + title: Publishable API key + description: Publishable API key defines scopes (i.e. resources) that are available within a request. + type: object + required: + - created_at + - created_by + - id + - revoked_by + - revoked_at + - title + - updated_at + properties: + id: + description: The key's ID + type: string + example: pk_01G1G5V27GYX4QXNARRQCW1N8T + created_by: + description: The unique identifier of the user that created the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_by: + description: The unique identifier of the user that revoked the key. + nullable: true + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_at: + description: The date with timezone at which the key was revoked. + nullable: true + type: string + format: date-time + title: + description: The key's title. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + Refund: + title: Refund + description: Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. + type: object + required: + - amount + - created_at + - id + - idempotency_key + - metadata + - note + - order_id + - payment_id + - reason + - updated_at + properties: + id: + description: The refund's ID + type: string + example: ref_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Refund is related to. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object + amount: + description: The amount that has be refunded to the Customer. + type: integer + example: 1000 + note: + description: An optional note explaining why the amount was refunded. + nullable: true + type: string + example: I didn't like it + reason: + description: The reason given for the Refund, will automatically be set when processed as part of a Swap, Claim or Return. + type: string + enum: + - discount + - return + - swap + - claim + - other + example: return + idempotency_key: + description: Randomly generated key used to continue the completion of the refund in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Region: + title: Region + description: Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. + type: object + required: + - automatic_taxes + - created_at + - currency_code + - deleted_at + - gift_cards_taxable + - id + - metadata + - name + - tax_code + - tax_provider_id + - tax_rate + - updated_at + properties: + id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + name: + description: The name of the region as displayed to the customer. If the Region only has one country it is recommended to write the country name. + type: string + example: EU + currency_code: + description: The 3 character currency code that the Region uses. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + tax_rate: + description: The tax rate that should be charged on purchases in the Region. + type: number + example: 0 + tax_rates: + description: The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded. + type: array + items: + $ref: '#/components/schemas/TaxRate' + tax_code: + description: The tax code used on purchases in the Region. This may be used by other systems for accounting purposes. + nullable: true + type: string + example: null + gift_cards_taxable: + description: Whether the gift cards are taxable or not in this region. + type: boolean + default: true + automatic_taxes: + description: Whether taxes should be automated in this region. + type: boolean + default: true + countries: + description: The countries that are included in the Region. Available if the relation `countries` is expanded. + type: array + items: + $ref: '#/components/schemas/Country' + tax_provider_id: + description: The ID of the tax provider used in this region + nullable: true + type: string + example: null + tax_provider: + description: Available if the relation `tax_provider` is expanded. + nullable: true + $ref: '#/components/schemas/TaxProvider' + payment_providers: + description: The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/PaymentProvider' + fulfillment_providers: + description: The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `fulfillment_providers` is expanded. + type: array + items: + $ref: '#/components/schemas/FulfillmentProvider' + includes_tax: + description: '[EXPERIMENTAL] Does the prices for the region include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnItem: + title: Return Item + description: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. + type: object + required: + - is_requested + - item_id + - metadata + - note + - quantity + - reason_id + - received_quantity + - requested_quantity + - return_id + properties: + return_id: + description: The id of the Return that the Return Item belongs to. + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + item_id: + description: The id of the Line Item that the Return Item references. + type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + return_order: + description: Available if the relation `return_order` is expanded. + nullable: true + type: object + item: + description: Available if the relation `item` is expanded. + nullable: true + $ref: '#/components/schemas/LineItem' + quantity: + description: The quantity of the Line Item that is included in the Return. + type: integer + example: 1 + is_requested: + description: Whether the Return Item was requested initially or received unexpectedly in the warehouse. + type: boolean + default: true + requested_quantity: + description: The quantity that was originally requested to be returned. + nullable: true + type: integer + example: 1 + received_quantity: + description: The quantity that was received in the warehouse. + nullable: true + type: integer + example: 1 + reason_id: + description: The ID of the reason for returning the item. + nullable: true + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + reason: + description: Available if the relation `reason` is expanded. + nullable: true + $ref: '#/components/schemas/ReturnReason' + note: + description: An optional note with additional details about the Return. + nullable: true + type: string + example: I didn't like it. + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ReturnReason: + title: Return Reason + description: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. + type: object + required: + - created_at + - deleted_at + - description + - id + - label + - metadata + - parent_return_reason_id + - updated_at + - value + properties: + id: + description: The return reason's ID + type: string + example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ + value: + description: The value to identify the reason by. + type: string + example: damaged + label: + description: A text that can be displayed to the Customer as a reason. + type: string + example: Damaged goods + description: + description: A description of the Reason. + nullable: true + type: string + example: Items that are damaged + parent_return_reason_id: + description: The ID of the parent reason. + nullable: true + type: string + example: null + parent_return_reason: + description: Available if the relation `parent_return_reason` is expanded. + nullable: true + type: object + return_reason_children: + description: Available if the relation `return_reason_children` is expanded. + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Return: + title: Return + description: Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. + type: object + required: + - claim_order_id + - created_at + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - received_at + - refund_amount + - shipping_data + - status + - swap_id + - updated_at + properties: + id: + description: The return's ID + type: string + example: ret_01F0YET7XPCMF8RZ0Y151NZV2V + status: + description: Status of the Return. + type: string + enum: + - requested + - received + - requires_action + - canceled + default: requested + items: + description: The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded. + type: array + items: + $ref: '#/components/schemas/ReturnItem' + swap_id: + description: The ID of the Swap that the Return is a part of. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + claim_order_id: + description: The ID of the Claim that the Return is a part of. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Return is made from. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + shipping_method: + description: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingMethod' + shipping_data: + description: Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment. + nullable: true + type: object + example: {} + location_id: + description: The id of the stock location the return will be added back. + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK + refund_amount: + description: The amount that should be refunded as a result of the return. + type: integer + example: 1000 + no_notification: + description: When set to true, no notification will be sent related to this return. + nullable: true + type: boolean + example: false + idempotency_key: + description: Randomly generated key used to continue the completion of the return in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + received_at: + description: The date with timezone at which the return was received. + nullable: true + type: string + format: date-time + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + SalesChannelLocation: + title: Sales Channel Stock Location + description: Sales Channel Stock Location link sales channels with stock locations. + type: object + required: + - created_at + - deleted_at + - id + - location_id + - sales_channel_id + - updated_at + properties: + id: + description: The Sales Channel Stock Location's ID + type: string + example: scloc_01G8X9A7ESKAJXG2H0E6F1MW7A + sales_channel_id: + description: The id of the Sales Channel + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + location_id: + description: The id of the Location Stock. + type: string + sales_channel: + description: The sales channel the location is associated with. Available if the relation `sales_channel` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + SalesChannel: + title: Sales Channel + description: A Sales Channel + type: object + required: + - created_at + - deleted_at + - description + - id + - is_disabled + - name + - updated_at + properties: + id: + description: The sales channel's ID + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + name: + description: The name of the sales channel. + type: string + example: Market + description: + description: The description of the sales channel. + nullable: true + type: string + example: Multi-vendor market + is_disabled: + description: Specify if the sales channel is enabled or disabled. + type: boolean + default: false + locations: + description: The Stock Locations related to the sales channel. Available if the relation `locations` is expanded. + type: array + items: + $ref: '#/components/schemas/SalesChannelLocation' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingMethodTaxLine: + title: Shipping Method Tax Line + description: Shipping Method Tax Line + type: object + required: + - code + - created_at + - id + - shipping_method_id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The line item tax line's ID + type: string + example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + shipping_method_id: + description: The ID of the line item + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_method: + description: Available if the relation `shipping_method` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingMethod: + title: Shipping Method + description: Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. + type: object + required: + - cart_id + - claim_order_id + - data + - id + - order_id + - price + - return_id + - shipping_option_id + - swap_id + properties: + id: + description: The shipping method's ID + type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_option_id: + description: The id of the Shipping Option that the Shipping Method is built from. + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + order_id: + description: The id of the Order that the Shipping Method is used on. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + claim_order_id: + description: The id of the Claim that the Shipping Method is used on. + nullable: true + type: string + example: null + claim_order: + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + cart_id: + description: The id of the Cart that the Shipping Method is used on. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Shipping Method is used on. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + return_id: + description: The id of the Return that the Shipping Method is used on. + nullable: true + type: string + example: null + return_order: + description: A return object. Available if the relation `return_order` is expanded. + nullable: true + type: object + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + tax_lines: + description: Available if the relation `tax_lines` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethodTaxLine' + price: + description: The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of. + type: integer + example: 200 + data: + description: Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' + type: boolean + default: false + subtotal: + description: The subtotal of the shipping + type: integer + example: 8000 + total: + description: The total amount of the shipping + type: integer + example: 8200 + tax_total: + description: The total of tax + type: integer + example: 0 + ShippingOptionRequirement: + title: Shipping Option Requirement + description: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. + type: object + required: + - amount + - deleted_at + - id + - shipping_option_id + - type + properties: + id: + description: The shipping option requirement's ID + type: string + example: sor_01G1G5V29AB4CTNDRFSRWSRKWD + shipping_option_id: + description: The id of the Shipping Option that the hipping option requirement belongs to + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + type: object + type: + description: The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available. + type: string + enum: + - min_subtotal + - max_subtotal + example: min_subtotal + amount: + description: The amount to compare the Cart subtotal to. + type: integer + example: 100 + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + ShippingOption: + title: Shipping Option + description: Shipping Options represent a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. + type: object + required: + - admin_only + - amount + - created_at + - data + - deleted_at + - id + - is_return + - metadata + - name + - price_type + - profile_id + - provider_id + - region_id + - updated_at + properties: + id: + description: The shipping option's ID + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + name: + description: The name given to the Shipping Option - this may be displayed to the Customer. + type: string + example: PostFake Standard + region_id: + description: The region's ID + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + profile_id: + description: The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + profile: + description: Available if the relation `profile` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingProfile' + provider_id: + description: The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option. + type: string + example: manual + provider: + description: Available if the relation `provider` is expanded. + nullable: true + $ref: '#/components/schemas/FulfillmentProvider' + price_type: + description: The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations. + type: string + enum: + - flat_rate + - calculated + example: flat_rate + amount: + description: The amount to charge for shipping when the Shipping Option price type is `flat_rate`. + nullable: true + type: integer + example: 200 + is_return: + description: Flag to indicate if the Shipping Option can be used for Return shipments. + type: boolean + default: false + admin_only: + description: Flag to indicate if the Shipping Option usage is restricted to admin users. + type: boolean + default: false + requirements: + description: The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingOptionRequirement' + data: + description: The data needed for the Fulfillment Provider to identify the Shipping Option. + type: object + example: {} + includes_tax: + description: '[EXPERIMENTAL] Does the shipping option price include tax' + type: boolean + default: false + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingProfile: + title: Shipping Profile + description: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. + type: object + required: + - created_at + - deleted_at + - id + - metadata + - name + - type + - updated_at + properties: + id: + description: The shipping profile's ID + type: string + example: sp_01G1G5V239ENSZ5MV4JAR737BM + name: + description: The name given to the Shipping profile - this may be displayed to the Customer. + type: string + example: Default Shipping Profile + type: + description: The type of the Shipping Profile, may be `default`, `gift_card` or `custom`. + type: string + enum: + - default + - gift_card + - custom + example: default + products: + description: The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. + type: array + items: + type: object + shipping_options: + description: The Shipping Options that can be used to fulfill the Products in the Shipping Profile. Available if the relation `shipping_options` is expanded. + type: array + items: + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + ShippingTaxRate: + title: Shipping Tax Rate + description: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way + type: object + required: + - created_at + - metadata + - rate_id + - shipping_option_id + - updated_at + properties: + shipping_option_id: + description: The ID of the Shipping Option + type: string + example: so_01G1G5V27GYX4QXNARRQCW1N8T + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' + rate_id: + description: The ID of the Tax Rate + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + tax_rate: + description: Available if the relation `tax_rate` is expanded. + nullable: true + $ref: '#/components/schemas/TaxRate' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + StagedJob: + title: Staged Job + description: A staged job resource + type: object + required: + - data + - event_name + - id + - options + properties: + id: + description: The staged job's ID + type: string + example: job_01F0YET7BZTARY9MKN1SJ7AAXF + event_name: + description: The name of the event + type: string + example: order.placed + data: + description: Data necessary for the job + type: object + example: {} + option: + description: The staged job's option + type: object + example: {} + Store: + title: Store + description: Holds settings for the Store, such as name, currencies, etc. + type: object + required: + - created_at + - default_currency_code + - default_location_id + - id + - invite_link_template + - metadata + - name + - payment_link_template + - swap_link_template + - updated_at + properties: + id: + description: The store's ID + type: string + example: store_01G1G5V21KADXNGH29BJMAJ4B4 + name: + description: The name of the Store - this may be displayed to the Customer. + type: string + example: Medusa Store + default_currency_code: + description: The 3 character currency code that is the default of the store. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + default_currency: + description: Available if the relation `default_currency` is expanded. + nullable: true + $ref: '#/components/schemas/Currency' + currencies: + description: The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. + type: array + items: + $ref: '#/components/schemas/Currency' + swap_link_template: + description: A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link. + nullable: true + type: string + example: null + payment_link_template: + description: A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link. + nullable: true + type: string + example: null + invite_link_template: + description: A template to generate Invite links from + nullable: true + type: string + example: null + default_location_id: + description: The location ID the store is associated with. + nullable: true + type: string + example: null + default_sales_channel_id: + description: The sales channel ID the cart is associated with. + nullable: true + type: string + example: null + default_sales_channel: + description: A sales channel object. Available if the relation `default_sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + Swap: + title: Swap + description: Swaps can be created when a Customer wishes to exchange Products that they have purchased to different Products. Swaps consist of a Return of previously purchased Products and a Fulfillment of new Products, the amount paid for the Products being returned will be used towards payment for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. + type: object + required: + - allow_backorder + - canceled_at + - cart_id + - confirmed_at + - created_at + - deleted_at + - difference_due + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - order_id + - payment_status + - shipping_address_id + - updated_at + properties: + id: + description: The swap's ID + type: string + example: swap_01F0YET86Y9G92D3YDR9Y6V676 + fulfillment_status: + description: The status of the Fulfillment of the Swap. + type: string + enum: + - not_fulfilled + - fulfilled + - shipped + - partially_shipped + - canceled + - requires_action + example: not_fulfilled + payment_status: + description: The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount. + type: string + enum: + - not_paid + - awaiting + - captured + - confirmed + - canceled + - difference_refunded + - partially_refunded + - refunded + - requires_action + example: not_paid + order_id: + description: The ID of the Order where the Line Items to be returned where purchased. + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + additional_items: + description: The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded. + type: array + items: + $ref: '#/components/schemas/LineItem' + return_order: + description: A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded. + nullable: true + type: object + fulfillments: + description: The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded. + type: array + items: + type: object + payment: + description: The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. + nullable: true + type: object + difference_due: + description: The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products. + nullable: true + type: integer + example: 0 + shipping_address_id: + description: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. + nullable: true + type: string + example: addr_01G8ZH853YPY9B94857DY91YGW + shipping_address: + description: Available if the relation `shipping_address` is expanded. + nullable: true + $ref: '#/components/schemas/Address' + shipping_methods: + description: The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. + type: array + items: + $ref: '#/components/schemas/ShippingMethod' + cart_id: + description: The id of the Cart that the Customer will use to confirm the Swap. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + confirmed_at: + description: The date with timezone at which the Swap was confirmed by the Customer. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + nullable: true + type: string + format: date-time + no_notification: + description: If set to true, no notification will be sent related to this swap + nullable: true + type: boolean + example: false + allow_backorder: + description: If true, swaps can be completed with items out of stock + type: boolean + default: false + idempotency_key: + description: Randomly generated key used to continue the completion of the swap in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxLine: + title: Tax Line + description: Line item that specifies an amount of tax to add to a line item. + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - updated_at + properties: + id: + description: The tax line's ID + type: string + example: tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + rate: + description: The numeric rate to charge tax by + type: number + example: 10 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TaxProvider: + title: Tax Provider + description: The tax service used to calculate taxes + type: object + required: + - id + - is_installed + properties: + id: + description: The id of the tax provider as given by the plugin. + type: string + example: manual + is_installed: + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. + type: boolean + default: true + TaxRate: + title: Tax Rate + description: A Tax Rate can be used to associate a certain rate to charge on products within a given Region + type: object + required: + - code + - created_at + - id + - metadata + - name + - rate + - region_id + - updated_at + properties: + id: + description: The tax rate's ID + type: string + example: txr_01G8XDBAWKBHHJRKH0AV02KXBR + rate: + description: The numeric rate to charge + nullable: true + type: number + example: 10 + code: + description: A code to identify the tax type by + nullable: true + type: string + example: tax01 + name: + description: A human friendly name for the tax + type: string + example: Tax Example + region_id: + description: The id of the Region that the rate belongs to + type: string + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: A region object. Available if the relation `region` is expanded. + nullable: true + type: object + products: + description: The products that belong to this tax rate. Available if the relation `products` is expanded. + type: array + items: + $ref: '#/components/schemas/Product' + product_types: + description: The product types that belong to this tax rate. Available if the relation `product_types` is expanded. + type: array + items: + $ref: '#/components/schemas/ProductType' + shipping_options: + type: array + description: The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. + items: + $ref: '#/components/schemas/ShippingOption' + product_count: + description: The count of products + type: integer + example: 10 + product_type_count: + description: The count of product types + type: integer + example: 2 + shipping_option_count: + description: The count of shipping options + type: integer + example: 1 + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + TrackingLink: + title: Tracking Link + description: Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. + type: object + required: + - created_at + - deleted_at + - fulfillment_id + - id + - idempotency_key + - metadata + - tracking_number + - updated_at + - url + properties: + id: + description: The tracking link's ID + type: string + example: tlink_01G8ZH853Y6TFXWPG5EYE81X63 + url: + description: The URL at which the status of the shipment can be tracked. + nullable: true + type: string + format: uri + tracking_number: + description: The tracking number given by the shipping carrier. + type: string + format: RH370168054CN + fulfillment_id: + description: The id of the Fulfillment that the Tracking Link references. + type: string + example: ful_01G8ZRTMQCA76TXNAT81KPJZRF + fulfillment: + description: Available if the relation `fulfillment` is expanded. + nullable: true + type: object + idempotency_key: + description: Randomly generated key used to continue the completion of a process in case of failure. + nullable: true + type: string + externalDocs: + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + description: Learn more how to use the idempotency key. + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + User: + title: User + description: Represents a User who can manage store settings. + type: object + required: + - api_token + - created_at + - deleted_at + - email + - first_name + - id + - last_name + - metadata + - role + - updated_at + properties: + id: + description: The user's ID + type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + role: + description: The user's role + type: string + enum: + - admin + - member + - developer + default: member + email: + description: The email of the User + type: string + format: email + first_name: + description: The first name of the User + nullable: true + type: string + example: Levi + last_name: + description: The last name of the User + nullable: true + type: string + example: Bogan + api_token: + description: An API token associated with the user. + nullable: true + type: string + example: null + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + material: + description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + weight: + description: The weight of the Inventory Item. May be used in shipping rate calculations. + type: number + height: + description: The height of the Inventory Item. May be used in shipping rate calculations. + type: number + width: + description: The width of the Inventory Item. May be used in shipping rate calculations. + type: number + length: + description: The length of the Inventory Item. May be used in shipping rate calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + ReservationItemDTO: + title: Reservation item + description: Represents a reservation of an inventory item at a stock location + type: object + required: + - id + - location_id + - inventory_item_id + - quantity + properties: + id: + description: The id of the reservation item + type: string + location_id: + description: The id of the location of the reservation + type: string + inventory_item_id: + description: The id of the inventory item the reservation relates to + type: string + quantity: + description: The id of the reservation item + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + reserved_quantity: + description: the reserved stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + PricedVariant: + title: Priced Product Variant + type: object + allOf: + - $ref: '#/components/schemas/ProductVariant' + - type: object + properties: + original_price: + type: number + description: The original price of the variant without any discounted prices applied. + calculated_price: + type: number + description: The calculated price of the variant. Can be a discounted price. + original_price_incl_tax: + type: number + description: The original price of the variant including taxes. + calculated_price_incl_tax: + type: number + description: The calculated price of the variant including taxes. + original_tax: + type: number + description: The taxes applied on the original price. + calculated_tax: + type: number + description: The taxes applied on the calculated price. + tax_rates: + type: array + description: An array of applied tax rates + items: + type: object + properties: + rate: + type: number + description: The tax rate value + name: + type: string + description: The name of the tax rate + code: + type: string + description: The code of the tax rate + PricedProduct: + title: Priced Product + type: object + allOf: + - $ref: '#/components/schemas/Product' + - type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + StockLocationAddressDTO: + title: Stock Location Address + description: Represents a Stock Location Address + type: object + required: + - address_1 + - country_code + - created_at + - updated_at + properties: + id: + type: string + description: The stock location address' ID + example: laddr_51G4ZW853Y6TFXWPG5ENJ81X42 + address_1: + type: string + description: Stock location address + example: 35, Jhon Doe Ave + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + StockLocationDTO: + title: Stock Location + description: Represents a Stock Location + type: object + required: + - id + - name + - address_id + - created_at + - updated_at + properties: + id: + type: string + description: The stock location's ID + example: sloc_51G4ZW853Y6TFXWPG5ENJ81X42 + address_id: + type: string + description: Stock location address' ID + example: laddr_05B2ZE853Y6FTXWPW85NJ81A44 + name: + type: string + description: The name of the stock location + example: Main Warehouse + address: + description: The Address of the Stock Location + allOf: + - $ref: '#/components/schemas/StockLocationAddressDTO' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + StockLocationAddressInput: + title: Stock Location Address Input + description: Represents a Stock Location Address Input + type: object + required: + - address_1 + - country_code + properties: + address_1: + type: string + description: Stock location address + example: 35, Jhon Doe Ave + address_2: + type: string + description: Stock location address' complement + example: apartment 4432 + city: + type: string + description: Stock location address' city + example: Mexico city + country_code: + type: string + description: Stock location address' country + example: MX + phone: + type: string + description: Stock location address' phone number + example: +1 555 61646 + postal_code: + type: string + description: Stock location address' postal code + example: HD3-1G8 + province: + type: string + description: Stock location address' province + example: Sinaloa + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + CreateStockLocationInput: + title: Create Stock Location Input + description: Represents the Input to create a Stock Location + type: object + required: + - name + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + UpdateStockLocationInput: + title: Update Stock Location Input + description: Represents the Input to update a Stock Location + type: object + properties: + name: + type: string + description: The stock location name + address_id: + type: string + description: The Stock location address ID + address: + description: Stock location address object + allOf: + - $ref: '#/components/schemas/StockLocationAddressInput' + - type: object + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + MultipleErrors: + title: Multiple Errors + type: object + properties: + errors: + type: array + description: Array of errors + items: + $ref: '#/components/schemas/Error' + message: + type: string + default: Provided request body contains errors. Please check the data and retry the request + Error: + title: Response Error + type: object + properties: + code: + type: string + description: A slug code to indicate the type of the error. + message: + type: string + description: Description of the error that occurred. + type: + type: string + description: A slug indicating the type of the error. + StorePostAuthReq: + type: object + required: + - email + - password + properties: + email: + type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. + StoreAuthRes: + type: object + properties: + customer: + $ref: '#/components/schemas/Customer' + StoreGetAuthEmailRes: + type: object + properties: + exists: + type: boolean + description: Whether email exists or not. + StorePostCartsCartShippingMethodReq: + type: object + required: + - option_id + properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: Used to hold any data that the shipping method may need to process the fulfillment of the order. Look at the documentation for your installed fulfillment providers to find out what to send. + StorePostCartReq: + type: object + properties: + region_id: + type: string + description: The ID of the Region to create the Cart in. + sales_channel_id: + type: string + description: '[EXPERIMENTAL] The ID of the Sales channel to create the Cart in.' + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + description: See a list of codes. + items: + description: An optional array of `variant_id`, `quantity` pairs to generate Line Items from. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The id of the Product Variant to generate a Line Item from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: An optional object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent` + type: object + example: + ip: '::1' + user_agent: Chrome + StoreCartsRes: + type: object + properties: + cart: + $ref: '#/components/schemas/Cart' + StoreCompleteCartRes: + 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 + allOf: + - description: Cart was successfully authorized and order was placed successfully. + - $ref: '#/components/schemas/Order' + - type: object + allOf: + - description: Cart was successfully authorized but requires further actions. + - $ref: '#/components/schemas/Cart' + - type: object + allOf: + - description: When cart is used for a swap and it has been completed successfully. + - $ref: '#/components/schemas/Swap' + StorePostCartsCartPaymentSessionReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + 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: + type: object + required: + - code + properties: + code: + description: The code that a Gift Card is identified by. + type: string + discounts: + description: An array of Discount codes to add to the Cart. + type: array + items: + type: object + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The ID of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. + type: object + example: + ip: '::1' + user_agent: Chrome + StorePostCartsCartLineItemsItemReq: + type: object + required: + - quantity + properties: + quantity: + type: number + description: The quantity to set the Line Item to. + StorePostCartsCartPaymentSessionUpdateReq: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. + StoreCollectionsListRes: + 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 + StoreCollectionsRes: + type: object + properties: + collection: + $ref: '#/components/schemas/ProductCollection' + 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 + StoreCustomersRes: + type: object + properties: + customer: + $ref: '#/components/schemas/Customer' + StoreCustomersListOrdersRes: + type: object + properties: + orders: + type: array + items: + $ref: '#/components/schemas/Order' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreCustomersListPaymentMethodsRes: + type: object + properties: + payment_methods: + type: array + items: + type: object + properties: + provider_id: + type: string + description: The id of the Payment Provider where the payment method is saved. + data: + type: object + description: The data needed for the Payment Provider to use the saved payment method. + 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 + StoreGiftCardsRes: + type: object + properties: + gift_card: + $ref: '#/components/schemas/GiftCard' + StorePostOrderEditsOrderEditDecline: + type: object + properties: + declined_reason: + type: string + description: The reason for declining the OrderEdit. + StoreOrderEditsRes: + type: object + properties: + order_edit: + $ref: '#/components/schemas/OrderEdit' + StorePostCustomersCustomerAcceptClaimReq: + type: object + required: + - token + properties: + token: + description: The invite token provided by the admin. + type: string + StoreOrdersRes: + type: object + properties: + order: + $ref: '#/components/schemas/Order' + 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 + StorePaymentCollectionsRes: + type: object + properties: + payment_collection: + $ref: '#/components/schemas/PaymentCollection' + StorePaymentCollectionsSessionRes: + type: object + properties: + payment_session: + $ref: '#/components/schemas/PaymentSession' + StorePostPaymentCollectionsBatchSessionsReq: + type: object + required: + - sessions + properties: + sessions: + description: An array of payment sessions related to the Payment Collection. If the session_id is not provided, existing sessions not present will be deleted and the provided ones will be created. + type: array + items: + type: object + required: + - provider_id + - amount + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + amount: + type: integer + description: The amount . + session_id: + type: string + description: The ID of the Payment Session to be updated. + StorePaymentCollectionSessionsReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. + StoreGetProductCategoriesCategoryRes: + type: object + properties: + product_category: + $ref: '#/components/schemas/ProductCategory' + StoreProductCategoriesListRes: + type: object + properties: + product_categories: + type: array + items: + $ref: '#/components/schemas/ProductCategory' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreProductTypesListRes: + type: object + properties: + product_types: + type: array + items: + $ref: '#/components/schemas/ProductType' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreProductsRes: + type: object + properties: + product: + $ref: '#/components/schemas/PricedProduct' + StorePostSearchRes: + type: object + properties: + hits: + type: array + description: Array of results. The format of the items depends on the search engine installed on the server. + StoreProductsListRes: + type: object + properties: + products: + type: array + items: + $ref: '#/components/schemas/PricedProduct' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + StoreRegionsListRes: + type: object + properties: + regions: + type: array + items: + $ref: '#/components/schemas/Region' + StoreRegionsRes: + type: object + properties: + region: + $ref: '#/components/schemas/Region' + StoreReturnReasonsListRes: + type: object + properties: + return_reasons: + type: array + items: + $ref: '#/components/schemas/ReturnReason' + StoreReturnReasonsRes: + type: object + properties: + return_reason: + $ref: '#/components/schemas/ReturnReason' + StorePostReturnsReq: + type: object + required: + - order_id + - items + properties: + order_id: + type: string + description: The ID of the Order to create the Return from. + items: + description: The items to include in the Return. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item from the Order. + type: string + quantity: + description: The quantity to return. + type: integer + reason_id: + description: The ID of the return reason. + type: string + note: + description: A note to add to the item returned. + type: string + return_shipping: + description: If the Return is to be handled by the store operator the Customer can choose a Return Shipping Method. Alternatvely the Customer can handle the Return themselves. + type: object + required: + - option_id + properties: + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + StoreReturnsRes: + type: object + properties: + return: + $ref: '#/components/schemas/Return' + StoreShippingOptionsListRes: + type: object + properties: + shipping_options: + type: array + items: + $ref: '#/components/schemas/ShippingOption' + StorePostSwapsReq: + type: object + required: + - order_id + - return_items + - additional_items + properties: + order_id: + type: string + description: The ID of the Order to create the Swap for. + return_items: + description: The items to include in the Return. + type: array + items: + type: object + required: + - item_id + - quantity + properties: + item_id: + description: The ID of the Line Item from the Order. + type: string + quantity: + description: The quantity to swap. + type: integer + reason_id: + description: The ID of the reason of this return. + type: string + note: + description: The note to add to the item being swapped. + type: string + return_shipping_option: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + additional_items: + description: The items to exchange the returned items to. + type: array + items: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the Product Variant to send. + type: string + quantity: + description: The quantity to send of the variant. + type: integer + StoreSwapsRes: + type: object + properties: + swap: + $ref: '#/components/schemas/Swap' + StoreVariantsRes: + type: object + properties: + variant: + $ref: '#/components/schemas/PricedVariant' + StoreVariantsListRes: + type: object + properties: + variants: + type: array + items: + $ref: '#/components/schemas/PricedVariant' + StorePostCartsCartLineItemsReq: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: The id of the Product Variant to generate the Line Item from. + quantity: + type: number + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: An optional key-value map with additional details about the Line Item. diff --git a/docs/api/store/components/schemas/Cart.yaml b/docs/api/store/components/schemas/Cart.yaml index 204dddb8af..92c5146ff8 100644 --- a/docs/api/store/components/schemas/Cart.yaml +++ b/docs/api/store/components/schemas/Cart.yaml @@ -82,12 +82,12 @@ properties: payment_session: description: The selected payment session in the cart. nullable: true - $ref: ./PaymentSession.yaml + type: object payment_sessions: description: The payment sessions created on the cart. type: array items: - $ref: ./PaymentSession.yaml + type: object payment_id: description: The payment's ID if available nullable: true diff --git a/docs/api/store/components/schemas/ClaimImage.yaml b/docs/api/store/components/schemas/ClaimImage.yaml index 5a46013ba3..214446d0bb 100644 --- a/docs/api/store/components/schemas/ClaimImage.yaml +++ b/docs/api/store/components/schemas/ClaimImage.yaml @@ -20,7 +20,7 @@ properties: claim_item: description: A claim item object. Available if the relation `claim_item` is expanded. nullable: true - $ref: ./ClaimItem.yaml + type: object url: description: The URL of the image type: string diff --git a/docs/api/store/components/schemas/Country.yaml b/docs/api/store/components/schemas/Country.yaml index 188fb5ccae..3b78bc3b33 100644 --- a/docs/api/store/components/schemas/Country.yaml +++ b/docs/api/store/components/schemas/Country.yaml @@ -54,4 +54,4 @@ properties: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: ./Region.yaml + type: object diff --git a/docs/api/store/components/schemas/CustomerGroup.yaml b/docs/api/store/components/schemas/CustomerGroup.yaml index 65e7fb545a..c3ae03f953 100644 --- a/docs/api/store/components/schemas/CustomerGroup.yaml +++ b/docs/api/store/components/schemas/CustomerGroup.yaml @@ -23,14 +23,14 @@ properties: `customers` is expanded. type: array items: - $ref: ./Customer.yaml + type: object price_lists: description: >- The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. type: array items: - $ref: ./PriceList.yaml + type: object created_at: description: The date with timezone at which the resource was created. type: string diff --git a/docs/api/store/components/schemas/Discount.yaml b/docs/api/store/components/schemas/Discount.yaml index 9257a02406..124f8698ed 100644 --- a/docs/api/store/components/schemas/Discount.yaml +++ b/docs/api/store/components/schemas/Discount.yaml @@ -59,7 +59,7 @@ properties: parent_discount: description: Available if the relation `parent_discount` is expanded. nullable: true - $ref: ./Discount.yaml + type: object starts_at: description: The time at which the discount can be used. type: string diff --git a/docs/api/store/components/schemas/DiscountRule.yaml b/docs/api/store/components/schemas/DiscountRule.yaml index 2adf4fb537..e2571f38a7 100644 --- a/docs/api/store/components/schemas/DiscountRule.yaml +++ b/docs/api/store/components/schemas/DiscountRule.yaml @@ -54,7 +54,7 @@ properties: used. Available if the relation `conditions` is expanded. type: array items: - $ref: ./DiscountCondition.yaml + type: object created_at: description: The date with timezone at which the resource was created. type: string diff --git a/docs/api/store/components/schemas/Fulfillment.yaml b/docs/api/store/components/schemas/Fulfillment.yaml index 8567463bfe..6ab0193bdf 100644 --- a/docs/api/store/components/schemas/Fulfillment.yaml +++ b/docs/api/store/components/schemas/Fulfillment.yaml @@ -9,32 +9,52 @@ description: >- Fulfillments. type: object required: + - canceled_at + - claim_order_id + - created_at + - data + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id - provider_id + - shipped_at + - swap_id + - tracking_numbers + - updated_at properties: id: + description: The fulfillment's ID type: string - description: The cart's ID example: ful_01G8ZRTMQCA76TXNAT81KPJZRF claim_order_id: description: The id of the Claim that the Fulfillment belongs to. + nullable: true type: string example: null claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object swap_id: description: The id of the Swap that the Fulfillment belongs to. + nullable: true type: string example: null swap: description: A swap object. Available if the relation `swap` is expanded. + nullable: true type: object order_id: description: The id of the Order that the Fulfillment belongs to. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object provider_id: description: >- @@ -42,13 +62,15 @@ properties: fulfillment type: string example: manual - location_id: - description: The id of the stock location the fulfillment will be shipped from - type: string - example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK provider: description: Available if the relation `provider` is expanded. + nullable: true $ref: ./FulfillmentProvider.yaml + location_id: + description: The id of the stock location the fulfillment will be shipped from + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK items: description: >- The Fulfillment Items in the Fulfillment - these hold information about @@ -66,10 +88,10 @@ properties: items: $ref: ./TrackingLink.yaml tracking_numbers: - deprecated: true description: >- The tracking numbers that can be used to track the status of the fulfillment. + deprecated: true type: array items: type: string @@ -81,41 +103,42 @@ properties: example: {} shipped_at: description: The date with timezone at which the Fulfillment was shipped. + nullable: true type: string format: date-time no_notification: description: >- Flag for describing whether or not notifications related to this should be - send. + sent. + nullable: true type: boolean example: false canceled_at: description: The date with timezone at which the Fulfillment was canceled. + nullable: true type: string format: date-time idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the fulfillment in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/FulfillmentItem.yaml b/docs/api/store/components/schemas/FulfillmentItem.yaml index 8578f6a4d7..ad05c5637e 100644 --- a/docs/api/store/components/schemas/FulfillmentItem.yaml +++ b/docs/api/store/components/schemas/FulfillmentItem.yaml @@ -18,9 +18,11 @@ properties: example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN fulfillment: description: A fulfillment object. Available if the relation `fulfillment` is expanded. + nullable: true type: object item: description: Available if the relation `item` is expanded. + nullable: true $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Fulfillment. diff --git a/docs/api/store/components/schemas/FulfillmentProvider.yaml b/docs/api/store/components/schemas/FulfillmentProvider.yaml index bbd8801420..77f50f4c75 100644 --- a/docs/api/store/components/schemas/FulfillmentProvider.yaml +++ b/docs/api/store/components/schemas/FulfillmentProvider.yaml @@ -1,6 +1,9 @@ title: Fulfillment Provider description: Represents a fulfillment provider plugin and holds its installation status. type: object +required: + - id + - is_installed properties: id: description: The id of the fulfillment provider as given by the plugin. @@ -12,4 +15,4 @@ properties: no longer installed are not deleted by will have this field set to `false`. type: boolean - example: true + default: true diff --git a/docs/api/store/components/schemas/GiftCard.yaml b/docs/api/store/components/schemas/GiftCard.yaml index d169d35e54..0967dd0b92 100644 --- a/docs/api/store/components/schemas/GiftCard.yaml +++ b/docs/api/store/components/schemas/GiftCard.yaml @@ -4,14 +4,23 @@ description: >- payment of an Order. type: object required: - - code - - value - balance + - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled + - metadata + - order_id - region_id + - tax_rate + - updated_at + - value properties: id: + description: The gift card's ID type: string - description: The cart's ID example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ code: description: >- @@ -28,47 +37,54 @@ properties: type: integer example: 10 region_id: - type: string description: The id of the Region in which the Gift Card is available. + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: ./Region.yaml order_id: - type: string description: The id of the Order that the Gift Card was purchased in. + nullable: true + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object is_disabled: description: >- Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts. type: boolean - example: false + default: false ends_at: description: The time at which the Gift Card can no longer be used. + nullable: true type: string format: date-time tax_rate: - description: The gift cards's tax rate that will be applied on calculating totals + description: The gift card's tax rate that will be applied on calculating totals + nullable: true type: number example: 0 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/GiftCardTransaction.yaml b/docs/api/store/components/schemas/GiftCardTransaction.yaml index df738aa63b..48cd927c23 100644 --- a/docs/api/store/components/schemas/GiftCardTransaction.yaml +++ b/docs/api/store/components/schemas/GiftCardTransaction.yaml @@ -4,12 +4,17 @@ description: >- their Order type: object required: - - gift_card_id - amount + - created_at + - gift_card_id + - id + - is_taxable + - order_id + - tax_rate properties: id: - type: string description: The gift card transaction's ID + type: string example: gct_01G8X9A7ESKAJXG2H0E6F1MW7A gift_card_id: description: The ID of the Gift Card that was used in the transaction. @@ -17,6 +22,7 @@ properties: example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ gift_card: description: A gift card object. Available if the relation `gift_card` is expanded. + nullable: true type: object order_id: description: The ID of the Order that the Gift Card was used to pay for. @@ -24,6 +30,7 @@ properties: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object amount: description: The amount that was used from the Gift Card. @@ -35,9 +42,11 @@ properties: format: date-time is_taxable: description: Whether the transaction is taxable or not. + nullable: true type: boolean example: false tax_rate: description: The tax rate of the transaction + nullable: true type: number example: 0 diff --git a/docs/api/store/components/schemas/IdempotencyKey.yaml b/docs/api/store/components/schemas/IdempotencyKey.yaml index b496aadde3..1ee68e1a5b 100644 --- a/docs/api/store/components/schemas/IdempotencyKey.yaml +++ b/docs/api/store/components/schemas/IdempotencyKey.yaml @@ -4,11 +4,20 @@ description: >- might occur. type: object required: + - created_at + - id - idempotency_key + - locked_at + - recovery_point + - response_code + - response_body + - request_method + - request_params + - request_path properties: id: - type: string description: The idempotency key's ID + type: string example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A idempotency_key: description: >- @@ -25,31 +34,37 @@ properties: format: date-time locked_at: description: Date which the idempotency key was locked. + nullable: true type: string format: date-time request_method: description: The method of the request + nullable: true type: string example: POST request_params: - type: object description: The parameters passed to the request + nullable: true + type: object example: id: cart_01G8ZH853Y6TFXWPG5EYE81X63 request_path: description: The request's path + nullable: true type: string example: /store/carts/cart_01G8ZH853Y6TFXWPG5EYE81X63/complete response_code: - type: string description: The response's code. + nullable: true + type: string example: 200 response_body: - type: object description: The response's body + nullable: true + type: object example: id: cart_01G8ZH853Y6TFXWPG5EYE81X63 recovery_point: - type: string description: Where to continue from. + type: string default: started diff --git a/docs/api/store/components/schemas/Image.yaml b/docs/api/store/components/schemas/Image.yaml index 5250816766..e061ecefe8 100644 --- a/docs/api/store/components/schemas/Image.yaml +++ b/docs/api/store/components/schemas/Image.yaml @@ -2,6 +2,11 @@ title: Image description: Images holds a reference to a URL at which the image file can be found. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - url properties: id: @@ -13,19 +18,21 @@ properties: type: string format: uri created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/Invite.yaml b/docs/api/store/components/schemas/Invite.yaml index 9e16e818ea..fa8ba054c5 100644 --- a/docs/api/store/components/schemas/Invite.yaml +++ b/docs/api/store/components/schemas/Invite.yaml @@ -2,6 +2,15 @@ title: Invite description: Represents an invite type: object required: + - accepted + - created_at + - deleted_at + - expires_at + - id + - metadata + - role + - token + - updated_at - user_email properties: id: @@ -9,42 +18,45 @@ properties: description: The invite's ID example: invite_01G8TKE4XYCTHSCK2GDEP47RE1 user_email: - type: string description: The email of the user being invited. + type: string format: email role: - type: string description: The user's role. + nullable: true + type: string enum: - admin - member - developer default: member accepted: - type: boolean description: Whether the invite was accepted or not. - example: false + type: boolean + default: false token: - type: string description: The token used to accept the invite. - expores_at: type: string + expires_at: description: The date the invite expires at. + type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/LineItem.yaml b/docs/api/store/components/schemas/LineItem.yaml index 0e0c64de6f..e809ce5e3c 100644 --- a/docs/api/store/components/schemas/LineItem.yaml +++ b/docs/api/store/components/schemas/LineItem.yaml @@ -6,41 +6,70 @@ description: >- may also be created when processing Swaps and Claims. type: object required: + - allow_discounts + - cart_id + - claim_order_id + - created_at + - description + - fulfilled_quantity + - has_shipping + - id + - is_giftcard + - is_return + - metadata + - order_edit_id + - order_id + - original_item_id + - quantity + - returned_quantity + - shipped_quantity + - should_merge + - swap_id + - thumbnail - title - unit_price - - quantity + - updated_at + - variant_id properties: id: + description: The line item's ID type: string - description: The cart's ID example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN cart_id: description: The ID of the Cart that the Line Item belongs to. + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object order_id: description: The ID of the Order that the Line Item belongs to. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object swap_id: description: The id of the Swap that the Line Item belongs to. + nullable: true type: string example: null swap: description: A swap object. Available if the relation `swap` is expanded. + nullable: true type: object claim_order_id: description: The id of the Claim that the Line Item belongs to. + nullable: true type: string example: null claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object tax_lines: description: Available if the relation `tax_lines` is expanded. @@ -52,6 +81,18 @@ properties: type: array items: $ref: ./LineItemAdjustment.yaml + original_item_id: + description: The id of the original line item + nullable: true + type: string + order_edit_id: + description: The ID of the order edit to which a cloned item belongs + nullable: true + type: string + order_edit: + description: The order edit joined. Available if the relation `order_edit` is expanded. + nullable: true + type: object title: description: >- The title of the Line Item, this should be easily identifiable by the @@ -60,35 +101,38 @@ properties: example: Medusa Coffee Mug description: description: A more detailed description of the contents of the Line Item. + nullable: true type: string example: One Size thumbnail: description: A URL string to a small image of the contents of the Line Item. + nullable: true type: string format: uri example: https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png is_return: description: Is the item being returned type: boolean - example: false + default: false is_giftcard: description: Flag to indicate if the Line Item is a Gift Card. type: boolean - example: false + default: false should_merge: description: >- Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item. type: boolean - example: false + default: true allow_discounts: description: >- Flag to indicate if the Line Item should be included when doing discount calculations. type: boolean - example: false + default: true has_shipping: description: Flag to indicate if the Line Item has fulfillment associated with it. + nullable: true type: boolean example: false unit_price: @@ -96,31 +140,36 @@ properties: The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to. - type: boolean + type: integer example: 8000 variant_id: description: The id of the Product Variant contained in the Line Item. + nullable: true type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: >- A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. - type: object + nullable: true + $ref: ./ProductVariant.yaml quantity: description: The quantity of the content in the Line Item. type: integer example: 1 fulfilled_quantity: description: The quantity of the Line Item that has been fulfilled. + nullable: true type: integer example: 0 returned_quantity: description: The quantity of the Line Item that has been returned. + nullable: true type: integer example: 0 shipped_quantity: description: The quantity of the Line Item that has been shipped. + nullable: true type: integer example: 0 refundable: @@ -130,55 +179,48 @@ properties: type: integer example: 0 subtotal: - type: integer description: The subtotal of the line item + type: integer example: 8000 tax_total: - type: integer description: The total of tax of the line item + type: integer example: 0 total: - type: integer description: The total amount of the line item + type: integer example: 8000 original_total: - type: integer description: The original total amount of the line item + type: integer example: 8000 original_tax_total: - type: integer description: The original tax total amount of the line item + type: integer example: 0 discount_total: - type: integer description: The total of discount of the line item + type: integer example: 0 gift_card_total: - type: integer description: The total of the gift card of the line item + type: integer example: 0 includes_tax: description: '[EXPERIMENTAL] Indicates if the line item unit_price include tax' type: boolean - original_item_id: - description: '[EXPERIMENTAL] The id of the original line item' - type: string - order_edit_id: - description: '[EXPERIMENTAL] The ID of the order edit to which a cloned item belongs' - type: string - order_edit: - description: '[EXPERIMENTAL] The order edit joined' - type: object + default: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/LineItemAdjustment.yaml b/docs/api/store/components/schemas/LineItemAdjustment.yaml index 28b41b9566..fe1b9049e8 100644 --- a/docs/api/store/components/schemas/LineItemAdjustment.yaml +++ b/docs/api/store/components/schemas/LineItemAdjustment.yaml @@ -2,38 +2,45 @@ title: Line Item Adjustment description: Represents a Line Item Adjustment type: object required: - - item_id - - description - amount + - description + - discount_id + - id + - item_id + - metadata properties: id: + description: The Line Item Adjustment's ID type: string - description: The invite's ID example: lia_01G8TKE4XYCTHSCK2GDEP47RE1 item_id: - type: string description: The ID of the line item + type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN item: description: Available if the relation `item` is expanded. - $ref: ./LineItem.yaml + nullable: true + type: object description: - type: string description: The line item's adjustment description + type: string example: Adjusted item's price. discount_id: - type: string description: The ID of the discount associated with the adjustment + nullable: true + type: string example: disc_01F0YESMW10MGHWJKZSDDMN0VN discount: description: Available if the relation `discount` is expanded. + nullable: true $ref: ./Discount.yaml amount: - type: number description: The adjustment amount + type: integer example: 1000 metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/LineItemTaxLine.yaml b/docs/api/store/components/schemas/LineItemTaxLine.yaml index 2ee2e0a546..ec316b7cb7 100644 --- a/docs/api/store/components/schemas/LineItemTaxLine.yaml +++ b/docs/api/store/components/schemas/LineItemTaxLine.yaml @@ -2,23 +2,22 @@ title: Line Item Tax Line description: Represents a Line Item Tax Line type: object required: + - code + - created_at + - id - item_id - - rate + - metadata - name + - rate + - updated_at properties: id: - type: string description: The line item tax line's ID - example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 - item_id: type: string - description: The ID of the line item - example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN - item: - description: Available if the relation `item` is expanded. - $ref: ./LineItem.yaml + example: litl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 code: description: A code to identify the tax type by + nullable: true type: string example: tax01 name: @@ -29,16 +28,25 @@ properties: description: The numeric rate to charge tax by type: number example: 10 - created_at: + item_id: + description: The ID of the line item type: string + example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + item: + description: Available if the relation `item` is expanded. + nullable: true + type: object + created_at: description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/MoneyAmount.yaml b/docs/api/store/components/schemas/MoneyAmount.yaml index 223ddf5f44..f2b78adabf 100644 --- a/docs/api/store/components/schemas/MoneyAmount.yaml +++ b/docs/api/store/components/schemas/MoneyAmount.yaml @@ -7,12 +7,21 @@ description: >- the amount will be in the currency defined for the Reigon. type: object required: - - currency_code - amount + - created_at + - currency_code + - deleted_at + - id + - max_quantity + - min_quantity + - price_list_id + - region_id + - updated_at + - variant_id properties: id: - type: string description: The money amount's ID + type: string example: ma_01F0YESHRFQNH5S8Q0PK84YYZN currency_code: description: The 3 character currency code that the Money Amount is given in. @@ -23,6 +32,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml amount: description: >- @@ -34,51 +44,55 @@ properties: description: >- The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. + nullable: true type: integer example: 1 max_quantity: description: >- The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. + nullable: true type: integer example: 1 price_list_id: - type: string description: The ID of the price list associated with the money amount + nullable: true + type: string example: pl_01G8X3CKJXCG5VXVZ87H9KC09W price_list: description: Available if the relation `price_list` is expanded. - $ref: ./PriceList.yaml + nullable: true + type: object variant_id: description: The id of the Product Variant contained in the Line Item. + nullable: true type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: >- The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. + nullable: true type: object region_id: - type: string description: The region's ID + nullable: true + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. + nullable: true type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time - metadata: - type: object - description: An optional key-value map with additional details - example: - car: white diff --git a/docs/api/store/components/schemas/Note.yaml b/docs/api/store/components/schemas/Note.yaml index 2decb4f715..3fce158b7e 100644 --- a/docs/api/store/components/schemas/Note.yaml +++ b/docs/api/store/components/schemas/Note.yaml @@ -4,13 +4,19 @@ description: >- allow users to describe additional information in relation to these. type: object required: - - value - - resource_type + - author_id + - created_at + - deleted_at + - id + - metadata - resource_id + - resource_type + - updated_at + - value properties: id: - type: string description: The note's ID + type: string example: note_01G8TM8ENBMC7R90XRR1G6H26Q resource_type: description: The type of resource that the Note refers to. @@ -25,26 +31,30 @@ properties: type: string example: This order must be fulfilled on Monday author_id: - type: string description: The ID of the author (user) + nullable: true + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V author: description: Available if the relation `author` is expanded. + nullable: true $ref: ./User.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/Notification.yaml b/docs/api/store/components/schemas/Notification.yaml index ddc77a9c73..13eca79f77 100644 --- a/docs/api/store/components/schemas/Notification.yaml +++ b/docs/api/store/components/schemas/Notification.yaml @@ -6,16 +6,25 @@ description: >- Order, and enables resends. type: object required: + - created_at + - customer_id + - data + - event_name + - id + - parent_id + - provider_id - resource_type - resource_id - to + - updated_at properties: id: - type: string description: The notification's ID + type: string example: noti_01G53V9Y6CKMCGBM1P0X7C28RX event_name: description: The name of the event that the notification was sent for. + nullable: true type: string example: order.placed resource_type: @@ -28,11 +37,13 @@ properties: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK customer_id: description: The ID of the Customer that the Notification was sent to. + nullable: true type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. - type: object + nullable: true + $ref: ./Customer.yaml to: description: >- The address that the Notification was sent to. This will usually be an @@ -45,23 +56,36 @@ properties: necessary for the Notification Provider to initiate a resend. type: object example: {} + parent_id: + description: The notification's parent ID + nullable: true + type: string + example: noti_01G53V9Y6CKMCGBM1P0X7C28RX + parent_notification: + description: Available if the relation `parent_notification` is expanded. + nullable: true + type: object resends: - description: The resends that have been completed after the original Notification. + description: >- + The resends that have been completed after the original Notification. + Available if the relation `resends` is expanded. type: array items: - $ref: ./NotificationResend.yaml + type: object provider_id: description: The id of the Notification Provider that handles the Notification. + nullable: true type: string example: sengrid provider: description: Available if the relation `provider` is expanded. + nullable: true $ref: ./NotificationProvider.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time diff --git a/docs/api/store/components/schemas/NotificationProvider.yaml b/docs/api/store/components/schemas/NotificationProvider.yaml index fbc83c6837..71bc9d5f96 100644 --- a/docs/api/store/components/schemas/NotificationProvider.yaml +++ b/docs/api/store/components/schemas/NotificationProvider.yaml @@ -3,6 +3,7 @@ description: Represents a notification provider plugin and holds its installatio type: object required: - id + - is_installed properties: id: description: The id of the notification provider as given by the plugin. diff --git a/docs/api/store/components/schemas/NotificationResend.yaml b/docs/api/store/components/schemas/NotificationResend.yaml deleted file mode 100644 index cd88d291ae..0000000000 --- a/docs/api/store/components/schemas/NotificationResend.yaml +++ /dev/null @@ -1,61 +0,0 @@ -title: Notification Resend -description: A resend of a Notification. -type: object -properties: - id: - description: The notification resend's ID - type: string - example: noti_01F0YET45G9NHP08Z66CE4QKBS - event_name: - description: The name of the event that the notification was sent for. - type: string - example: order.placed - resource_type: - description: The type of resource that the Notification refers to. - type: string - example: order - resource_id: - description: The ID of the resource that the Notification refers to. - type: string - example: order_01G8TJSYT9M6AVS5N4EMNFS1EK - customer_id: - description: The ID of the Customer that the Notification was sent to. - type: string - example: cus_01G2SG30J8C85S4A5CHM2S1NS2 - customer: - description: A customer object. Available if the relation `customer` is expanded. - type: object - to: - description: >- - The address that the Notification was sent to. This will usually be an - email address, but represent other addresses such as a chat bot user id - type: string - example: user@example.com - data: - description: >- - The data that the Notification was sent with. This contains all the data - necessary for the Notification Provider to initiate a resend. - type: object - example: {} - parent_id: - description: The ID of the Notification that was originally sent. - type: string - example: noti_01G53V9Y6CKMCGBM1P0X7C28RX - parent_notification: - description: Available if the relation `parent_notification` is expanded. - $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: ./NotificationProvider.yaml - created_at: - type: string - description: The date with timezone at which the resource was created. - format: date-time - updated_at: - type: string - description: The date with timezone at which the resource was updated. - format: date-time diff --git a/docs/api/store/components/schemas/OAuth.yaml b/docs/api/store/components/schemas/OAuth.yaml index 9f22524f3e..36df175455 100644 --- a/docs/api/store/components/schemas/OAuth.yaml +++ b/docs/api/store/components/schemas/OAuth.yaml @@ -2,31 +2,37 @@ title: OAuth description: Represent an OAuth app type: object required: - - id - - display_name - application_name + - data + - display_name + - id + - install_url + - uninstall_url properties: id: - type: string description: The app's ID + type: string example: example_app display_name: - type: string description: The app's display name + type: string example: Example app application_name: - type: string description: The app's name + type: string example: example install_url: - type: string description: The URL to install the app + nullable: true + type: string format: uri uninstall_url: - type: string description: The URL to uninstall the app + nullable: true + type: string format: uri data: - type: object description: Any data necessary to the app. + nullable: true + type: object example: {} diff --git a/docs/api/store/components/schemas/Order.yaml b/docs/api/store/components/schemas/Order.yaml index e503b4fecd..26d73485be 100644 --- a/docs/api/store/components/schemas/Order.yaml +++ b/docs/api/store/components/schemas/Order.yaml @@ -2,18 +2,36 @@ title: Order description: Represents an order type: object required: - - customer_id - - email - - region_id + - billing_address_id + - canceled_at + - cart_id + - created_at - currency_code + - customer_id + - draft_order_id + - display_id + - email + - external_id + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification + - object + - payment_status + - region_id + - shipping_address_id + - status + - tax_rate + - updated_at properties: id: - type: string description: The order's ID + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK status: - type: string description: The order's status + type: string enum: - pending - completed @@ -22,8 +40,8 @@ properties: - requires_action default: pending fulfillment_status: - type: string description: The order's fulfillment status + type: string enum: - not_fulfilled - partially_fulfilled @@ -36,60 +54,68 @@ properties: - requires_action default: not_fulfilled payment_status: - type: string description: The order's payment status + type: string enum: - not_paid - awaiting - captured - partially_refunded - - refuneded + - refunded - canceled - requires_action default: not_paid display_id: - type: integer description: The order's display ID + type: integer example: 2 cart_id: - type: string description: The ID of the cart associated with the order + nullable: true + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object customer_id: - type: string description: The ID of the customer associated with the order + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. + nullable: true type: object email: description: The email associated with the order type: string format: email billing_address_id: - type: string description: The ID of the billing address associated with the order + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_address_id: - type: string description: The ID of the shipping address associated with the order + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: ./Address.yaml region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: ./Region.yaml currency_code: description: The 3 character currency code that is used in the order type: string @@ -99,177 +125,202 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml tax_rate: description: The order's tax rate + nullable: true type: number example: 0 discounts: - type: array description: >- The discounts used in the order. Available if the relation `discounts` is expanded. - items: - type: object - description: A discount object. - gift_cards: type: array + items: + $ref: ./Discount.yaml + gift_cards: description: >- The gift cards used in the order. Available if the relation `gift_cards` is expanded. - items: - type: object - description: A gift card object. - shipping_methods: type: array + items: + $ref: ./GiftCard.yaml + shipping_methods: description: >- The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. + type: array items: $ref: ./ShippingMethod.yaml payments: - type: array description: >- The payments used in the order. Available if the relation `payments` is expanded. + type: array items: type: object fulfillments: - type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. + type: array items: type: object returns: - type: array description: >- The returns associated with the order. Available if the relation `returns` is expanded. + type: array items: type: object - description: A return object. claims: - type: array description: >- The claims associated with the order. Available if the relation `claims` is expanded. + type: array items: type: object - description: A claim order object. refunds: - type: array description: >- The refunds associated with the order. Available if the relation `refunds` is expanded. + type: array items: type: object - description: A refund object. swaps: - type: array description: >- The swaps associated with the order. Available if the relation `swaps` is expanded. + type: array items: type: object - description: A swap object. draft_order_id: - type: string description: The ID of the draft order this order is associated with. + nullable: true + type: string example: null draft_order: description: A draft order object. Available if the relation `draft_order` is expanded. + nullable: true type: object items: - type: array description: >- The line items that belong to the order. Available if the relation `items` is expanded. + type: array items: $ref: ./LineItem.yaml edits: - type: array description: >- - [EXPERIMENTAL] Order edits done on the order. Available if the relation - `edits` is expanded. + Order edits done on the order. Available if the relation `edits` is + expanded. + type: array items: type: object gift_card_transactions: - type: array description: >- The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. + type: array items: $ref: ./GiftCardTransaction.yaml canceled_at: - type: string description: The date the order was canceled on. + nullable: true + type: string format: date-time no_notification: description: >- Flag for describing whether or not notifications related to this should be send. + nullable: true type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the processing of the order in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. external_id: description: The ID of an external order. + nullable: true type: string example: null sales_channel_id: - type: string description: The ID of the sales channel this order is associated with. + nullable: true + type: string example: null sales_channel: description: >- A sales channel object. Available if the relation `sales_channel` is expanded. - type: object + nullable: true + $ref: ./SalesChannel.yaml shipping_total: type: integer description: The total of shipping example: 1000 discount_total: - type: integer description: The total of discount + type: integer example: 800 tax_total: - type: integer description: The total of tax + type: integer example: 0 refunded_total: - type: integer description: The total amount refunded if the order is returned. + type: integer example: 0 total: - type: integer description: The total amount of the order + type: integer example: 8200 subtotal: - type: integer description: The subtotal of the order + type: integer example: 8000 paid_total: - type: integer description: The total amount paid + type: integer example: 8000 refundable_amount: - type: integer description: The amount that can be refunded + type: integer example: 8200 gift_card_total: - type: integer description: The total of gift cards + type: integer example: 0 gift_card_tax_total: - type: integer description: The total of gift cards with taxes + type: integer example: 0 + returnable_items: + description: >- + The items that are returnable as part of the order, order swaps or order + claims + type: array + items: + $ref: ./LineItem.yaml + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + metadata: + description: An optional key-value map with additional details + nullable: true + type: object + example: + car: white diff --git a/docs/api/store/components/schemas/OrderEdit.yaml b/docs/api/store/components/schemas/OrderEdit.yaml index 01f09e31d0..c6b72efad7 100644 --- a/docs/api/store/components/schemas/OrderEdit.yaml +++ b/docs/api/store/components/schemas/OrderEdit.yaml @@ -2,99 +2,132 @@ title: Order Edit description: Order edit keeps track of order items changes. type: object required: - - order_id - - order - - changes + - canceled_at + - canceled_by + - confirmed_by + - confirmed_at + - created_at - created_by + - declined_at + - declined_by + - declined_reason + - id + - internal_note + - order_id + - payment_collection_id + - requested_at + - requested_by + - status + - updated_at properties: id: - type: string description: The order edit's ID + type: string example: oe_01G8TJSYT9M6AVS5N4EMNFS1EK order_id: - type: string description: The ID of the order that is edited + type: string example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. + nullable: true type: object changes: - type: array description: Available if the relation `changes` is expanded. + type: array items: $ref: ./OrderItemChange.yaml internal_note: description: An optional note with additional details about the order edit. + nullable: true type: string example: Included two more items B to the order. created_by: - type: string description: The unique identifier of the user or customer who created the order edit. - requested_by: type: string + requested_by: description: >- The unique identifier of the user or customer who requested the order edit. - requested_at: + nullable: true type: string + requested_at: description: The date with timezone at which the edit was requested. + nullable: true + type: string format: date-time confirmed_by: - type: string description: >- The unique identifier of the user or customer who confirmed the order edit. - confirmed_at: + nullable: true type: string + confirmed_at: description: The date with timezone at which the edit was confirmed. + nullable: true + type: string format: date-time declined_by: - type: string description: The unique identifier of the user or customer who declined the order edit. - declined_at: + nullable: true type: string + declined_at: description: The date with timezone at which the edit was declined. + nullable: true + type: string format: date-time declined_reason: description: An optional note why the order edit is declined. + nullable: true type: string + canceled_by: + description: >- + The unique identifier of the user or customer who cancelled the order + edit. + nullable: true + type: string + canceled_at: + description: The date with timezone at which the edit was cancelled. + nullable: true + type: string + format: date-time subtotal: - type: integer description: The total of subtotal + type: integer example: 8000 discount_total: - type: integer description: The total of discount + type: integer example: 800 shipping_total: - type: integer description: The total of the shipping amount + type: integer example: 800 gift_card_total: - type: integer description: The total of the gift card amount + type: integer example: 800 gift_card_tax_total: - type: integer description: The total of the gift card tax amount + type: integer example: 800 tax_total: - type: integer description: The total of tax + type: integer example: 0 total: - type: integer description: The total amount of the edited order. + type: integer example: 8200 difference_due: - type: integer description: >- The difference between the total amount of the order and total amount of edited order. + type: integer example: 8200 status: - type: string description: The status of the order edit. + type: string enum: - confirmed - declined @@ -102,22 +135,24 @@ properties: - created - canceled items: - type: array description: Available if the relation `items` is expanded. + type: array items: $ref: ./LineItem.yaml payment_collection_id: - type: string description: The ID of the payment collection + nullable: true + type: string example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK payment_collection: description: Available if the relation `payment_collection` is expanded. + nullable: true $ref: ./PaymentCollection.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time diff --git a/docs/api/store/components/schemas/OrderItemChange.yaml b/docs/api/store/components/schemas/OrderItemChange.yaml index 49d0ecab5b..31a0435da5 100644 --- a/docs/api/store/components/schemas/OrderItemChange.yaml +++ b/docs/api/store/components/schemas/OrderItemChange.yaml @@ -2,55 +2,62 @@ title: Order Item Change description: Represents an order edit item change type: object required: - - type + - created_at + - deleted_at + - id + - line_item_id - order_edit_id + - original_line_item_id + - type + - updated_at properties: id: - type: string description: The order item change's ID + type: string example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK type: - type: string description: The order item change's status + type: string enum: - item_add - item_remove - item_update order_edit_id: - type: string description: The ID of the order edit + type: string example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: description: Available if the relation `order_edit` is expanded. - $ref: ./OrderEdit.yaml + nullable: true + type: object original_line_item_id: - type: string description: The ID of the original line item in the order + nullable: true + type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: description: Available if the relation `original_line_item` is expanded. + nullable: true $ref: ./LineItem.yaml line_item_id: - type: string description: The ID of the cloned line item. + nullable: true + type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: description: Available if the relation `line_item` is expanded. + nullable: true $ref: ./LineItem.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time - metadata: - type: object - description: An optional key-value map with additional details - example: - car: white diff --git a/docs/api/store/components/schemas/Payment.yaml b/docs/api/store/components/schemas/Payment.yaml index d224dca6cf..2555ec8ed4 100644 --- a/docs/api/store/components/schemas/Payment.yaml +++ b/docs/api/store/components/schemas/Payment.yaml @@ -5,32 +5,50 @@ description: >- type: object required: - amount + - amount_refunded + - canceled_at + - captured_at + - cart_id + - created_at - currency_code + - data + - id + - idempotency_key + - metadata + - order_id - provider_id + - swap_id + - updated_at properties: id: - type: string description: The payment's ID + type: string example: pay_01G2SJNT6DEEWDFNAJ4XWDTHKE swap_id: description: The ID of the Swap that the Payment is used for. + nullable: true type: string example: null swap: description: A swap object. Available if the relation `swap` is expanded. + nullable: true type: object cart_id: description: The id of the Cart that the Payment Session is created for. + nullable: true type: string cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object order_id: description: The ID of the Order that the Payment is used for. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object amount: description: The amount that the Payment has been authorized for. @@ -45,12 +63,14 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml amount_refunded: description: >- The amount of the original Payment amount that has been refunded back to the Customer. type: integer + default: 0 example: 0 provider_id: description: The id of the Payment Provider that is responsible for the Payment @@ -66,31 +86,35 @@ properties: example: {} captured_at: description: The date with timezone at which the Payment was captured. + nullable: true type: string format: date-time canceled_at: description: The date with timezone at which the Payment was canceled. + nullable: true type: string format: date-time idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a payment in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/PaymentCollection.yaml b/docs/api/store/components/schemas/PaymentCollection.yaml index 096abf613c..83db018a75 100644 --- a/docs/api/store/components/schemas/PaymentCollection.yaml +++ b/docs/api/store/components/schemas/PaymentCollection.yaml @@ -2,25 +2,32 @@ title: Payment Collection description: Payment Collection type: object required: - - type - - status - amount - - region_id - - currency_code + - authorized_amount + - created_at - created_by + - currency_code + - deleted_at + - description + - id + - metadata + - region_id + - status + - type + - updated_at properties: id: - type: string description: The payment collection's ID + type: string example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK type: - type: string description: The type of the payment collection + type: string enum: - order_edit status: - type: string description: The type of the payment collection + type: string enum: - not_paid - awaiting @@ -28,20 +35,23 @@ properties: - partially_authorized - canceled description: - type: string description: Description of the payment collection - amount: - type: number - description: Amount of the payment collection. - authorized_amount: - type: number - description: Authorized amount of the payment collection. - region_id: + nullable: true type: string + amount: + description: Amount of the payment collection. + type: integer + authorized_amount: + description: Authorized amount of the payment collection. + nullable: true + type: integer + region_id: description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: Available if the relation `region` is expanded. + nullable: true $ref: ./Region.yaml currency_code: description: The 3 character ISO code for the currency. @@ -52,34 +62,37 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml payment_sessions: - type: array description: Available if the relation `payment_sessions` is expanded. + type: array items: $ref: ./PaymentSession.yaml payments: - type: array description: Available if the relation `payments` is expanded. + type: array items: $ref: ./Payment.yaml created_by: - type: string description: The ID of the user that created the payment collection. - created_at: type: string + created_at: description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/PaymentProvider.yaml b/docs/api/store/components/schemas/PaymentProvider.yaml index 57cf719a28..ae7eaecb49 100644 --- a/docs/api/store/components/schemas/PaymentProvider.yaml +++ b/docs/api/store/components/schemas/PaymentProvider.yaml @@ -3,6 +3,7 @@ description: Represents a Payment Provider plugin and holds its installation sta type: object required: - id + - is_installed properties: id: description: The id of the payment provider as given by the plugin. diff --git a/docs/api/store/components/schemas/PaymentSession.yaml b/docs/api/store/components/schemas/PaymentSession.yaml index 440d532f58..453afac944 100644 --- a/docs/api/store/components/schemas/PaymentSession.yaml +++ b/docs/api/store/components/schemas/PaymentSession.yaml @@ -8,21 +8,32 @@ description: >- capture/refunds/etc. type: object required: + - amount - cart_id + - created_at + - data + - id + - is_initiated + - is_selected + - idempotency_key + - payment_authorized_at - provider_id - status + - updated_at properties: id: - type: string description: The payment session's ID + type: string example: ps_01G901XNSRM2YS3ASN9H5KG3FZ cart_id: description: The id of the Cart that the Payment Session is created for. + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: ./Cart.yaml provider_id: description: The id of the Payment Provider that is responsible for the Payment Session type: string @@ -31,6 +42,7 @@ properties: description: >- A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase. + nullable: true type: boolean example: true is_initiated: @@ -38,8 +50,8 @@ properties: A flag to indicate if a communication with the third party provider has been initiated. type: boolean - example: true default: false + example: true status: description: >- Indicates the status of the Payment Session. Will default to `pending`, @@ -63,19 +75,30 @@ properties: type: object example: {} idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - created_at: + amount: + description: The amount that the Payment Session has been authorized for. + nullable: true + type: integer + example: 100 + payment_authorized_at: + description: The date with timezone at which the Payment Session was authorized. + nullable: true type: string + format: date-time + created_at: description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time diff --git a/docs/api/store/components/schemas/PriceList.yaml b/docs/api/store/components/schemas/PriceList.yaml index 6c1fc7de25..ef84ed5cb5 100644 --- a/docs/api/store/components/schemas/PriceList.yaml +++ b/docs/api/store/components/schemas/PriceList.yaml @@ -4,20 +4,28 @@ description: >- one or more product variants. type: object required: - - name + - created_at + - deleted_at - description + - ends_at + - id + - name + - starts_at + - status + - type + - updated_at properties: id: - type: string description: The price list's ID + type: string example: pl_01G8X3CKJXCG5VXVZ87H9KC09W name: - type: string description: The price list's name + type: string example: VIP Prices description: - type: string description: The price list's description + type: string example: Prices for VIP customers type: description: The type of Price List. This can be one of either `sale` or `override`. @@ -35,10 +43,12 @@ properties: default: draft starts_at: description: The date with timezone that the Price List starts being valid. + nullable: true type: string format: date-time ends_at: description: The date with timezone that the Price List stops being valid. + nullable: true type: string format: date-time customer_groups: @@ -47,29 +57,28 @@ properties: relation `customer_groups` is expanded. type: array items: - type: object - description: A customer group object. + $ref: ./CustomerGroup.yaml prices: description: >- The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. type: array items: - oneOf: - - $ref: ./MoneyAmount.yaml - - $ref: ./CustomerGroup.yaml + $ref: ./MoneyAmount.yaml includes_tax: description: '[EXPERIMENTAL] Does the price list prices include tax' type: boolean + default: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/store/components/schemas/Product.yaml b/docs/api/store/components/schemas/Product.yaml index 2efc2db8c4..94a80dd483 100644 --- a/docs/api/store/components/schemas/Product.yaml +++ b/docs/api/store/components/schemas/Product.yaml @@ -5,12 +5,35 @@ description: >- the properties that Product Variants differ by. type: object required: - - title + - collection_id + - created_at + - deleted_at + - description + - discountable + - external_id + - handle + - height + - hs_code + - id + - is_giftcard + - length + - material + - metadata + - mid_code + - origin_country - profile_id + - status + - subtitle + - type_id + - thumbnail + - title + - updated_at + - weight + - width properties: id: - type: string description: The product's ID + type: string example: prod_01G1G5V2MBA328390B5AXJ610F title: description: A title that can be displayed for easy identification of the Product. @@ -18,13 +41,16 @@ properties: example: Medusa Coffee Mug subtitle: description: An optional subtitle that can be used to further specify the Product. + nullable: true type: string description: description: A short description of the Product. + nullable: true type: string example: Every programmer's best friend. handle: description: A unique identifier for the Product (e.g. for slug structure). + nullable: true type: string example: coffee-mug is_giftcard: @@ -50,6 +76,7 @@ properties: $ref: ./Image.yaml thumbnail: description: A URL to an image file that can be used to identify the Product. + nullable: true type: string format: uri options: @@ -68,6 +95,13 @@ properties: type: array items: $ref: ./ProductVariant.yaml + categories: + description: >- + The product's associated categories. Available if the relation + `categories` are expanded. + type: array + items: + $ref: ./ProductCategory.yaml profile_id: description: >- The ID of the Shipping Profile that the Product belongs to. Shipping @@ -77,41 +111,48 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. + nullable: true $ref: ./ShippingProfile.yaml weight: description: >- The weight of the Product Variant. May be used in shipping rate calculations. - type: number - example: null - height: - description: >- - The height of the Product Variant. May be used in shipping rate - calculations. - type: number - example: null - width: - description: >- - The width of the Product Variant. May be used in shipping rate - calculations. + nullable: true type: number example: null length: description: >- The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: >- + The height of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + width: + description: >- + The width of the Product Variant. May be used in shipping rate + calculations. + nullable: true type: number example: null hs_code: description: >- The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null origin_country: description: >- The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null mid_code: @@ -119,6 +160,7 @@ properties: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null material: @@ -126,23 +168,28 @@ properties: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null collection_id: - type: string description: The Product Collection that the Product belongs to + nullable: true + type: string example: pcol_01F0YESBFAZ0DV6V831JXWH0BG collection: description: >- A product collection object. Available if the relation `collection` is expanded. - type: object + nullable: true + $ref: ./ProductCollection.yaml type_id: - type: string description: The Product type that the Product belongs to + nullable: true + type: string example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: Available if the relation `type` is expanded. + nullable: true $ref: ./ProductType.yaml tags: description: >- @@ -159,6 +206,7 @@ properties: default: true external_id: description: The external ID of the product + nullable: true type: string example: null sales_channels: @@ -167,30 +215,23 @@ properties: relation `sales_channels` is expanded. type: array items: - type: object - description: A sales channel object. - categories: - description: >- - The product's associated categories. Available if the relation - `categories` is expanded. - type: array - items: - type: object - description: A category object. + $ref: ./SalesChannel.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ProductCategory.yaml b/docs/api/store/components/schemas/ProductCategory.yaml index 3f9c1eb7e7..9d15054cd5 100644 --- a/docs/api/store/components/schemas/ProductCategory.yaml +++ b/docs/api/store/components/schemas/ProductCategory.yaml @@ -3,25 +3,38 @@ description: Represents a product category x-resourceId: ProductCategory type: object required: + - category_children + - created_at + - deleted_at + - handle + - id + - is_active + - is_internal + - mpath - name + - parent_category_id + - updated_at properties: id: - type: string description: The product category's ID + type: string example: pcat_01G2SG30J8C85S4A5CHM2S1NS2 name: - type: string description: The product category's name + type: string example: Regular Fit handle: - description: 'A unique string that identifies the Category - example: slug structures.' + description: >- + A unique string that identifies the Product Category - can for example be + used in slug structures. type: string example: regular-fit mpath: - type: string description: >- A string for Materialized Paths - used for finding ancestors and descendents + nullable: true + type: string example: pcat_id1.pcat_id2.pcat_id3 is_internal: type: boolean @@ -36,33 +49,34 @@ properties: type: array items: type: object - description: A product category object. parent_category_id: description: The ID of the parent category. + nullable: true type: string default: null parent_category: description: >- A product category object. Available if the relation `parent_category` is expanded. + nullable: true type: object products: description: >- - products associated with category. Available if the relation `products` is + Products associated with category. Available if the relation `products` is expanded. type: array items: type: object - description: A product object. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/store/components/schemas/ProductCollection.yaml b/docs/api/store/components/schemas/ProductCollection.yaml index 0f215f050c..f53db55c2d 100644 --- a/docs/api/store/components/schemas/ProductCollection.yaml +++ b/docs/api/store/components/schemas/ProductCollection.yaml @@ -2,11 +2,17 @@ title: Product Collection description: Product Collections represents a group of Products that are related. type: object required: + - created_at + - deleted_at + - handle + - id + - metadata - title + - updated_at properties: id: - type: string description: The product collection's ID + type: string example: pcol_01F0YESBFAZ0DV6V831JXWH0BG title: description: The title that the Product Collection is identified by. @@ -16,6 +22,7 @@ properties: description: >- A unique string that identifies the Product Collection - can for example be used in slug structures. + nullable: true type: string example: summer-collection products: @@ -25,21 +32,22 @@ properties: type: array items: type: object - description: A product collection object. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ProductOption.yaml b/docs/api/store/components/schemas/ProductOption.yaml index 0179d34d93..3de3f509d9 100644 --- a/docs/api/store/components/schemas/ProductOption.yaml +++ b/docs/api/store/components/schemas/ProductOption.yaml @@ -5,15 +5,20 @@ description: >- limit what Product Options that can be defined. type: object required: - - title + - created_at + - deleted_at + - id + - metadata - product_id + - title + - updated_at properties: id: - type: string description: The product option's ID + type: string example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 title: - description: The title that the Product Option is defined by (e.g. "Size"). + description: The title that the Product Option is defined by (e.g. `Size`). type: string example: Size values: @@ -29,21 +34,24 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: A product object. Available if the relation `product` is expanded. + nullable: true type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ProductOptionValue.yaml b/docs/api/store/components/schemas/ProductOptionValue.yaml index 467e538803..b247b13506 100644 --- a/docs/api/store/components/schemas/ProductOptionValue.yaml +++ b/docs/api/store/components/schemas/ProductOptionValue.yaml @@ -4,19 +4,24 @@ description: >- Product Option Value for each of the Product Options defined on the Product. type: object required: - - value + - created_at + - deleted_at + - id + - metadata - option_id + - updated_at + - value - variant_id properties: id: - type: string description: The product option value's ID + type: string example: optval_01F0YESHR7S6ECD03RF6W12DSJ value: description: >- The value that the Product Variant has defined for the specific Product - Option (e.g. if the Product Option is "Size" this value could be "Small", - "Medium" or "Large"). + Option (e.g. if the Product Option is \"Size\" this value could be + `Small`, `Medium` or `Large`). type: string example: large option_id: @@ -25,7 +30,8 @@ properties: example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. - $ref: ./ProductOption.yaml + nullable: true + type: object variant_id: description: >- The ID of the Product Variant that the Product Option Value is defined @@ -34,21 +40,24 @@ properties: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: Available if the relation `variant` is expanded. - $ref: ./ProductVariant.yaml + nullable: true + type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ProductTag.yaml b/docs/api/store/components/schemas/ProductTag.yaml index 615174509c..7faa4a2c1b 100644 --- a/docs/api/store/components/schemas/ProductTag.yaml +++ b/docs/api/store/components/schemas/ProductTag.yaml @@ -2,30 +2,37 @@ title: Product Tag description: Product Tags can be added to Products for easy filtering and grouping. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The product tag's ID + type: string example: ptag_01G8K2MTMG9168F2B70S1TAVK3 value: description: The value that the Product Tag represents type: string example: Pants created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ProductTaxRate.yaml b/docs/api/store/components/schemas/ProductTaxRate.yaml index a179b64cdd..d92b163428 100644 --- a/docs/api/store/components/schemas/ProductTaxRate.yaml +++ b/docs/api/store/components/schemas/ProductTaxRate.yaml @@ -4,8 +4,11 @@ description: >- a certain way type: object required: + - created_at + - metadata - product_id - rate_id + - updated_at properties: product_id: description: The ID of the Product @@ -13,6 +16,7 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: Available if the relation `product` is expanded. + nullable: true $ref: ./Product.yaml rate_id: description: The ID of the Tax Rate @@ -20,17 +24,19 @@ properties: example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. + nullable: true $ref: ./TaxRate.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ProductType.yaml b/docs/api/store/components/schemas/ProductType.yaml index 88555b5bf4..579e7a6fb4 100644 --- a/docs/api/store/components/schemas/ProductType.yaml +++ b/docs/api/store/components/schemas/ProductType.yaml @@ -2,30 +2,37 @@ title: Product Type description: Product Type can be added to Products for filtering and reporting purposes. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The product type's ID + type: string example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A value: description: The value that the Product Type represents. type: string example: Clothing created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ProductTypeTaxRate.yaml b/docs/api/store/components/schemas/ProductTypeTaxRate.yaml index a11a7ba760..4539a32fc5 100644 --- a/docs/api/store/components/schemas/ProductTypeTaxRate.yaml +++ b/docs/api/store/components/schemas/ProductTypeTaxRate.yaml @@ -4,8 +4,11 @@ description: >- taxed in a certain way type: object required: + - created_at + - metadata - product_type_id - rate_id + - updated_at properties: product_type_id: description: The ID of the Product type @@ -13,6 +16,7 @@ properties: example: ptyp_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. + nullable: true $ref: ./ProductType.yaml rate_id: description: The id of the Tax Rate @@ -20,17 +24,19 @@ properties: example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. + nullable: true $ref: ./TaxRate.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ProductVariant.yaml b/docs/api/store/components/schemas/ProductVariant.yaml index 3079f7bb14..7f9d451c41 100644 --- a/docs/api/store/components/schemas/ProductVariant.yaml +++ b/docs/api/store/components/schemas/ProductVariant.yaml @@ -5,13 +5,32 @@ description: >- is given by the number of available Product Option combinations. type: object required: - - title - - product_id + - allow_backorder + - barcode + - created_at + - deleted_at + - ean + - height + - hs_code + - id - inventory_quantity + - length + - manage_inventory + - material + - metadata + - mid_code + - origin_country + - product_id + - sku + - title + - upc + - updated_at + - weight + - width properties: id: - type: string description: The product variant's ID + type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 title: description: >- @@ -25,6 +44,7 @@ properties: example: prod_01G1G5V2MBA328390B5AXJ610F product: description: A product object. Available if the relation `product` is expanded. + nullable: true type: object prices: description: >- @@ -39,24 +59,29 @@ properties: The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems. + nullable: true type: string example: shirt-123 barcode: description: >- A generic field for a GTIN number that can be used to identify the Product Variant. + nullable: true type: string example: null ean: description: An EAN barcode number that can be used to identify the Product Variant. + nullable: true type: string example: null upc: description: A UPC barcode number that can be used to identify the Product Variant. + nullable: true type: string example: null variant_rank: description: The ranking of this variant + nullable: true type: number default: 0 inventory_quantity: @@ -77,12 +102,14 @@ properties: description: >- The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null origin_country: description: >- The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null mid_code: @@ -90,6 +117,7 @@ properties: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null material: @@ -97,30 +125,35 @@ properties: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + nullable: true type: string example: null weight: description: >- The weight of the Product Variant. May be used in shipping rate calculations. - type: number - example: null - height: - description: >- - The height of the Product Variant. May be used in shipping rate - calculations. - type: number - example: null - width: - description: >- - The width of the Product Variant. May be used in shipping rate - calculations. + nullable: true type: number example: null length: description: >- The length of the Product Variant. May be used in shipping rate calculations. + nullable: true + type: number + example: null + height: + description: >- + The height of the Product Variant. May be used in shipping rate + calculations. + nullable: true + type: number + example: null + width: + description: >- + The width of the Product Variant. May be used in shipping rate + calculations. + nullable: true type: number example: null options: @@ -130,20 +163,29 @@ properties: type: array items: $ref: ./ProductOptionValue.yaml + inventory_items: + description: >- + The Inventory Items related to the product variant. Available if the + relation `inventory_items` is expanded. + type: array + items: + $ref: ./ProductVariantInventoryItem.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ProductVariantInventoryItem.yaml b/docs/api/store/components/schemas/ProductVariantInventoryItem.yaml index f583f59667..d2f658ecfb 100644 --- a/docs/api/store/components/schemas/ProductVariantInventoryItem.yaml +++ b/docs/api/store/components/schemas/ProductVariantInventoryItem.yaml @@ -3,10 +3,18 @@ description: >- Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant. type: object +required: + - created_at + - deleted_at + - id + - inventory_item_id + - required_quantity + - updated_at + - variant_id properties: id: - type: string description: The product variant inventory item's ID + type: string example: pvitem_01G8X9A7ESKAJXG2H0E6F1MW7A inventory_item_id: description: The id of the inventory item @@ -14,6 +22,10 @@ properties: variant_id: description: The id of the variant. type: string + variant: + description: A ProductVariant object. Available if the relation `variant` is expanded. + nullable: true + type: object required_quantity: description: >- The quantity of an inventory item required for one quantity of the @@ -21,14 +33,15 @@ properties: type: integer default: 1 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/store/components/schemas/PublishableApiKey.yaml b/docs/api/store/components/schemas/PublishableApiKey.yaml index 38818bccaf..dffb94d446 100644 --- a/docs/api/store/components/schemas/PublishableApiKey.yaml +++ b/docs/api/store/components/schemas/PublishableApiKey.yaml @@ -3,34 +3,42 @@ description: >- Publishable API key defines scopes (i.e. resources) that are available within a request. type: object +required: + - created_at + - created_by + - id + - revoked_by + - revoked_at + - title + - updated_at properties: id: - type: string description: The key's ID + type: string example: pk_01G1G5V27GYX4QXNARRQCW1N8T created_by: - type: string description: The unique identifier of the user that created the key. - example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V - created_by_user: - description: A user object. Available if the relation `created_by_user` is expanded. - type: object - created_at: + nullable: true type: string - description: The date with timezone at which the resource was created. - format: date-time + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V revoked_by: - type: string description: The unique identifier of the user that revoked the key. - example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V - revoked_by_user: - description: A user object. Available if the relation `revoked_by_user` is expanded. - type: object - revoked_at: + nullable: true type: string + example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + revoked_at: description: The date with timezone at which the key was revoked. + nullable: true + type: string + format: date-time + title: + description: The key's title. + type: string + created_at: + description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time diff --git a/docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml b/docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml index e2461daba5..ac6c018ad7 100644 --- a/docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml +++ b/docs/api/store/components/schemas/PublishableApiKeySalesChannel.yaml @@ -1,12 +1,15 @@ title: Publishable API key sales channel description: Holds mapping between Publishable API keys and Sales Channels type: object +required: + - publishable_key_id + - sales_channel_id properties: sales_channel_id: - type: string description: The sales channel's ID + type: string example: sc_01G1G5V21KADXNGH29BJMAJ4B4 publishable_key_id: - type: string description: The publishable API key's ID + type: string example: pak_01G1G5V21KADXNGH29BJMAJ4B4 diff --git a/docs/api/store/components/schemas/Refund.yaml b/docs/api/store/components/schemas/Refund.yaml index 936eb3842c..fa82dfc64e 100644 --- a/docs/api/store/components/schemas/Refund.yaml +++ b/docs/api/store/components/schemas/Refund.yaml @@ -5,23 +5,46 @@ description: >- can also be initiated by a store operator. type: object required: - - order_id - amount + - created_at + - id + - idempotency_key + - metadata + - note + - order_id + - payment_id + - reason + - updated_at properties: id: - type: string description: The refund's ID + type: string example: ref_01G1G5V27GYX4QXNARRQCW1N8T order_id: description: The id of the Order that the Refund is related to. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true + type: object + payment_id: + description: The payment's ID if available + nullable: true + type: string + example: pay_01G8ZCC5W42ZNY842124G7P5R9 + payment: + description: Available if the relation `payment` is expanded. + nullable: true + type: object amount: description: The amount that has be refunded to the Customer. type: integer example: 1000 note: description: An optional note explaining why the amount was refunded. + nullable: true type: string example: I didn't like it reason: @@ -37,28 +60,26 @@ properties: - other example: return idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the refund in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/Region.yaml b/docs/api/store/components/schemas/Region.yaml index 89b86870dc..a8df502e1f 100644 --- a/docs/api/store/components/schemas/Region.yaml +++ b/docs/api/store/components/schemas/Region.yaml @@ -6,13 +6,22 @@ description: >- countries. type: object required: - - name + - automatic_taxes + - created_at - currency_code + - deleted_at + - gift_cards_taxable + - id + - metadata + - name + - tax_code + - tax_provider_id - tax_rate + - updated_at properties: id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: description: >- @@ -29,6 +38,7 @@ properties: description: See a list of codes. currency: description: Available if the relation `currency` is expanded. + nullable: true $ref: ./Currency.yaml tax_rate: description: The tax rate that should be charged on purchases in the Region. @@ -45,6 +55,7 @@ properties: description: >- The tax code used on purchases in the Region. This may be used by other systems for accounting purposes. + nullable: true type: string example: null gift_cards_taxable: @@ -63,11 +74,13 @@ properties: items: $ref: ./Country.yaml tax_provider_id: - type: string description: The ID of the tax provider used in this region + nullable: true + type: string example: null tax_provider: description: Available if the relation `tax_provider` is expanded. + nullable: true $ref: ./TaxProvider.yaml payment_providers: description: >- @@ -79,27 +92,30 @@ properties: fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the - Region. Available if the relation `payment_providers` is expanded. + Region. Available if the relation `fulfillment_providers` is expanded. type: array items: $ref: ./FulfillmentProvider.yaml includes_tax: description: '[EXPERIMENTAL] Does the prices for the region include tax' type: boolean + default: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/Return.yaml b/docs/api/store/components/schemas/Return.yaml index 406389b61d..dfbb629cea 100644 --- a/docs/api/store/components/schemas/Return.yaml +++ b/docs/api/store/components/schemas/Return.yaml @@ -5,11 +5,24 @@ description: >- of a Swap. type: object required: + - claim_order_id + - created_at + - id + - idempotency_key + - location_id + - metadata + - no_notification + - order_id + - received_at - refund_amount + - shipping_data + - status + - swap_id + - updated_at properties: id: - type: string description: The return's ID + type: string example: ret_01F0YET7XPCMF8RZ0Y151NZV2V status: description: Status of the Return. @@ -29,70 +42,85 @@ properties: $ref: ./ReturnItem.yaml swap_id: description: The ID of the Swap that the Return is a part of. + nullable: true type: string example: null swap: description: A swap object. Available if the relation `swap` is expanded. - type: object - order_id: - description: The ID of the Order that the Return is made from. - type: string - example: order_01G8TJSYT9M6AVS5N4EMNFS1EK - order: - description: An order object. Available if the relation `order` is expanded. + nullable: true type: object claim_order_id: description: The ID of the Claim that the Return is a part of. + nullable: true type: string example: null claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true + type: object + order_id: + description: The ID of the Order that the Return is made from. + nullable: true + type: string + example: order_01G8TJSYT9M6AVS5N4EMNFS1EK + order: + description: An order object. Available if the relation `order` is expanded. + nullable: true type: object shipping_method: description: >- The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded. - type: array - items: - $ref: ./ShippingMethod.yaml + nullable: true + $ref: ./ShippingMethod.yaml shipping_data: description: >- Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment. + nullable: true type: object example: {} + location_id: + description: The id of the stock location the return will be added back. + nullable: true + type: string + example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK refund_amount: description: The amount that should be refunded as a result of the return. type: integer example: 1000 no_notification: description: When set to true, no notification will be sent related to this return. + nullable: true type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the return in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. received_at: description: The date with timezone at which the return was received. + nullable: true type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ReturnItem.yaml b/docs/api/store/components/schemas/ReturnItem.yaml index d56d8604a5..f2e6e78b7a 100644 --- a/docs/api/store/components/schemas/ReturnItem.yaml +++ b/docs/api/store/components/schemas/ReturnItem.yaml @@ -4,22 +4,31 @@ description: >- Line Item that will be returned. type: object required: - - return_id + - is_requested - item_id + - metadata + - note + - quantity + - reason_id + - received_quantity + - requested_quantity + - return_id properties: return_id: description: The id of the Return that the Return Item belongs to. type: string example: ret_01F0YET7XPCMF8RZ0Y151NZV2V - return_order: - description: Available if the relation `return_order` is expanded. - $ref: ./Return.yaml item_id: description: The id of the Line Item that the Return Item references. type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN + return_order: + description: Available if the relation `return_order` is expanded. + nullable: true + type: object item: description: Available if the relation `item` is expanded. + nullable: true $ref: ./LineItem.yaml quantity: description: The quantity of the Line Item that is included in the Return. @@ -33,25 +42,31 @@ properties: default: true requested_quantity: description: The quantity that was originally requested to be returned. + nullable: true type: integer example: 1 - recieved_quantity: + received_quantity: description: The quantity that was received in the warehouse. + nullable: true type: integer example: 1 reason_id: description: The ID of the reason for returning the item. + nullable: true type: string example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ reason: description: Available if the relation `reason` is expanded. + nullable: true $ref: ./ReturnReason.yaml note: description: An optional note with additional details about the Return. + nullable: true type: string example: I didn't like it. metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ReturnReason.yaml b/docs/api/store/components/schemas/ReturnReason.yaml index ff9a50bf3f..37715c1fe9 100644 --- a/docs/api/store/components/schemas/ReturnReason.yaml +++ b/docs/api/store/components/schemas/ReturnReason.yaml @@ -4,49 +4,61 @@ description: >- Return Items in order to indicate why a Line Item was returned. type: object required: - - value + - created_at + - deleted_at + - description + - id - label + - metadata + - parent_return_reason_id + - updated_at + - value properties: id: + description: The return reason's ID type: string - description: The cart's ID example: rr_01G8X82GCCV2KSQHDBHSSAH5TQ - description: - description: A description of the Reason. - type: string - example: Items that are damaged - label: - description: A text that can be displayed to the Customer as a reason. - type: string - example: Damaged goods value: description: The value to identify the reason by. type: string example: damaged - parent_return_reason_id: + label: + description: A text that can be displayed to the Customer as a reason. type: string + example: Damaged goods + description: + description: A description of the Reason. + nullable: true + type: string + example: Items that are damaged + parent_return_reason_id: description: The ID of the parent reason. + nullable: true + type: string example: null parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. - $ref: ./ReturnReason.yaml + nullable: true + type: object return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: ./ReturnReason.yaml + type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/SalesChannel.yaml b/docs/api/store/components/schemas/SalesChannel.yaml index a79b3fd206..dbb40f089c 100644 --- a/docs/api/store/components/schemas/SalesChannel.yaml +++ b/docs/api/store/components/schemas/SalesChannel.yaml @@ -2,11 +2,17 @@ title: Sales Channel description: A Sales Channel type: object required: + - created_at + - deleted_at + - description + - id + - is_disabled - name + - updated_at properties: id: - type: string description: The sales channel's ID + type: string example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A name: description: The name of the sales channel. @@ -14,21 +20,30 @@ properties: example: Market description: description: The description of the sales channel. + nullable: true type: string example: Multi-vendor market is_disabled: description: Specify if the sales channel is enabled or disabled. type: boolean default: false + locations: + description: >- + The Stock Locations related to the sales channel. Available if the + relation `locations` is expanded. + type: array + items: + $ref: ./SalesChannelLocation.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/store/components/schemas/SalesChannelLocation.yaml b/docs/api/store/components/schemas/SalesChannelLocation.yaml new file mode 100644 index 0000000000..27ec4fd84b --- /dev/null +++ b/docs/api/store/components/schemas/SalesChannelLocation.yaml @@ -0,0 +1,41 @@ +title: Sales Channel Stock Location +description: Sales Channel Stock Location link sales channels with stock locations. +type: object +required: + - created_at + - deleted_at + - id + - location_id + - sales_channel_id + - updated_at +properties: + id: + description: The Sales Channel Stock Location's ID + type: string + example: scloc_01G8X9A7ESKAJXG2H0E6F1MW7A + sales_channel_id: + description: The id of the Sales Channel + type: string + example: sc_01G8X9A7ESKAJXG2H0E6F1MW7A + location_id: + description: The id of the Location Stock. + type: string + sales_channel: + description: >- + The sales channel the location is associated with. Available if the + relation `sales_channel` is expanded. + nullable: true + type: object + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time + deleted_at: + description: The date with timezone at which the resource was deleted. + nullable: true + type: string + format: date-time diff --git a/docs/api/store/components/schemas/ShippingMethod.yaml b/docs/api/store/components/schemas/ShippingMethod.yaml index 9ac6b87cc6..04dcb7020c 100644 --- a/docs/api/store/components/schemas/ShippingMethod.yaml +++ b/docs/api/store/components/schemas/ShippingMethod.yaml @@ -6,58 +6,76 @@ description: >- shipment. type: object required: - - shipping_option_id + - cart_id + - claim_order_id + - data + - id + - order_id - price + - return_id + - shipping_option_id + - swap_id properties: id: - type: string description: The shipping method's ID + type: string example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_option_id: description: The id of the Shipping Option that the Shipping Method is built from. type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T - shipping_option: - description: Available if the relation `shipping_option` is expanded. - $ref: ./ShippingOption.yaml order_id: description: The id of the Order that the Shipping Method is used on. + nullable: true type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. - type: object - return_id: - description: The id of the Return that the Shipping Method is used on. - type: string - example: null - return_order: - description: A return object. Available if the relation `return_order` is expanded. - type: object - swap_id: - description: The id of the Swap that the Shipping Method is used on. - type: string - example: null - swap: - description: A swap object. Available if the relation `swap` is expanded. - type: object - cart_id: - description: The id of the Cart that the Shipping Method is used on. - type: string - example: cart_01G8ZH853Y6TFXWPG5EYE81X63 - cart: - description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object claim_order_id: description: The id of the Claim that the Shipping Method is used on. + nullable: true type: string example: null claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object + cart_id: + description: The id of the Cart that the Shipping Method is used on. + nullable: true + type: string + example: cart_01G8ZH853Y6TFXWPG5EYE81X63 + cart: + description: A cart object. Available if the relation `cart` is expanded. + nullable: true + type: object + swap_id: + description: The id of the Swap that the Shipping Method is used on. + nullable: true + type: string + example: null + swap: + description: A swap object. Available if the relation `swap` is expanded. + nullable: true + type: object + return_id: + description: The id of the Return that the Shipping Method is used on. + nullable: true + type: string + example: null + return_order: + description: A return object. Available if the relation `return_order` is expanded. + nullable: true + type: object + shipping_option: + description: Available if the relation `shipping_option` is expanded. + nullable: true + $ref: ./ShippingOption.yaml tax_lines: - type: array description: Available if the relation `tax_lines` is expanded. + type: array items: $ref: ./ShippingMethodTaxLine.yaml price: @@ -77,3 +95,16 @@ properties: includes_tax: description: '[EXPERIMENTAL] Indicates if the shipping method price include tax' type: boolean + default: false + subtotal: + description: The subtotal of the shipping + type: integer + example: 8000 + total: + description: The total amount of the shipping + type: integer + example: 8200 + tax_total: + description: The total of tax + type: integer + example: 0 diff --git a/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml b/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml index 1089796789..d251624dca 100644 --- a/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml +++ b/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml @@ -2,23 +2,22 @@ title: Shipping Method Tax Line description: Shipping Method Tax Line type: object required: + - code + - created_at + - id - shipping_method_id - - rate + - metadata - name + - rate + - updated_at properties: id: - type: string description: The line item tax line's ID - example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 - shipping_method_id: type: string - description: The ID of the line item - example: sm_01F0YET7DR2E7CYVSDHM593QG2 - shipping_method: - description: Available if the relation `shipping_method` is expanded. - $ref: ./ShippingMethod.yaml + example: smtl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 code: description: A code to identify the tax type by + nullable: true type: string example: tax01 name: @@ -29,16 +28,25 @@ properties: description: The numeric rate to charge tax by type: number example: 10 - created_at: + shipping_method_id: + description: The ID of the line item type: string + example: sm_01F0YET7DR2E7CYVSDHM593QG2 + shipping_method: + description: Available if the relation `shipping_method` is expanded. + nullable: true + type: object + created_at: description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ShippingOption.yaml b/docs/api/store/components/schemas/ShippingOption.yaml index 0efbef070c..a8eebad545 100644 --- a/docs/api/store/components/schemas/ShippingOption.yaml +++ b/docs/api/store/components/schemas/ShippingOption.yaml @@ -8,15 +8,24 @@ description: >- additional information. type: object required: + - admin_only + - amount + - created_at + - data + - deleted_at + - id + - is_return + - metadata - name - - region_id + - price_type - profile_id - provider_id - - price_type + - region_id + - updated_at properties: id: - type: string description: The shipping option's ID + type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T name: description: >- @@ -25,11 +34,12 @@ properties: type: string example: PostFake Standard region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. + nullable: true type: object profile_id: description: >- @@ -40,6 +50,7 @@ properties: example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. + nullable: true $ref: ./ShippingProfile.yaml provider_id: description: >- @@ -49,6 +60,7 @@ properties: example: manual provider: description: Available if the relation `provider` is expanded. + nullable: true $ref: ./FulfillmentProvider.yaml price_type: description: >- @@ -64,12 +76,19 @@ properties: description: >- The amount to charge for shipping when the Shipping Option price type is `flat_rate`. + nullable: true type: integer example: 200 is_return: description: Flag to indicate if the Shipping Option can be used for Return shipments. type: boolean default: false + admin_only: + description: >- + Flag to indicate if the Shipping Option usage is restricted to admin + users. + type: boolean + default: false requirements: description: >- The requirements that must be satisfied for the Shipping Option to be @@ -87,20 +106,23 @@ properties: includes_tax: description: '[EXPERIMENTAL] Does the shipping option price include tax' type: boolean + default: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ShippingOptionRequirement.yaml b/docs/api/store/components/schemas/ShippingOptionRequirement.yaml index bebafda0ea..57d045827c 100644 --- a/docs/api/store/components/schemas/ShippingOptionRequirement.yaml +++ b/docs/api/store/components/schemas/ShippingOptionRequirement.yaml @@ -4,13 +4,15 @@ description: >- to the Cart. type: object required: + - amount + - deleted_at + - id - shipping_option_id - type - - amount properties: id: - type: string description: The shipping option requirement's ID + type: string example: sor_01G1G5V29AB4CTNDRFSRWSRKWD shipping_option_id: description: >- @@ -20,7 +22,8 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. - $ref: ./ShippingOption.yaml + nullable: true + type: object type: description: >- The type of the requirement, this defines how the value will be compared @@ -38,6 +41,7 @@ properties: type: integer example: 100 deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/store/components/schemas/ShippingProfile.yaml b/docs/api/store/components/schemas/ShippingProfile.yaml index 0afd646078..15ffd42c84 100644 --- a/docs/api/store/components/schemas/ShippingProfile.yaml +++ b/docs/api/store/components/schemas/ShippingProfile.yaml @@ -4,12 +4,17 @@ description: >- fulfill a given set of Products. type: object required: + - created_at + - deleted_at + - id + - metadata - name - type + - updated_at properties: id: - type: string description: The shipping profile's ID + type: string example: sp_01G1G5V239ENSZ5MV4JAR737BM name: description: >- @@ -34,7 +39,6 @@ properties: type: array items: type: object - description: A product object. shipping_options: description: >- The Shipping Options that can be used to fulfill the Products in the @@ -42,21 +46,23 @@ properties: expanded. type: array items: - $ref: ./ShippingOption.yaml + type: object created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ShippingTaxRate.yaml b/docs/api/store/components/schemas/ShippingTaxRate.yaml index 7ab7938fb0..78734007ac 100644 --- a/docs/api/store/components/schemas/ShippingTaxRate.yaml +++ b/docs/api/store/components/schemas/ShippingTaxRate.yaml @@ -4,8 +4,11 @@ description: >- option is taxed in a certain way type: object required: - - shipping_option_id + - created_at + - metadata - rate_id + - shipping_option_id + - updated_at properties: shipping_option_id: description: The ID of the Shipping Option @@ -13,6 +16,7 @@ properties: example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. + nullable: true $ref: ./ShippingOption.yaml rate_id: description: The ID of the Tax Rate @@ -20,17 +24,19 @@ properties: example: txr_01G8XDBAWKBHHJRKH0AV02KXBR tax_rate: description: Available if the relation `tax_rate` is expanded. + nullable: true $ref: ./TaxRate.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/StagedJob.yaml b/docs/api/store/components/schemas/StagedJob.yaml index a31192dbdc..adc7c6beab 100644 --- a/docs/api/store/components/schemas/StagedJob.yaml +++ b/docs/api/store/components/schemas/StagedJob.yaml @@ -2,11 +2,14 @@ title: Staged Job description: A staged job resource type: object required: + - data - event_name + - id + - options properties: id: - type: string description: The staged job's ID + type: string example: job_01F0YET7BZTARY9MKN1SJ7AAXF event_name: description: The name of the event @@ -16,3 +19,7 @@ properties: description: Data necessary for the job type: object example: {} + option: + description: The staged job's option + type: object + example: {} diff --git a/docs/api/store/components/schemas/Store.yaml b/docs/api/store/components/schemas/Store.yaml index d96015e522..93232178dc 100644 --- a/docs/api/store/components/schemas/Store.yaml +++ b/docs/api/store/components/schemas/Store.yaml @@ -1,10 +1,21 @@ title: Store description: Holds settings for the Store, such as name, currencies, etc. type: object +required: + - created_at + - default_currency_code + - default_location_id + - id + - invite_link_template + - metadata + - name + - payment_link_template + - swap_link_template + - updated_at properties: id: - type: string description: The store's ID + type: string example: store_01G1G5V21KADXNGH29BJMAJ4B4 name: description: The name of the Store - this may be displayed to the Customer. @@ -19,6 +30,7 @@ properties: description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. + nullable: true $ref: ./Currency.yaml currencies: description: >- @@ -31,29 +43,48 @@ properties: description: >- A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link. + nullable: true type: string example: null payment_link_template: description: >- A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link. + nullable: true type: string example: null invite_link_template: description: A template to generate Invite links from + nullable: true + type: string + example: null + default_location_id: + description: The location ID the store is associated with. + nullable: true type: string example: null default_sales_channel_id: - type: string description: The sales channel ID the cart is associated with. + nullable: true + type: string example: null default_sales_channel: description: >- A sales channel object. Available if the relation `default_sales_channel` is expanded. - type: object + nullable: true + $ref: ./SalesChannel.yaml + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + updated_at: + description: The date with timezone at which the resource was updated. + type: string + format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/Swap.yaml b/docs/api/store/components/schemas/Swap.yaml index 97a560fcc8..e4ab8da2b8 100644 --- a/docs/api/store/components/schemas/Swap.yaml +++ b/docs/api/store/components/schemas/Swap.yaml @@ -9,13 +9,26 @@ description: >- difference. type: object required: + - allow_backorder + - canceled_at + - cart_id + - confirmed_at + - created_at + - deleted_at + - difference_due - fulfillment_status - - payment_status + - id + - idempotency_key + - metadata + - no_notification - order_id + - payment_status + - shipping_address_id + - updated_at properties: id: - type: string description: The swap's ID + type: string example: swap_01F0YET86Y9G92D3YDR9Y6V676 fulfillment_status: description: The status of the Fulfillment of the Swap. @@ -24,6 +37,7 @@ properties: - not_fulfilled - fulfilled - shipped + - partially_shipped - canceled - requires_action example: not_fulfilled @@ -49,6 +63,7 @@ properties: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object additional_items: description: >- @@ -61,6 +76,7 @@ properties: description: >- A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded. + nullable: true type: object fulfillments: description: >- @@ -74,22 +90,26 @@ properties: The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. + nullable: true type: object difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products. + nullable: true type: integer example: 0 shipping_address_id: description: >- The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. + nullable: true type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_methods: description: >- @@ -100,50 +120,58 @@ properties: $ref: ./ShippingMethod.yaml cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object + confirmed_at: + description: The date with timezone at which the Swap was confirmed by the Customer. + nullable: true + type: string + format: date-time + canceled_at: + description: The date with timezone at which the Swap was canceled. + nullable: true + type: string + format: date-time + no_notification: + description: If set to true, no notification will be sent related to this swap + nullable: true + type: boolean + example: false allow_backorder: description: If true, swaps can be completed with items out of stock type: boolean default: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the swap in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. - confirmed_at: - description: The date with timezone at which the Swap was confirmed by the Customer. - type: string - format: date-time - canceled_at: - description: The date with timezone at which the Swap was canceled. - type: string - format: date-time - no_notification: - description: If set to true, no notification will be sent related to this swap - type: boolean - example: false created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/TaxLine.yaml b/docs/api/store/components/schemas/TaxLine.yaml index 3300d86797..cca22c81f3 100644 --- a/docs/api/store/components/schemas/TaxLine.yaml +++ b/docs/api/store/components/schemas/TaxLine.yaml @@ -2,15 +2,21 @@ title: Tax Line description: Line item that specifies an amount of tax to add to a line item. type: object required: - - rate + - code + - created_at + - id + - metadata - name + - rate + - updated_at properties: id: - type: string description: The tax line's ID + type: string example: tl_01G1G5V2DRX1SK6NQQ8VVX4HQ8 code: description: A code to identify the tax type by + nullable: true type: string example: tax01 name: @@ -22,15 +28,16 @@ properties: type: number example: 10 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/TaxProvider.yaml b/docs/api/store/components/schemas/TaxProvider.yaml index dc2b7ef07e..55c326d81c 100644 --- a/docs/api/store/components/schemas/TaxProvider.yaml +++ b/docs/api/store/components/schemas/TaxProvider.yaml @@ -1,6 +1,9 @@ title: Tax Provider description: The tax service used to calculate taxes type: object +required: + - id + - is_installed properties: id: description: The id of the tax provider as given by the plugin. diff --git a/docs/api/store/components/schemas/TaxRate.yaml b/docs/api/store/components/schemas/TaxRate.yaml index 48ff10fd0c..deb3f4d02e 100644 --- a/docs/api/store/components/schemas/TaxRate.yaml +++ b/docs/api/store/components/schemas/TaxRate.yaml @@ -4,19 +4,27 @@ description: >- within a given Region type: object required: + - code + - created_at + - id + - metadata - name + - rate - region_id + - updated_at properties: id: - type: string description: The tax rate's ID + type: string example: txr_01G8XDBAWKBHHJRKH0AV02KXBR rate: description: The numeric rate to charge + nullable: true type: number example: 10 code: description: A code to identify the tax type by + nullable: true type: string example: tax01 name: @@ -24,58 +32,57 @@ properties: type: string example: Tax Example region_id: - type: string description: The id of the Region that the rate belongs to + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. + nullable: true type: object products: - type: array description: >- The products that belong to this tax rate. Available if the relation `products` is expanded. - items: - type: object - description: A product object. - product_types: type: array + items: + $ref: ./Product.yaml + product_types: description: >- The product types that belong to this tax rate. Available if the relation `product_types` is expanded. + type: array items: - type: object - description: A product type object. + $ref: ./ProductType.yaml shipping_options: type: array description: >- The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. items: - type: object - description: A shipping option object. + $ref: ./ShippingOption.yaml product_count: description: The count of products type: integer - example: null + example: 10 product_type_count: description: The count of product types type: integer - example: null + example: 2 shipping_option_count: description: The count of shipping options type: integer - example: null + example: 1 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/TrackingLink.yaml b/docs/api/store/components/schemas/TrackingLink.yaml index 85a7f696e7..eb8ccde118 100644 --- a/docs/api/store/components/schemas/TrackingLink.yaml +++ b/docs/api/store/components/schemas/TrackingLink.yaml @@ -5,15 +5,23 @@ description: >- status of the shipment. type: object required: - - tracking_number + - created_at + - deleted_at - fulfillment_id + - id + - idempotency_key + - metadata + - tracking_number + - updated_at + - url properties: id: - type: string description: The tracking link's ID + type: string example: tlink_01G8ZH853Y6TFXWPG5EYE81X63 url: description: The URL at which the status of the shipment can be tracked. + nullable: true type: string format: uri tracking_number: @@ -21,35 +29,39 @@ properties: type: string format: RH370168054CN fulfillment_id: - type: string description: The id of the Fulfillment that the Tracking Link references. + type: string example: ful_01G8ZRTMQCA76TXNAT81KPJZRF fulfillment: description: Available if the relation `fulfillment` is expanded. - $ref: ./Fulfillment.yaml + nullable: true + type: object idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a process in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/User.yaml b/docs/api/store/components/schemas/User.yaml index c35e299a8f..cdf5cf7506 100644 --- a/docs/api/store/components/schemas/User.yaml +++ b/docs/api/store/components/schemas/User.yaml @@ -2,42 +2,64 @@ title: User description: Represents a User who can manage store settings. type: object required: + - api_token + - created_at + - deleted_at - email + - first_name + - id + - last_name + - metadata + - role + - updated_at properties: id: - type: string description: The user's ID + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V + role: + description: The user's role + type: string + enum: + - admin + - member + - developer + default: member email: description: The email of the User type: string format: email first_name: description: The first name of the User + nullable: true type: string example: Levi last_name: description: The last name of the User + nullable: true type: string example: Bogan api_token: description: An API token associated with the user. + nullable: true type: string example: null created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/content/references/services/classes/AnalyticsConfigService.md b/docs/content/references/services/classes/AnalyticsConfigService.md index 3579233f43..73ec735d59 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/f8d635845/packages/medusa/src/services/analytics-config.ts#L24) +[packages/medusa/src/services/analytics-config.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/analytics-config.ts#L21) +[packages/medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/analytics-config.ts#L21) ___ @@ -90,7 +90,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/analytics-config.ts#L18) +[packages/medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/analytics-config.ts#L18) ___ @@ -104,7 +104,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/analytics-config.ts#L19) +[packages/medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/analytics-config.ts#L19) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[packages/medusa/src/services/analytics-config.ts:22](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/analytics-config.ts#L22) +[packages/medusa/src/services/analytics-config.ts:22](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/analytics-config.ts#L22) ## Methods @@ -153,7 +153,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -176,7 +176,7 @@ Creates an analytics config. #### Defined in -[packages/medusa/src/services/analytics-config.ts:56](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/analytics-config.ts#L56) +[packages/medusa/src/services/analytics-config.ts:56](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/analytics-config.ts#L56) ___ @@ -198,7 +198,7 @@ Deletes an analytics config. #### Defined in -[packages/medusa/src/services/analytics-config.ts:103](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/analytics-config.ts#L103) +[packages/medusa/src/services/analytics-config.ts:103](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/analytics-config.ts#L103) ___ @@ -218,7 +218,7 @@ ___ #### Defined in -[packages/medusa/src/services/analytics-config.ts:32](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/analytics-config.ts#L32) +[packages/medusa/src/services/analytics-config.ts:32](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/analytics-config.ts#L32) ___ @@ -242,7 +242,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -265,7 +265,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/f8d635845/packages/medusa/src/services/analytics-config.ts#L72) +[packages/medusa/src/services/analytics-config.ts:72](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/analytics-config.ts#L72) ___ @@ -289,4 +289,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/AuthService.md b/docs/content/references/services/classes/AuthService.md index d5fd540674..a87810a668 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/f8d635845/packages/medusa/src/services/auth.ts#L24) +[packages/medusa/src/services/auth.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/auth.ts#L22) +[packages/medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/auth.ts#L22) ___ @@ -92,7 +92,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/auth.ts#L19) +[packages/medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/auth.ts#L19) ___ @@ -106,7 +106,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/auth.ts#L20) +[packages/medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/auth.ts#L20) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/auth.ts:21](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/auth.ts#L21) +[packages/medusa/src/services/auth.ts:21](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/auth.ts#L21) ## Methods @@ -155,7 +155,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -183,7 +183,7 @@ success: whether authentication succeeded #### Defined in -[packages/medusa/src/services/auth.ts:97](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/auth.ts#L97) +[packages/medusa/src/services/auth.ts:97](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/auth.ts#L97) ___ @@ -209,7 +209,7 @@ success: whether authentication succeeded #### Defined in -[packages/medusa/src/services/auth.ts:54](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/auth.ts#L54) +[packages/medusa/src/services/auth.ts:54](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/auth.ts#L54) ___ @@ -237,7 +237,7 @@ success: whether authentication succeeded #### Defined in -[packages/medusa/src/services/auth.ts:146](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/auth.ts#L146) +[packages/medusa/src/services/auth.ts:146](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/auth.ts#L146) ___ @@ -262,7 +262,7 @@ the result of the comparison #### Defined in -[packages/medusa/src/services/auth.ts:38](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/auth.ts#L38) +[packages/medusa/src/services/auth.ts:38](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/auth.ts#L38) ___ @@ -286,7 +286,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -310,4 +310,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/BatchJobService.md b/docs/content/references/services/classes/BatchJobService.md index cee9cc3f91..8444eabe71 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/f8d635845/packages/medusa/src/services/batch-job.ts#L93) +[packages/medusa/src/services/batch-job.ts:93](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L41) +[packages/medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L41) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L45) +[packages/medusa/src/services/batch-job.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L45) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:42](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L42) +[packages/medusa/src/services/batch-job.ts:42](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L42) ___ @@ -110,7 +110,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/batch-job.ts:38](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L38) +[packages/medusa/src/services/batch-job.ts:38](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L38) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L43) +[packages/medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L43) ___ @@ -134,7 +134,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L39) +[packages/medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L39) ___ @@ -157,7 +157,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L27) +[packages/medusa/src/services/batch-job.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L27) ## Methods @@ -196,7 +196,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -216,7 +216,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:277](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L277) +[packages/medusa/src/services/batch-job.ts:277](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L277) ___ @@ -236,7 +236,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:259](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L259) +[packages/medusa/src/services/batch-job.ts:259](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L259) ___ @@ -256,7 +256,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:241](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L241) +[packages/medusa/src/services/batch-job.ts:241](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L241) ___ @@ -276,7 +276,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:146](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L146) +[packages/medusa/src/services/batch-job.ts:146](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L146) ___ @@ -297,7 +297,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:135](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L135) +[packages/medusa/src/services/batch-job.ts:135](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L135) ___ @@ -318,7 +318,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:374](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L374) +[packages/medusa/src/services/batch-job.ts:374](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L374) ___ @@ -339,7 +339,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:108](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L108) +[packages/medusa/src/services/batch-job.ts:108](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L108) ___ @@ -360,7 +360,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:348](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L348) +[packages/medusa/src/services/batch-job.ts:348](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L348) ___ @@ -380,7 +380,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:295](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L295) +[packages/medusa/src/services/batch-job.ts:295](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L295) ___ @@ -400,7 +400,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:328](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L328) +[packages/medusa/src/services/batch-job.ts:328](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L328) ___ @@ -424,7 +424,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -445,7 +445,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:165](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L165) +[packages/medusa/src/services/batch-job.ts:165](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L165) ___ @@ -466,7 +466,7 @@ ___ #### Defined in -[packages/medusa/src/services/batch-job.ts:206](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/batch-job.ts#L206) +[packages/medusa/src/services/batch-job.ts:206](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/batch-job.ts#L206) ___ @@ -490,4 +490,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/CacheService.md b/docs/content/references/services/classes/CacheService.md index bed2615a01..316c899d57 100644 --- a/docs/content/references/services/classes/CacheService.md +++ b/docs/content/references/services/classes/CacheService.md @@ -18,7 +18,7 @@ #### Defined in -[packages/medusa/src/services/cache.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cache.ts#L10) +[packages/medusa/src/services/cache.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cache.ts#L10) ## Properties @@ -28,7 +28,7 @@ #### Defined in -[packages/medusa/src/services/cache.ts:8](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cache.ts#L8) +[packages/medusa/src/services/cache.ts:8](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cache.ts#L8) ## Methods @@ -60,7 +60,7 @@ ICacheService.get #### Defined in -[packages/medusa/src/services/cache.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cache.ts#L40) +[packages/medusa/src/services/cache.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cache.ts#L40) ___ @@ -86,7 +86,7 @@ ICacheService.invalidate #### Defined in -[packages/medusa/src/services/cache.ts:56](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cache.ts#L56) +[packages/medusa/src/services/cache.ts:56](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cache.ts#L56) ___ @@ -116,4 +116,4 @@ ICacheService.set #### Defined in -[packages/medusa/src/services/cache.ts:22](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cache.ts#L22) +[packages/medusa/src/services/cache.ts:22](https://github.com/medusajs/medusa/blob/fefc248a4/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 ec92d55b36..1ce1c81fba 100644 --- a/docs/content/references/services/classes/CartService.md +++ b/docs/content/references/services/classes/CartService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/cart.ts:137](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L137) +[packages/medusa/src/services/cart.ts:137](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L137) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:112](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L112) +[packages/medusa/src/services/cart.ts:112](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L112) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:111](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L111) +[packages/medusa/src/services/cart.ts:111](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L111) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:130](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L130) +[packages/medusa/src/services/cart.ts:130](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L130) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:123](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L123) +[packages/medusa/src/services/cart.ts:123](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L123) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:125](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L125) +[packages/medusa/src/services/cart.ts:125](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L125) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:115](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L115) +[packages/medusa/src/services/cart.ts:115](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L115) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:133](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L133) +[packages/medusa/src/services/cart.ts:133](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L133) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:126](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L126) +[packages/medusa/src/services/cart.ts:126](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L126) ___ @@ -156,7 +156,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:132](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L132) +[packages/medusa/src/services/cart.ts:132](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L132) ___ @@ -166,7 +166,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:114](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L114) +[packages/medusa/src/services/cart.ts:114](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L114) ___ @@ -176,7 +176,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:121](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L121) +[packages/medusa/src/services/cart.ts:121](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L121) ___ @@ -190,7 +190,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/cart.ts:107](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L107) +[packages/medusa/src/services/cart.ts:107](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L107) ___ @@ -200,7 +200,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:129](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L129) +[packages/medusa/src/services/cart.ts:129](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L129) ___ @@ -210,7 +210,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:122](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L122) +[packages/medusa/src/services/cart.ts:122](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L122) ___ @@ -220,7 +220,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:113](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L113) +[packages/medusa/src/services/cart.ts:113](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L113) ___ @@ -230,7 +230,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:131](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L131) +[packages/medusa/src/services/cart.ts:131](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L131) ___ @@ -240,7 +240,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:117](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L117) +[packages/medusa/src/services/cart.ts:117](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L117) ___ @@ -250,7 +250,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:135](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L135) +[packages/medusa/src/services/cart.ts:135](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L135) ___ @@ -260,7 +260,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:116](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L116) +[packages/medusa/src/services/cart.ts:116](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L116) ___ @@ -270,7 +270,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:120](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L120) +[packages/medusa/src/services/cart.ts:120](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L120) ___ @@ -280,7 +280,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:119](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L119) +[packages/medusa/src/services/cart.ts:119](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L119) ___ @@ -290,7 +290,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:110](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L110) +[packages/medusa/src/services/cart.ts:110](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L110) ___ @@ -300,7 +300,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:124](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L124) +[packages/medusa/src/services/cart.ts:124](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L124) ___ @@ -310,7 +310,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:118](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L118) +[packages/medusa/src/services/cart.ts:118](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L118) ___ @@ -320,7 +320,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:127](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L127) +[packages/medusa/src/services/cart.ts:127](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L127) ___ @@ -330,7 +330,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:128](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L128) +[packages/medusa/src/services/cart.ts:128](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L128) ___ @@ -344,7 +344,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/cart.ts:108](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L108) +[packages/medusa/src/services/cart.ts:108](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L108) ___ @@ -362,7 +362,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:101](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L101) +[packages/medusa/src/services/cart.ts:101](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L101) ## Methods @@ -393,7 +393,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:619](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L619) +[packages/medusa/src/services/cart.ts:619](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L619) ___ @@ -421,7 +421,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:745](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L745) +[packages/medusa/src/services/cart.ts:745](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L745) ___ @@ -451,7 +451,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:2068](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2068) +[packages/medusa/src/services/cart.ts:2068](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2068) ___ @@ -479,7 +479,7 @@ void #### Defined in -[packages/medusa/src/services/cart.ts:992](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L992) +[packages/medusa/src/services/cart.ts:992](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L992) ___ @@ -505,7 +505,7 @@ Throws if discount regions does not include the cart region #### Defined in -[packages/medusa/src/services/cart.ts:1414](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1414) +[packages/medusa/src/services/cart.ts:1414](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1414) ___ @@ -531,7 +531,7 @@ Throws if discount regions does not include the cart region #### Defined in -[packages/medusa/src/services/cart.ts:1426](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1426) +[packages/medusa/src/services/cart.ts:1426](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1426) ___ @@ -552,7 +552,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:1379](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1379) +[packages/medusa/src/services/cart.ts:1379](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1379) ___ @@ -591,7 +591,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -620,7 +620,7 @@ the resulting cart #### Defined in -[packages/medusa/src/services/cart.ts:1592](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1592) +[packages/medusa/src/services/cart.ts:1592](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1592) ___ @@ -644,7 +644,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/cart.ts:320](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L320) +[packages/medusa/src/services/cart.ts:320](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L320) ___ @@ -668,7 +668,7 @@ the resultign customer object #### Defined in -[packages/medusa/src/services/cart.ts:1266](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1266) +[packages/medusa/src/services/cart.ts:1266](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1266) ___ @@ -688,7 +688,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2477](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2477) +[packages/medusa/src/services/cart.ts:2474](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2474) ___ @@ -709,7 +709,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2527](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2527) +[packages/medusa/src/services/cart.ts:2524](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2524) ___ @@ -735,7 +735,7 @@ Use decorateTotals instead #### Defined in -[packages/medusa/src/services/cart.ts:2700](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2700) +[packages/medusa/src/services/cart.ts:2697](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2697) ___ @@ -759,7 +759,7 @@ the deleted cart or undefined if the cart was not found. #### Defined in -[packages/medusa/src/services/cart.ts:2392](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2392) +[packages/medusa/src/services/cart.ts:2389](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2389) ___ @@ -784,7 +784,7 @@ the resulting cart. #### Defined in -[packages/medusa/src/services/cart.ts:1959](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1959) +[packages/medusa/src/services/cart.ts:1959](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1959) ___ @@ -804,7 +804,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2508](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2508) +[packages/medusa/src/services/cart.ts:2505](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2505) ___ @@ -830,7 +830,7 @@ custom shipping option #### Defined in -[packages/medusa/src/services/cart.ts:2175](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2175) +[packages/medusa/src/services/cart.ts:2172](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2172) ___ @@ -850,7 +850,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2751](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2751) +[packages/medusa/src/services/cart.ts:2748](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2748) ___ @@ -870,7 +870,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:456](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L456) +[packages/medusa/src/services/cart.ts:456](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L456) ___ @@ -893,7 +893,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/cart.ts:201](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L201) +[packages/medusa/src/services/cart.ts:201](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L201) ___ @@ -918,7 +918,7 @@ void #### Defined in -[packages/medusa/src/services/cart.ts:1212](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1212) +[packages/medusa/src/services/cart.ts:1212](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1212) ___ @@ -938,7 +938,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2621](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2621) +[packages/medusa/src/services/cart.ts:2618](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2618) ___ @@ -963,7 +963,7 @@ the resulting cart. #### Defined in -[packages/medusa/src/services/cart.ts:2013](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2013) +[packages/medusa/src/services/cart.ts:2013](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2013) ___ @@ -988,7 +988,7 @@ the resulting cart #### Defined in -[packages/medusa/src/services/cart.ts:1502](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1502) +[packages/medusa/src/services/cart.ts:1502](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1502) ___ @@ -1013,7 +1013,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:488](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L488) +[packages/medusa/src/services/cart.ts:488](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L488) ___ @@ -1039,7 +1039,7 @@ the cart document. #### Defined in -[packages/medusa/src/services/cart.ts:219](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L219) +[packages/medusa/src/services/cart.ts:219](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L219) ___ @@ -1063,7 +1063,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:268](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L268) +[packages/medusa/src/services/cart.ts:268](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L268) ___ @@ -1085,7 +1085,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:300](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L300) +[packages/medusa/src/services/cart.ts:300](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L300) ___ @@ -1113,7 +1113,7 @@ resolves to the updated result. #### Defined in -[packages/medusa/src/services/cart.ts:2435](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2435) +[packages/medusa/src/services/cart.ts:2432](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2432) ___ @@ -1136,7 +1136,7 @@ Selects a payment session for a cart and creates a payment object in the externa #### Defined in -[packages/medusa/src/services/cart.ts:1666](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1666) +[packages/medusa/src/services/cart.ts:1666](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1666) ___ @@ -1164,7 +1164,7 @@ the result of the update operation. #### Defined in -[packages/medusa/src/services/cart.ts:1781](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1781) +[packages/medusa/src/services/cart.ts:1781](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1781) ___ @@ -1190,7 +1190,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:2258](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2258) +[packages/medusa/src/services/cart.ts:2255](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2255) ___ @@ -1214,7 +1214,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -1234,7 +1234,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2642](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2642) +[packages/medusa/src/services/cart.ts:2639](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2639) ___ @@ -1255,7 +1255,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:1035](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1035) +[packages/medusa/src/services/cart.ts:1035](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1035) ___ @@ -1281,7 +1281,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1292](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1292) +[packages/medusa/src/services/cart.ts:1292](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1292) ___ @@ -1306,7 +1306,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1248](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1248) +[packages/medusa/src/services/cart.ts:1248](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1248) ___ @@ -1332,7 +1332,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:915](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L915) +[packages/medusa/src/services/cart.ts:915](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L915) ___ @@ -1357,7 +1357,7 @@ the resulting cart #### Defined in -[packages/medusa/src/services/cart.ts:1554](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1554) +[packages/medusa/src/services/cart.ts:1554](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1554) ___ @@ -1383,7 +1383,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/cart.ts:1330](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L1330) +[packages/medusa/src/services/cart.ts:1330](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L1330) ___ @@ -1405,7 +1405,7 @@ ___ #### Defined in -[packages/medusa/src/services/cart.ts:2194](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L2194) +[packages/medusa/src/services/cart.ts:2191](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L2191) ___ @@ -1431,7 +1431,7 @@ a boolean indicating validation result #### Defined in -[packages/medusa/src/services/cart.ts:585](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L585) +[packages/medusa/src/services/cart.ts:585](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L585) ___ @@ -1458,7 +1458,7 @@ boolean representing whether shipping method is validated #### Defined in -[packages/medusa/src/services/cart.ts:554](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/cart.ts#L554) +[packages/medusa/src/services/cart.ts:554](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/cart.ts#L554) ___ @@ -1482,4 +1482,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ClaimItemService.md b/docs/content/references/services/classes/ClaimItemService.md index a6299a01af..dadf19feba 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/f8d635845/packages/medusa/src/services/claim-item.ts#L30) +[packages/medusa/src/services/claim-item.ts:30](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:25](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L25) +[packages/medusa/src/services/claim-item.ts:25](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L25) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L23) +[packages/medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L23) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L24) +[packages/medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L24) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L22) +[packages/medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L22) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L21) +[packages/medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L21) ___ @@ -130,7 +130,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/claim-item.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L27) +[packages/medusa/src/services/claim-item.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L27) ___ @@ -144,7 +144,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/claim-item.ts:28](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L28) +[packages/medusa/src/services/claim-item.ts:28](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L28) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:15](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L15) +[packages/medusa/src/services/claim-item.ts:15](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L15) ## Methods @@ -201,7 +201,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -221,7 +221,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L49) +[packages/medusa/src/services/claim-item.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L49) ___ @@ -244,7 +244,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/claim-item.ts:221](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L221) +[packages/medusa/src/services/claim-item.ts:221](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L221) ___ @@ -269,7 +269,7 @@ the ClaimItem #### Defined in -[packages/medusa/src/services/claim-item.ts:240](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L240) +[packages/medusa/src/services/claim-item.ts:240](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L240) ___ @@ -293,7 +293,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -314,7 +314,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim-item.ts:139](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim-item.ts#L139) +[packages/medusa/src/services/claim-item.ts:139](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim-item.ts#L139) ___ @@ -338,4 +338,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ClaimService.md b/docs/content/references/services/classes/ClaimService.md index 79030b1aa9..1554410159 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:84](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L84) +[packages/medusa/src/services/claim.ts:89](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L89) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:66](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L66) +[packages/medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L71) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:70](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L70) +[packages/medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L75) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:67](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L67) +[packages/medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L72) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L71) +[packages/medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L76) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L72) +[packages/medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L77) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L73) +[packages/medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L78) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L69) +[packages/medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L74) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L74) +[packages/medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L79) ___ @@ -160,7 +160,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/claim.ts:63](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L63) +[packages/medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L68) ___ @@ -170,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L75) +[packages/medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L80) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:82](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L82) +[packages/medusa/src/services/claim.ts:87](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L87) ___ @@ -190,7 +190,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L76) +[packages/medusa/src/services/claim.ts:81](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L81) ___ @@ -200,7 +200,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L77) +[packages/medusa/src/services/claim.ts:82](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L82) ___ @@ -210,7 +210,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L68) +[packages/medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L73) ___ @@ -220,7 +220,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L78) +[packages/medusa/src/services/claim.ts:83](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L83) ___ @@ -230,7 +230,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L79) +[packages/medusa/src/services/claim.ts:84](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L84) ___ @@ -240,7 +240,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L80) +[packages/medusa/src/services/claim.ts:85](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L85) ___ @@ -254,7 +254,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/claim.ts:64](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L64) +[packages/medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L69) ___ @@ -275,7 +275,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:54](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L54) +[packages/medusa/src/services/claim.ts:59](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L59) ## Methods @@ -314,7 +314,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -334,7 +334,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:760](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L760) +[packages/medusa/src/services/claim.ts:808](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L808) ___ @@ -354,7 +354,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:608](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L608) +[packages/medusa/src/services/claim.ts:656](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L656) ___ @@ -380,7 +380,7 @@ created claim #### Defined in -[packages/medusa/src/services/claim.ts:214](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L214) +[packages/medusa/src/services/claim.ts:337](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L337) ___ @@ -405,7 +405,7 @@ created claim #### Defined in -[packages/medusa/src/services/claim.ts:462](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L462) +[packages/medusa/src/services/claim.ts:510](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L510) ___ @@ -430,7 +430,37 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:680](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L680) +[packages/medusa/src/services/claim.ts:728](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L728) + +___ + +### getRefundTotalForClaimLinesOnOrder + +â–¸ `Protected` **getRefundTotalForClaimLinesOnOrder**(`order`, `claimItems`): `Promise`<`number`\> + +Finds claim line items on an order and calculates the refund amount. +There are three places too look: +- Order items +- Swap items +- Claim items (from previous claims) +Note, it will attempt to return early from each of these places to avoid having to iterate over all items every time. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `order` | `Order` | the order to find claim lines on | +| `claimItems` | `CreateClaimItemInput`[] | the claim items to match against | + +#### Returns + +`Promise`<`number`\> + +the refund amount + +#### Defined in + +[packages/medusa/src/services/claim.ts:279](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L279) ___ @@ -453,7 +483,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/claim.ts:816](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L816) +[packages/medusa/src/services/claim.ts:864](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L864) ___ @@ -473,7 +503,7 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:634](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L634) +[packages/medusa/src/services/claim.ts:682](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L682) ___ @@ -498,7 +528,7 @@ the order document #### Defined in -[packages/medusa/src/services/claim.ts:836](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L836) +[packages/medusa/src/services/claim.ts:884](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L884) ___ @@ -522,7 +552,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -543,7 +573,27 @@ ___ #### Defined in -[packages/medusa/src/services/claim.ts:126](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/claim.ts#L126) +[packages/medusa/src/services/claim.ts:131](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L131) + +___ + +### validateCreateClaimInput + +â–¸ `Protected` **validateCreateClaimInput**(`data`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `CreateClaimInput` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[packages/medusa/src/services/claim.ts:212](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/claim.ts#L212) ___ @@ -567,4 +617,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/CurrencyService.md b/docs/content/references/services/classes/CurrencyService.md index 643f35587b..863b41c326 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/f8d635845/packages/medusa/src/services/currency.ts#L32) +[packages/medusa/src/services/currency.ts:32](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:28](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/currency.ts#L28) +[packages/medusa/src/services/currency.ts:28](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/currency.ts#L28) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/currency.ts#L29) +[packages/medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/currency.ts#L29) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:30](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/currency.ts#L30) +[packages/medusa/src/services/currency.ts:30](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/currency.ts#L30) ___ @@ -110,7 +110,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/currency.ts#L25) +[packages/medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/currency.ts#L25) ___ @@ -124,7 +124,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/currency.ts#L26) +[packages/medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/currency.ts#L26) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/currency.ts#L21) +[packages/medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/currency.ts#L21) ## Methods @@ -179,7 +179,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -207,7 +207,7 @@ an array containing the currencies as #### Defined in -[packages/medusa/src/services/currency.ts:81](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/currency.ts#L81) +[packages/medusa/src/services/currency.ts:81](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/currency.ts#L81) ___ @@ -231,7 +231,7 @@ The currency #### Defined in -[packages/medusa/src/services/currency.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/currency.ts#L50) +[packages/medusa/src/services/currency.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/currency.ts#L50) ___ @@ -255,7 +255,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -280,7 +280,7 @@ The updated currency #### Defined in -[packages/medusa/src/services/currency.ts:103](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/currency.ts#L103) +[packages/medusa/src/services/currency.ts:103](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/currency.ts#L103) ___ @@ -304,4 +304,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/CustomShippingOptionService.md b/docs/content/references/services/classes/CustomShippingOptionService.md index 164788e522..260641eca7 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/f8d635845/packages/medusa/src/services/custom-shipping-option.ts#L20) +[packages/medusa/src/services/custom-shipping-option.ts:20](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/custom-shipping-option.ts#L18) +[packages/medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/custom-shipping-option.ts#L18) ___ @@ -90,7 +90,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:15](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/custom-shipping-option.ts#L15) +[packages/medusa/src/services/custom-shipping-option.ts:15](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/custom-shipping-option.ts#L15) ___ @@ -104,7 +104,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/custom-shipping-option.ts#L16) +[packages/medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/custom-shipping-option.ts#L16) ## Methods @@ -143,7 +143,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -167,7 +167,7 @@ resolves to the creation result #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:89](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/custom-shipping-option.ts#L89) +[packages/medusa/src/services/custom-shipping-option.ts:89](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/custom-shipping-option.ts#L89) ___ @@ -192,7 +192,7 @@ custom shipping options matching the query #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:65](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/custom-shipping-option.ts#L65) +[packages/medusa/src/services/custom-shipping-option.ts:65](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/custom-shipping-option.ts#L65) ___ @@ -217,7 +217,7 @@ the requested custom shipping option. #### Defined in -[packages/medusa/src/services/custom-shipping-option.ts:37](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/custom-shipping-option.ts#L37) +[packages/medusa/src/services/custom-shipping-option.ts:37](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/custom-shipping-option.ts#L37) ___ @@ -241,7 +241,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -265,4 +265,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/CustomerGroupService.md b/docs/content/references/services/classes/CustomerGroupService.md index 06edc010f9..6369cdc3c3 100644 --- a/docs/content/references/services/classes/CustomerGroupService.md +++ b/docs/content/references/services/classes/CustomerGroupService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/customer-group.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L27) +[packages/medusa/src/services/customer-group.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:24](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L24) +[packages/medusa/src/services/customer-group.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L24) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:25](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L25) +[packages/medusa/src/services/customer-group.ts:25](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L25) ___ @@ -100,7 +100,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/customer-group.ts:21](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L21) +[packages/medusa/src/services/customer-group.ts:21](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L21) ___ @@ -114,7 +114,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/customer-group.ts:22](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L22) +[packages/medusa/src/services/customer-group.ts:22](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L22) ## Methods @@ -139,7 +139,7 @@ the customer group after insertion #### Defined in -[packages/medusa/src/services/customer-group.ts:94](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L94) +[packages/medusa/src/services/customer-group.ts:94](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L94) ___ @@ -178,7 +178,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -210,7 +210,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/customer-group.ts:70](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L70) +[packages/medusa/src/services/customer-group.ts:70](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L70) ___ @@ -234,7 +234,7 @@ a promise #### Defined in -[packages/medusa/src/services/customer-group.ts:158](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L158) +[packages/medusa/src/services/customer-group.ts:158](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L158) ___ @@ -256,7 +256,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:261](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L261) +[packages/medusa/src/services/customer-group.ts:261](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L261) ___ @@ -281,7 +281,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer-group.ts:181](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L181) +[packages/medusa/src/services/customer-group.ts:181](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L181) ___ @@ -306,7 +306,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer-group.ts:199](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L199) +[packages/medusa/src/services/customer-group.ts:199](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L199) ___ @@ -331,7 +331,7 @@ the customergroup with the provided id #### Defined in -[packages/medusa/src/services/customer-group.ts:240](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L240) +[packages/medusa/src/services/customer-group.ts:240](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L240) ___ @@ -352,7 +352,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer-group.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L40) +[packages/medusa/src/services/customer-group.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L40) ___ @@ -376,7 +376,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -401,7 +401,7 @@ resulting customer group #### Defined in -[packages/medusa/src/services/customer-group.ts:125](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer-group.ts#L125) +[packages/medusa/src/services/customer-group.ts:125](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer-group.ts#L125) ___ @@ -425,4 +425,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/CustomerService.md b/docs/content/references/services/classes/CustomerService.md index e24fcb83df..0d3a0c827d 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/f8d635845/packages/medusa/src/services/customer.ts#L39) +[packages/medusa/src/services/customer.ts:39](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L27) +[packages/medusa/src/services/customer.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L27) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L26) +[packages/medusa/src/services/customer.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L26) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:28](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L28) +[packages/medusa/src/services/customer.ts:28](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L28) ___ @@ -112,7 +112,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/customer.ts:30](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L30) +[packages/medusa/src/services/customer.ts:30](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L30) ___ @@ -126,7 +126,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/customer.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L31) +[packages/medusa/src/services/customer.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L31) ___ @@ -144,7 +144,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:33](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L33) +[packages/medusa/src/services/customer.ts:33](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L33) ## Methods @@ -165,7 +165,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:498](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L498) +[packages/medusa/src/services/customer.ts:498](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L498) ___ @@ -204,7 +204,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -222,7 +222,7 @@ the result of the count operation #### Defined in -[packages/medusa/src/services/customer.ts:158](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L158) +[packages/medusa/src/services/customer.ts:158](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L158) ___ @@ -249,7 +249,7 @@ the result of create #### Defined in -[packages/medusa/src/services/customer.ts:285](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L285) +[packages/medusa/src/services/customer.ts:285](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L285) ___ @@ -273,7 +273,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/customer.ts:546](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L546) +[packages/medusa/src/services/customer.ts:546](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L546) ___ @@ -301,7 +301,7 @@ the generated JSON web token #### Defined in -[packages/medusa/src/services/customer.ts:64](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L64) +[packages/medusa/src/services/customer.ts:64](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L64) ___ @@ -325,7 +325,7 @@ hashed password #### Defined in -[packages/medusa/src/services/customer.ts:272](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L272) +[packages/medusa/src/services/customer.ts:272](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L272) ___ @@ -348,7 +348,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer.ts:107](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L107) +[packages/medusa/src/services/customer.ts:107](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L107) ___ @@ -371,7 +371,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/customer.ts:131](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L131) +[packages/medusa/src/services/customer.ts:131](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L131) ___ @@ -392,7 +392,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:228](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L228) +[packages/medusa/src/services/customer.ts:228](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L228) ___ @@ -413,7 +413,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:481](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L481) +[packages/medusa/src/services/customer.ts:481](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L481) ___ @@ -438,7 +438,7 @@ the customer document. #### Defined in -[packages/medusa/src/services/customer.ts:253](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L253) +[packages/medusa/src/services/customer.ts:253](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L253) ___ @@ -465,7 +465,7 @@ the customer document. #### Defined in -[packages/medusa/src/services/customer.ts:195](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L195) +[packages/medusa/src/services/customer.ts:195](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L195) ___ @@ -490,7 +490,7 @@ the customer document. #### Defined in -[packages/medusa/src/services/customer.ts:240](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L240) +[packages/medusa/src/services/customer.ts:240](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L240) ___ @@ -511,7 +511,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:218](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L218) +[packages/medusa/src/services/customer.ts:218](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L218) ___ @@ -532,7 +532,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:209](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L209) +[packages/medusa/src/services/customer.ts:209](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L209) ___ @@ -553,7 +553,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:164](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L164) +[packages/medusa/src/services/customer.ts:164](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L164) ___ @@ -577,7 +577,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -602,7 +602,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/customer.ts:341](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L341) +[packages/medusa/src/services/customer.ts:341](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L341) ___ @@ -624,7 +624,7 @@ ___ #### Defined in -[packages/medusa/src/services/customer.ts:453](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L453) +[packages/medusa/src/services/customer.ts:453](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L453) ___ @@ -649,7 +649,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/customer.ts:401](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/customer.ts#L401) +[packages/medusa/src/services/customer.ts:401](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/customer.ts#L401) ___ @@ -673,4 +673,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/DiscountConditionService.md b/docs/content/references/services/classes/DiscountConditionService.md index d28c5c275f..e1c29e992a 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/f8d635845/packages/medusa/src/services/discount-condition.ts#L37) +[packages/medusa/src/services/discount-condition.ts:37](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -70,7 +70,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount-condition.ts#L31) +[packages/medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount-condition.ts#L31) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount-condition.ts#L32) +[packages/medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount-condition.ts#L32) ___ @@ -104,7 +104,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount-condition.ts#L34) +[packages/medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount-condition.ts#L34) ___ @@ -118,7 +118,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/discount-condition.ts:35](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount-condition.ts#L35) +[packages/medusa/src/services/discount-condition.ts:35](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount-condition.ts#L35) ## Methods @@ -157,7 +157,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -177,7 +177,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:220](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount-condition.ts#L220) +[packages/medusa/src/services/discount-condition.ts:220](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount-condition.ts#L220) ___ @@ -197,7 +197,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:188](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount-condition.ts#L188) +[packages/medusa/src/services/discount-condition.ts:188](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount-condition.ts#L188) ___ @@ -218,7 +218,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount-condition.ts#L49) +[packages/medusa/src/services/discount-condition.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount-condition.ts#L49) ___ @@ -242,7 +242,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -263,7 +263,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:116](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount-condition.ts#L116) +[packages/medusa/src/services/discount-condition.ts:116](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount-condition.ts#L116) ___ @@ -287,7 +287,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -307,4 +307,4 @@ ___ #### Defined in -[packages/medusa/src/services/discount-condition.ts:79](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount-condition.ts#L79) +[packages/medusa/src/services/discount-condition.ts:79](https://github.com/medusajs/medusa/blob/fefc248a4/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 e14dfbcbd8..36aa292d17 100644 --- a/docs/content/references/services/classes/DiscountService.md +++ b/docs/content/references/services/classes/DiscountService.md @@ -28,7 +28,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/discount.ts:69](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L69) +[packages/medusa/src/services/discount.ts:69](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L69) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -70,7 +70,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:56](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L56) +[packages/medusa/src/services/discount.ts:56](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L56) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:60](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L60) +[packages/medusa/src/services/discount.ts:60](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L60) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:61](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L61) +[packages/medusa/src/services/discount.ts:61](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L61) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L55) +[packages/medusa/src/services/discount.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L55) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:57](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L57) +[packages/medusa/src/services/discount.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L57) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:66](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L66) +[packages/medusa/src/services/discount.ts:66](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L66) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:67](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L67) +[packages/medusa/src/services/discount.ts:67](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L67) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:58](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L58) +[packages/medusa/src/services/discount.ts:58](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L58) ___ @@ -164,7 +164,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/discount.ts:52](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L52) +[packages/medusa/src/services/discount.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L52) ___ @@ -174,7 +174,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:63](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L63) +[packages/medusa/src/services/discount.ts:63](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L63) ___ @@ -184,7 +184,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:64](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L64) +[packages/medusa/src/services/discount.ts:64](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L64) ___ @@ -194,7 +194,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:65](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L65) +[packages/medusa/src/services/discount.ts:65](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L65) ___ @@ -204,7 +204,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:62](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L62) +[packages/medusa/src/services/discount.ts:62](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L62) ___ @@ -218,7 +218,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/discount.ts:53](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L53) +[packages/medusa/src/services/discount.ts:53](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L53) ## Methods @@ -243,7 +243,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/discount.ts:513](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L513) +[packages/medusa/src/services/discount.ts:513](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L513) ___ @@ -282,7 +282,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -304,7 +304,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:614](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L614) +[packages/medusa/src/services/discount.ts:614](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L614) ___ @@ -325,7 +325,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:793](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L793) +[packages/medusa/src/services/discount.ts:793](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L793) ___ @@ -350,7 +350,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/discount.ts:187](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L187) +[packages/medusa/src/services/discount.ts:187](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L187) ___ @@ -375,7 +375,7 @@ the newly created dynamic code #### Defined in -[packages/medusa/src/services/discount.ts:441](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L441) +[packages/medusa/src/services/discount.ts:441](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L441) ___ @@ -399,7 +399,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/discount.ts:573](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L573) +[packages/medusa/src/services/discount.ts:573](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L573) ___ @@ -424,7 +424,7 @@ the newly created dynamic code #### Defined in -[packages/medusa/src/services/discount.ts:492](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L492) +[packages/medusa/src/services/discount.ts:492](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L492) ___ @@ -444,7 +444,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:762](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L762) +[packages/medusa/src/services/discount.ts:762](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L762) ___ @@ -464,7 +464,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:758](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L758) +[packages/medusa/src/services/discount.ts:758](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L758) ___ @@ -484,7 +484,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:752](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L752) +[packages/medusa/src/services/discount.ts:752](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L752) ___ @@ -504,7 +504,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:770](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L770) +[packages/medusa/src/services/discount.ts:770](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L770) ___ @@ -525,7 +525,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:774](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L774) +[packages/medusa/src/services/discount.ts:774](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L774) ___ @@ -548,7 +548,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/discount.ts:125](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L125) +[packages/medusa/src/services/discount.ts:125](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L125) ___ @@ -571,7 +571,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/discount.ts:141](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L141) +[packages/medusa/src/services/discount.ts:141](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L141) ___ @@ -596,7 +596,7 @@ the discounts #### Defined in -[packages/medusa/src/services/discount.ts:314](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L314) +[packages/medusa/src/services/discount.ts:314](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L314) ___ @@ -621,7 +621,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/discount.ts:548](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L548) +[packages/medusa/src/services/discount.ts:548](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L548) ___ @@ -646,7 +646,7 @@ the discount #### Defined in -[packages/medusa/src/services/discount.ts:253](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L253) +[packages/medusa/src/services/discount.ts:253](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L253) ___ @@ -671,7 +671,7 @@ the discount #### Defined in -[packages/medusa/src/services/discount.ts:286](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L286) +[packages/medusa/src/services/discount.ts:286](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L286) ___ @@ -695,7 +695,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -720,7 +720,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/discount.ts:344](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L344) +[packages/medusa/src/services/discount.ts:344](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L344) ___ @@ -741,7 +741,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:687](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L687) +[packages/medusa/src/services/discount.ts:687](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L687) ___ @@ -762,7 +762,7 @@ ___ #### Defined in -[packages/medusa/src/services/discount.ts:587](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L587) +[packages/medusa/src/services/discount.ts:587](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L587) ___ @@ -792,7 +792,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/discount.ts:107](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/discount.ts#L107) +[packages/medusa/src/services/discount.ts:107](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/discount.ts#L107) ___ @@ -816,4 +816,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/DraftOrderService.md b/docs/content/references/services/classes/DraftOrderService.md index 1fc54c2c54..d55e6b04e4 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/f8d635845/packages/medusa/src/services/draft-order.ts#L54) +[packages/medusa/src/services/draft-order.ts:54](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -70,7 +70,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:48](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L48) +[packages/medusa/src/services/draft-order.ts:48](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L48) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:52](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L52) +[packages/medusa/src/services/draft-order.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L52) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:44](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L44) +[packages/medusa/src/services/draft-order.ts:44](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L44) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:47](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L47) +[packages/medusa/src/services/draft-order.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L47) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L49) +[packages/medusa/src/services/draft-order.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L49) ___ @@ -134,7 +134,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/draft-order.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L41) +[packages/medusa/src/services/draft-order.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L41) ___ @@ -144,7 +144,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:46](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L46) +[packages/medusa/src/services/draft-order.ts:46](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L46) ___ @@ -154,7 +154,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L45) +[packages/medusa/src/services/draft-order.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L45) ___ @@ -164,7 +164,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L50) +[packages/medusa/src/services/draft-order.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L50) ___ @@ -174,7 +174,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:51](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L51) +[packages/medusa/src/services/draft-order.ts:51](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L51) ___ @@ -188,7 +188,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/draft-order.ts:42](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L42) +[packages/medusa/src/services/draft-order.ts:42](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L42) ___ @@ -205,7 +205,7 @@ ___ #### Defined in -[packages/medusa/src/services/draft-order.ts:36](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L36) +[packages/medusa/src/services/draft-order.ts:36](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L36) ## Methods @@ -244,7 +244,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -268,7 +268,7 @@ the created draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:248](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L248) +[packages/medusa/src/services/draft-order.ts:248](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L248) ___ @@ -292,7 +292,7 @@ empty promise #### Defined in -[packages/medusa/src/services/draft-order.ts:147](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L147) +[packages/medusa/src/services/draft-order.ts:147](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L147) ___ @@ -317,7 +317,7 @@ list of draft orders #### Defined in -[packages/medusa/src/services/draft-order.ts:225](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L225) +[packages/medusa/src/services/draft-order.ts:225](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L225) ___ @@ -342,7 +342,7 @@ draft orders #### Defined in -[packages/medusa/src/services/draft-order.ts:171](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L171) +[packages/medusa/src/services/draft-order.ts:171](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L171) ___ @@ -367,7 +367,7 @@ the created order #### Defined in -[packages/medusa/src/services/draft-order.ts:365](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L365) +[packages/medusa/src/services/draft-order.ts:365](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L365) ___ @@ -392,7 +392,7 @@ the draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:87](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L87) +[packages/medusa/src/services/draft-order.ts:87](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L87) ___ @@ -417,7 +417,7 @@ the draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:121](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L121) +[packages/medusa/src/services/draft-order.ts:121](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L121) ___ @@ -441,7 +441,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -467,7 +467,7 @@ the updated draft order #### Defined in -[packages/medusa/src/services/draft-order.ts:394](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/draft-order.ts#L394) +[packages/medusa/src/services/draft-order.ts:394](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/draft-order.ts#L394) ___ @@ -491,4 +491,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/EventBusService.md b/docs/content/references/services/classes/EventBusService.md index e73c1396be..20c65969e4 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:73](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L73) +[packages/medusa/src/services/event-bus.ts:73](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L73) ## Properties @@ -29,7 +29,7 @@ subscribers when events happen. Events will run asynchronously. #### Defined in -[packages/medusa/src/services/event-bus.ts:57](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L57) +[packages/medusa/src/services/event-bus.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L57) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:71](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L71) +[packages/medusa/src/services/event-bus.ts:71](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L71) ___ @@ -49,7 +49,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:62](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L62) +[packages/medusa/src/services/event-bus.ts:62](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L62) ___ @@ -59,7 +59,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:61](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L61) +[packages/medusa/src/services/event-bus.ts:61](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L61) ___ @@ -69,7 +69,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:59](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L59) +[packages/medusa/src/services/event-bus.ts:59](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L59) ___ @@ -79,7 +79,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:58](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L58) +[packages/medusa/src/services/event-bus.ts:58](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L58) ___ @@ -89,7 +89,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:68](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L68) +[packages/medusa/src/services/event-bus.ts:68](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L68) ___ @@ -99,7 +99,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:66](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L66) +[packages/medusa/src/services/event-bus.ts:66](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L66) ___ @@ -109,7 +109,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:67](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L67) +[packages/medusa/src/services/event-bus.ts:67](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L67) ___ @@ -119,7 +119,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:69](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L69) +[packages/medusa/src/services/event-bus.ts:69](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L69) ___ @@ -129,7 +129,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:60](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L60) +[packages/medusa/src/services/event-bus.ts:60](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L60) ___ @@ -139,7 +139,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:70](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L70) +[packages/medusa/src/services/event-bus.ts:70](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L70) ## Methods @@ -177,7 +177,7 @@ void #### Defined in -[packages/medusa/src/services/event-bus.ts:416](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L416) +[packages/medusa/src/services/event-bus.ts:416](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L416) ___ @@ -209,7 +209,7 @@ the job from our queue #### Defined in -[packages/medusa/src/services/event-bus.ts:223](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L223) +[packages/medusa/src/services/event-bus.ts:223](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L223) ___ @@ -223,7 +223,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:280](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L280) +[packages/medusa/src/services/event-bus.ts:280](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L280) ___ @@ -237,7 +237,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:270](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L270) +[packages/medusa/src/services/event-bus.ts:270](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L270) ___ @@ -251,7 +251,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:275](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L275) +[packages/medusa/src/services/event-bus.ts:275](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L275) ___ @@ -277,7 +277,7 @@ this #### Defined in -[packages/medusa/src/services/event-bus.ts:153](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L153) +[packages/medusa/src/services/event-bus.ts:153](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L153) ___ @@ -302,7 +302,7 @@ this #### Defined in -[packages/medusa/src/services/event-bus.ts:196](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L196) +[packages/medusa/src/services/event-bus.ts:196](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L196) ___ @@ -322,7 +322,7 @@ ___ #### Defined in -[packages/medusa/src/services/event-bus.ts:121](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L121) +[packages/medusa/src/services/event-bus.ts:121](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L121) ___ @@ -352,4 +352,4 @@ resolves to the results of the subscriber calls. #### Defined in -[packages/medusa/src/services/event-bus.ts:315](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/event-bus.ts#L315) +[packages/medusa/src/services/event-bus.ts:315](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/event-bus.ts#L315) diff --git a/docs/content/references/services/classes/FulfillmentProviderService.md b/docs/content/references/services/classes/FulfillmentProviderService.md index 196bab4e03..4ea9088628 100644 --- a/docs/content/references/services/classes/FulfillmentProviderService.md +++ b/docs/content/references/services/classes/FulfillmentProviderService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:47](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L47) +[packages/medusa/src/services/fulfillment-provider.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L43) +[packages/medusa/src/services/fulfillment-provider.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L43) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L45) +[packages/medusa/src/services/fulfillment-provider.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L45) ___ @@ -102,7 +102,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L40) +[packages/medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L40) ___ @@ -116,7 +116,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L41) +[packages/medusa/src/services/fulfillment-provider.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L41) ## Methods @@ -155,7 +155,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -177,7 +177,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:151](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L151) +[packages/medusa/src/services/fulfillment-provider.ts:151](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L151) ___ @@ -197,7 +197,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:126](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L126) +[packages/medusa/src/services/fulfillment-provider.ts:126](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L126) ___ @@ -217,7 +217,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:144](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L144) +[packages/medusa/src/services/fulfillment-provider.ts:144](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L144) ___ @@ -240,7 +240,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:111](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L111) +[packages/medusa/src/services/fulfillment-provider.ts:111](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L111) ___ @@ -260,7 +260,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:169](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L169) +[packages/medusa/src/services/fulfillment-provider.ts:169](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L169) ___ @@ -274,7 +274,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:71](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L71) +[packages/medusa/src/services/fulfillment-provider.ts:71](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L71) ___ @@ -294,7 +294,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:79](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L79) +[packages/medusa/src/services/fulfillment-provider.ts:79](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L79) ___ @@ -314,7 +314,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:57](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L57) +[packages/medusa/src/services/fulfillment-provider.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L57) ___ @@ -340,7 +340,7 @@ document to fetch #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:188](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L188) +[packages/medusa/src/services/fulfillment-provider.ts:188](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L188) ___ @@ -362,7 +362,7 @@ the payment fulfillment provider #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:100](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L100) +[packages/medusa/src/services/fulfillment-provider.ts:100](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L100) ___ @@ -386,7 +386,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -408,7 +408,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:131](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L131) +[packages/medusa/src/services/fulfillment-provider.ts:131](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L131) ___ @@ -428,7 +428,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment-provider.ts:164](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment-provider.ts#L164) +[packages/medusa/src/services/fulfillment-provider.ts:164](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment-provider.ts#L164) ___ @@ -452,4 +452,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/FulfillmentService.md b/docs/content/references/services/classes/FulfillmentService.md index 47ee71ca70..aa97767e1b 100644 --- a/docs/content/references/services/classes/FulfillmentService.md +++ b/docs/content/references/services/classes/FulfillmentService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/fulfillment.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L50) +[packages/medusa/src/services/fulfillment.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L50) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L43) +[packages/medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L43) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:44](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L44) +[packages/medusa/src/services/fulfillment.ts:44](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L44) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:46](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L46) +[packages/medusa/src/services/fulfillment.ts:46](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L46) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L41) +[packages/medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L41) ___ @@ -122,7 +122,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L37) +[packages/medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L37) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:48](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L48) +[packages/medusa/src/services/fulfillment.ts:48](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L48) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L42) +[packages/medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L42) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L40) +[packages/medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L40) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L45) +[packages/medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L45) ___ @@ -176,7 +176,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/fulfillment.ts:38](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L38) +[packages/medusa/src/services/fulfillment.ts:38](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L38) ## Methods @@ -215,7 +215,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -241,7 +241,7 @@ the result of the save operation #### Defined in -[packages/medusa/src/services/fulfillment.ts:269](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L269) +[packages/medusa/src/services/fulfillment.ts:269](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L269) ___ @@ -272,7 +272,7 @@ the created fulfillments #### Defined in -[packages/medusa/src/services/fulfillment.ts:211](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L211) +[packages/medusa/src/services/fulfillment.ts:211](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L211) ___ @@ -299,7 +299,7 @@ the shipped fulfillment #### Defined in -[packages/medusa/src/services/fulfillment.ts:321](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L321) +[packages/medusa/src/services/fulfillment.ts:321](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L321) ___ @@ -324,7 +324,7 @@ the line items generated by the transformer. #### Defined in -[packages/medusa/src/services/fulfillment.ts:115](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L115) +[packages/medusa/src/services/fulfillment.ts:115](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L115) ___ @@ -345,7 +345,7 @@ ___ #### Defined in -[packages/medusa/src/services/fulfillment.ts:76](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L76) +[packages/medusa/src/services/fulfillment.ts:76](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L76) ___ @@ -370,7 +370,7 @@ the fulfillment #### Defined in -[packages/medusa/src/services/fulfillment.ts:172](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L172) +[packages/medusa/src/services/fulfillment.ts:172](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L172) ___ @@ -394,7 +394,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -423,7 +423,7 @@ a line item that has the requested fulfillment quantity #### Defined in -[packages/medusa/src/services/fulfillment.ts:140](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/fulfillment.ts#L140) +[packages/medusa/src/services/fulfillment.ts:140](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/fulfillment.ts#L140) ___ @@ -447,4 +447,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/GiftCardService.md b/docs/content/references/services/classes/GiftCardService.md index 027b11fd20..f81bac9fe5 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/f8d635845/packages/medusa/src/services/gift-card.ts#L47) +[packages/medusa/src/services/gift-card.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:38](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L38) +[packages/medusa/src/services/gift-card.ts:38](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L38) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:34](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L34) +[packages/medusa/src/services/gift-card.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L34) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:36](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L36) +[packages/medusa/src/services/gift-card.ts:36](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L36) ___ @@ -112,7 +112,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/gift-card.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L40) +[packages/medusa/src/services/gift-card.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L40) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:37](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L37) +[packages/medusa/src/services/gift-card.ts:37](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L37) ___ @@ -136,7 +136,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/gift-card.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L41) +[packages/medusa/src/services/gift-card.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L41) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L43) +[packages/medusa/src/services/gift-card.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L43) ## Methods @@ -191,7 +191,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -215,7 +215,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/gift-card.ts:153](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L153) +[packages/medusa/src/services/gift-card.ts:153](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L153) ___ @@ -235,7 +235,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:138](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L138) +[packages/medusa/src/services/gift-card.ts:138](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L138) ___ @@ -259,7 +259,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/gift-card.ts:322](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L322) +[packages/medusa/src/services/gift-card.ts:322](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L322) ___ @@ -282,7 +282,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/gift-card.ts:114](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L114) +[packages/medusa/src/services/gift-card.ts:114](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L114) ___ @@ -305,7 +305,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/gift-card.ts:85](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L85) +[packages/medusa/src/services/gift-card.ts:85](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L85) ___ @@ -330,7 +330,7 @@ the gift card #### Defined in -[packages/medusa/src/services/gift-card.ts:242](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L242) +[packages/medusa/src/services/gift-card.ts:242](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L242) ___ @@ -351,7 +351,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:256](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L256) +[packages/medusa/src/services/gift-card.ts:256](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L256) ___ @@ -372,7 +372,7 @@ ___ #### Defined in -[packages/medusa/src/services/gift-card.ts:208](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L208) +[packages/medusa/src/services/gift-card.ts:208](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L208) ___ @@ -396,7 +396,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -421,7 +421,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/gift-card.ts:276](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L276) +[packages/medusa/src/services/gift-card.ts:276](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L276) ___ @@ -445,7 +445,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -463,7 +463,7 @@ the generated gift card code #### Defined in -[packages/medusa/src/services/gift-card.ts:69](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L69) +[packages/medusa/src/services/gift-card.ts:69](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/gift-card.ts#L69) ___ @@ -489,4 +489,4 @@ the tax rate for the gift card #### Defined in -[packages/medusa/src/services/gift-card.ts:189](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/gift-card.ts#L189) +[packages/medusa/src/services/gift-card.ts:189](https://github.com/medusajs/medusa/blob/fefc248a4/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 10c84d88a5..5af8599d56 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/f8d635845/packages/medusa/src/services/idempotency-key.ts#L25) +[packages/medusa/src/services/idempotency-key.ts:25](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/idempotency-key.ts#L23) +[packages/medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/idempotency-key.ts#L23) ___ @@ -90,7 +90,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/idempotency-key.ts:20](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/idempotency-key.ts#L20) +[packages/medusa/src/services/idempotency-key.ts:20](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/idempotency-key.ts#L20) ___ @@ -104,7 +104,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/idempotency-key.ts:21](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/idempotency-key.ts#L21) +[packages/medusa/src/services/idempotency-key.ts:21](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/idempotency-key.ts#L21) ## Methods @@ -143,7 +143,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -169,7 +169,7 @@ the created idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:67](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/idempotency-key.ts#L67) +[packages/medusa/src/services/idempotency-key.ts:67](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/idempotency-key.ts#L67) ___ @@ -196,7 +196,7 @@ the existing or created idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/idempotency-key.ts#L41) +[packages/medusa/src/services/idempotency-key.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/idempotency-key.ts#L41) ___ @@ -220,7 +220,7 @@ result of the update operation #### Defined in -[packages/medusa/src/services/idempotency-key.ts:116](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/idempotency-key.ts#L116) +[packages/medusa/src/services/idempotency-key.ts:116](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/idempotency-key.ts#L116) ___ @@ -244,7 +244,7 @@ idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:85](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/idempotency-key.ts#L85) +[packages/medusa/src/services/idempotency-key.ts:85](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/idempotency-key.ts#L85) ___ @@ -268,7 +268,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -303,7 +303,7 @@ result of the update operation #### Defined in -[packages/medusa/src/services/idempotency-key.ts:145](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/idempotency-key.ts#L145) +[packages/medusa/src/services/idempotency-key.ts:145](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/idempotency-key.ts#L145) ___ @@ -327,7 +327,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -356,4 +356,4 @@ new updated idempotency key #### Defined in -[packages/medusa/src/services/idempotency-key.ts:174](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/idempotency-key.ts#L174) +[packages/medusa/src/services/idempotency-key.ts:174](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/idempotency-key.ts#L174) diff --git a/docs/content/references/services/classes/LineItemAdjustmentService.md b/docs/content/references/services/classes/LineItemAdjustmentService.md index 412a7d1594..d0fa4debe8 100644 --- a/docs/content/references/services/classes/LineItemAdjustmentService.md +++ b/docs/content/references/services/classes/LineItemAdjustmentService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:39](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L39) +[packages/medusa/src/services/line-item-adjustment.ts:39](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:37](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L37) +[packages/medusa/src/services/line-item-adjustment.ts:37](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L37) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:36](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L36) +[packages/medusa/src/services/line-item-adjustment.ts:36](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L36) ___ @@ -102,7 +102,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:33](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L33) +[packages/medusa/src/services/line-item-adjustment.ts:33](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L33) ___ @@ -116,7 +116,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:34](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L34) +[packages/medusa/src/services/line-item-adjustment.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L34) ## Methods @@ -155,7 +155,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -179,7 +179,7 @@ line item adjustment #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:90](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L90) +[packages/medusa/src/services/line-item-adjustment.ts:90](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L90) ___ @@ -204,7 +204,7 @@ a line item adjustment or undefined if no adjustment was created #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:260](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L260) +[packages/medusa/src/services/line-item-adjustment.ts:263](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L263) ___ @@ -230,7 +230,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:288](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L288) +[packages/medusa/src/services/line-item-adjustment.ts:291](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L291) ___ @@ -254,7 +254,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:155](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L155) +[packages/medusa/src/services/line-item-adjustment.ts:155](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L155) ___ @@ -280,7 +280,7 @@ a line item adjustment or undefined if no adjustment was created #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:189](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L189) +[packages/medusa/src/services/line-item-adjustment.ts:189](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L189) ___ @@ -305,7 +305,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:138](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L138) +[packages/medusa/src/services/line-item-adjustment.ts:138](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L138) ___ @@ -330,7 +330,7 @@ the line item adjustment. #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:58](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L58) +[packages/medusa/src/services/line-item-adjustment.ts:58](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L58) ___ @@ -354,7 +354,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -379,7 +379,7 @@ line item adjustment #### Defined in -[packages/medusa/src/services/line-item-adjustment.ts:107](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item-adjustment.ts#L107) +[packages/medusa/src/services/line-item-adjustment.ts:107](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item-adjustment.ts#L107) ___ @@ -403,4 +403,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/LineItemService.md b/docs/content/references/services/classes/LineItemService.md index 6272eea36e..60154efabf 100644 --- a/docs/content/references/services/classes/LineItemService.md +++ b/docs/content/references/services/classes/LineItemService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/line-item.ts:59](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L59) +[packages/medusa/src/services/line-item.ts:59](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L59) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L50) +[packages/medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L50) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L55) +[packages/medusa/src/services/line-item.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L55) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L49) +[packages/medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L49) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:56](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L56) +[packages/medusa/src/services/line-item.ts:56](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L56) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:48](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L48) +[packages/medusa/src/services/line-item.ts:48](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L48) ___ @@ -130,7 +130,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/line-item.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L45) +[packages/medusa/src/services/line-item.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L45) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:53](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L53) +[packages/medusa/src/services/line-item.ts:53](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L53) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:52](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L52) +[packages/medusa/src/services/line-item.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L52) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L51) +[packages/medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L51) ___ @@ -170,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:54](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L54) +[packages/medusa/src/services/line-item.ts:54](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L54) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:57](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L57) +[packages/medusa/src/services/line-item.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L57) ___ @@ -194,7 +194,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L46) +[packages/medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L46) ## Methods @@ -233,7 +233,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -264,8 +264,8 @@ ___ | `data.is_giftcard?` | `boolean` | | `data.is_return?` | `boolean` | | `data.metadata?` | { [x: string]: unknown; } | -| `data.order?` | { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; payment\_status?: PaymentStatus \| undefined; ... 48 more ...; updated\_at?: { ...; } \| undefined; } | -| `data.order_edit?` | ``null`` \| { order\_id?: string \| undefined; order?: { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; ... 49 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 27 more ...; updated\_at?: { ...; } \| undefined; } | +| `data.order?` | { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; payment\_status?: PaymentStatus \| undefined; ... 49 more ...; updated\_at?: { ...; } \| undefined; } | +| `data.order_edit?` | ``null`` \| { order\_id?: string \| undefined; order?: { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; ... 50 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 27 more ...; updated\_at?: { ...; } \| undefined; } | | `data.order_edit_id?` | ``null`` \| `string` | | `data.order_id?` | ``null`` \| `string` | | `data.original_item_id?` | ``null`` \| `string` | @@ -286,7 +286,7 @@ ___ | `data.total?` | ``null`` \| `number` | | `data.unit_price?` | `number` | | `data.updated_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `data.variant?` | { title?: string \| undefined; product\_id?: string \| undefined; product?: { title?: string \| undefined; subtitle?: string \| null \| undefined; description?: string \| null \| undefined; ... 30 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 22 more ...; updated\_at?: { ...; } \| undefined; } | +| `data.variant?` | { title?: string \| undefined; product\_id?: string \| undefined; product?: { title?: string \| undefined; subtitle?: string \| null \| undefined; description?: string \| null \| undefined; ... 30 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 23 more ...; updated\_at?: { ...; } \| undefined; } | | `data.variant_id?` | ``null`` \| `string` | | `options` | `Object` | | `options.setOriginalLineItemId?` | `boolean` | @@ -297,7 +297,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:487](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L487) +[packages/medusa/src/services/line-item.ts:487](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L487) ___ @@ -328,7 +328,7 @@ the created line item #### Defined in -[packages/medusa/src/services/line-item.ts:368](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L368) +[packages/medusa/src/services/line-item.ts:368](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L368) ___ @@ -354,7 +354,7 @@ the created line items #### Defined in -[packages/medusa/src/services/line-item.ts:135](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L135) +[packages/medusa/src/services/line-item.ts:135](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L135) ___ @@ -387,7 +387,7 @@ a new line item tax line #### Defined in -[packages/medusa/src/services/line-item.ts:479](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L479) +[packages/medusa/src/services/line-item.ts:479](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L479) ___ @@ -411,7 +411,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/line-item.ts:439](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L439) +[packages/medusa/src/services/line-item.ts:439](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L439) ___ @@ -435,7 +435,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/line-item.ts:458](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L458) +[packages/medusa/src/services/line-item.ts:458](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L458) ___ @@ -456,7 +456,7 @@ Generate a single or multiple line item without persisting the data into the db | Name | Type | | :------ | :------ | -| `variantIdOrData` | `string` \| `T` | +| `variantIdOrData` | `T` | | `regionIdOrContext` | `T` extends `string` ? `string` : `GenerateLineItemContext` | | `quantity?` | `number` | | `context` | `GenerateLineItemContext` | @@ -467,7 +467,7 @@ Generate a single or multiple line item without persisting the data into the db #### Defined in -[packages/medusa/src/services/line-item.ts:196](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L196) +[packages/medusa/src/services/line-item.ts:196](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L196) ___ @@ -497,7 +497,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:299](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L299) +[packages/medusa/src/services/line-item.ts:299](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L299) ___ @@ -518,7 +518,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:88](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L88) +[packages/medusa/src/services/line-item.ts:88](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L88) ___ @@ -543,7 +543,7 @@ the line item #### Defined in -[packages/medusa/src/services/line-item.ts:108](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L108) +[packages/medusa/src/services/line-item.ts:108](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L108) ___ @@ -567,7 +567,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -592,7 +592,7 @@ the updated line item(s) #### Defined in -[packages/medusa/src/services/line-item.ts:396](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L396) +[packages/medusa/src/services/line-item.ts:396](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L396) ___ @@ -621,7 +621,7 @@ ___ #### Defined in -[packages/medusa/src/services/line-item.ts:558](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/line-item.ts#L558) +[packages/medusa/src/services/line-item.ts:558](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/line-item.ts#L558) ___ @@ -645,4 +645,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/MiddlewareService.md b/docs/content/references/services/classes/MiddlewareService.md index ac131e917a..ea0438a85e 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/f8d635845/packages/medusa/src/services/middleware.ts#L22) +[packages/medusa/src/services/middleware.ts:22](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L17) +[packages/medusa/src/services/middleware.ts:17](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L18) +[packages/medusa/src/services/middleware.ts:18](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L19) +[packages/medusa/src/services/middleware.ts:19](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L20) +[packages/medusa/src/services/middleware.ts:20](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L60) +[packages/medusa/src/services/middleware.ts:60](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L79) +[packages/medusa/src/services/middleware.ts:79](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L96) +[packages/medusa/src/services/middleware.ts:96](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L29) +[packages/medusa/src/services/middleware.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L34) +[packages/medusa/src/services/middleware.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L106) +[packages/medusa/src/services/middleware.ts:106](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L117) +[packages/medusa/src/services/middleware.ts:117](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L123) +[packages/medusa/src/services/middleware.ts:123](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/services/middleware.ts#L43) +[packages/medusa/src/services/middleware.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/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 01f29d4141..79b337b4e0 100644 --- a/docs/content/references/services/classes/NewTotalsService.md +++ b/docs/content/references/services/classes/NewTotalsService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/new-totals.ts:68](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L68) +[packages/medusa/src/services/new-totals.ts:68](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:65](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L65) +[packages/medusa/src/services/new-totals.ts:65](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L65) ___ @@ -90,7 +90,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/new-totals.ts:61](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L61) +[packages/medusa/src/services/new-totals.ts:61](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L61) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:66](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L66) +[packages/medusa/src/services/new-totals.ts:66](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L66) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:64](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L64) +[packages/medusa/src/services/new-totals.ts:64](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L64) ___ @@ -124,7 +124,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/new-totals.ts:62](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L62) +[packages/medusa/src/services/new-totals.ts:62](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L62) ## Methods @@ -163,7 +163,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -189,7 +189,7 @@ Calculate and return the gift cards totals #### Defined in -[packages/medusa/src/services/new-totals.ts:448](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L448) +[packages/medusa/src/services/new-totals.ts:445](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L445) ___ @@ -220,7 +220,7 @@ Calculate and return the gift cards totals based on their transactions #### Defined in -[packages/medusa/src/services/new-totals.ts:527](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L527) +[packages/medusa/src/services/new-totals.ts:524](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L524) ___ @@ -250,7 +250,7 @@ Return the amount that can be refund on a line item #### Defined in -[packages/medusa/src/services/new-totals.ts:333](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L333) +[packages/medusa/src/services/new-totals.ts:331](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L331) ___ @@ -277,7 +277,7 @@ ___ #### Defined in -[packages/medusa/src/services/new-totals.ts:403](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L403) +[packages/medusa/src/services/new-totals.ts:401](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L401) ___ @@ -303,7 +303,7 @@ Calculate and return the items totals for either the legacy calculation or the n #### Defined in -[packages/medusa/src/services/new-totals.ts:90](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L90) +[packages/medusa/src/services/new-totals.ts:90](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L90) ___ @@ -331,7 +331,7 @@ Calculate and return the legacy calculated totals using the tax rate #### Defined in -[packages/medusa/src/services/new-totals.ts:256](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L256) +[packages/medusa/src/services/new-totals.ts:255](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L255) ___ @@ -360,7 +360,7 @@ Calculate and return the totals for an item #### Defined in -[packages/medusa/src/services/new-totals.ts:151](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L151) +[packages/medusa/src/services/new-totals.ts:151](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L151) ___ @@ -387,7 +387,7 @@ Calculate and return the shipping methods totals for either the legacy calculati #### Defined in -[packages/medusa/src/services/new-totals.ts:573](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L573) +[packages/medusa/src/services/new-totals.ts:570](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L570) ___ @@ -413,7 +413,7 @@ Calculate and return the shipping method totals legacy using teh tax rate #### Defined in -[packages/medusa/src/services/new-totals.ts:731](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L731) +[packages/medusa/src/services/new-totals.ts:728](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L728) ___ @@ -440,7 +440,7 @@ Calculate and return the shipping method totals #### Defined in -[packages/medusa/src/services/new-totals.ts:648](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/new-totals.ts#L648) +[packages/medusa/src/services/new-totals.ts:645](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/new-totals.ts#L645) ___ @@ -464,7 +464,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -488,4 +488,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/NoteService.md b/docs/content/references/services/classes/NoteService.md index fb087646d7..fbbd8ab46b 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/f8d635845/packages/medusa/src/services/note.ts#L29) +[packages/medusa/src/services/note.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/note.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L27) +[packages/medusa/src/services/note.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L27) ___ @@ -90,7 +90,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/note.ts:24](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L24) +[packages/medusa/src/services/note.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L24) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/note.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L26) +[packages/medusa/src/services/note.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L26) ___ @@ -114,7 +114,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L25) +[packages/medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L25) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/note.ts:18](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L18) +[packages/medusa/src/services/note.ts:18](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L18) ## Methods @@ -171,7 +171,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -197,7 +197,7 @@ resolves to the creation result #### Defined in -[packages/medusa/src/services/note.ts:103](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L103) +[packages/medusa/src/services/note.ts:103](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L103) ___ @@ -219,7 +219,7 @@ Deletes a given note #### Defined in -[packages/medusa/src/services/note.ts:161](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L161) +[packages/medusa/src/services/note.ts:161](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L161) ___ @@ -244,7 +244,7 @@ notes related to the given search. #### Defined in -[packages/medusa/src/services/note.ts:82](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L82) +[packages/medusa/src/services/note.ts:82](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L82) ___ @@ -269,7 +269,7 @@ which resolves to the requested note. #### Defined in -[packages/medusa/src/services/note.ts:47](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L47) +[packages/medusa/src/services/note.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L47) ___ @@ -293,7 +293,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -318,7 +318,7 @@ resolves to the updated element #### Defined in -[packages/medusa/src/services/note.ts:139](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/note.ts#L139) +[packages/medusa/src/services/note.ts:139](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/note.ts#L139) ___ @@ -342,4 +342,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/NotificationService.md b/docs/content/references/services/classes/NotificationService.md index 8bebba2808..942b26a44d 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/f8d635845/packages/medusa/src/services/notification.ts#L36) +[packages/medusa/src/services/notification.ts:36](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L27) +[packages/medusa/src/services/notification.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L27) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:28](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L28) +[packages/medusa/src/services/notification.ts:28](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L28) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L31) +[packages/medusa/src/services/notification.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L31) ___ @@ -110,7 +110,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/notification.ts:23](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L23) +[packages/medusa/src/services/notification.ts:23](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L23) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:34](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L34) +[packages/medusa/src/services/notification.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L34) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:32](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L32) +[packages/medusa/src/services/notification.ts:32](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L32) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/notification.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L26) +[packages/medusa/src/services/notification.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L26) ___ @@ -154,7 +154,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L24) +[packages/medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L24) ## Methods @@ -193,7 +193,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -220,7 +220,7 @@ the result of notification subscribed #### Defined in -[packages/medusa/src/services/notification.ts:174](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L174) +[packages/medusa/src/services/notification.ts:174](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L174) ___ @@ -245,7 +245,7 @@ the notifications that satisfy the query. #### Defined in -[packages/medusa/src/services/notification.ts:86](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L86) +[packages/medusa/src/services/notification.ts:86](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L86) ___ @@ -268,7 +268,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/f8d635845/packages/medusa/src/services/notification.ts#L62) +[packages/medusa/src/services/notification.ts:62](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L62) ___ @@ -290,7 +290,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/f8d635845/packages/medusa/src/services/notification.ts#L70) +[packages/medusa/src/services/notification.ts:70](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L70) ___ @@ -316,7 +316,7 @@ the newly created notification #### Defined in -[packages/medusa/src/services/notification.ts:254](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L254) +[packages/medusa/src/services/notification.ts:254](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L254) ___ @@ -341,7 +341,7 @@ the notification #### Defined in -[packages/medusa/src/services/notification.ts:107](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L107) +[packages/medusa/src/services/notification.ts:107](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L107) ___ @@ -366,7 +366,7 @@ the notification provider #### Defined in -[packages/medusa/src/services/notification.ts:155](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L155) +[packages/medusa/src/services/notification.ts:155](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L155) ___ @@ -393,7 +393,7 @@ the created notification #### Defined in -[packages/medusa/src/services/notification.ts:206](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L206) +[packages/medusa/src/services/notification.ts:206](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L206) ___ @@ -417,7 +417,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -440,7 +440,7 @@ Subscribes a given provider to an event. #### Defined in -[packages/medusa/src/services/notification.ts:134](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/notification.ts#L134) +[packages/medusa/src/services/notification.ts:134](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/notification.ts#L134) ___ @@ -464,4 +464,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/OauthService.md b/docs/content/references/services/classes/OauthService.md index a5f0eb0b3e..6b51f9f2e8 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/f8d635845/packages/medusa/src/services/oauth.ts#L31) +[packages/medusa/src/services/oauth.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L27) +[packages/medusa/src/services/oauth.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L27) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:29](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L29) +[packages/medusa/src/services/oauth.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L29) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L26) +[packages/medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L26) ___ @@ -110,7 +110,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L19) +[packages/medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L19) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L28) +[packages/medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L28) ___ @@ -134,7 +134,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/oauth.ts:20](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L20) +[packages/medusa/src/services/oauth.ts:20](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L20) ___ @@ -151,7 +151,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:21](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L21) +[packages/medusa/src/services/oauth.ts:21](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L21) ## Methods @@ -190,7 +190,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -210,7 +210,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:88](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L88) +[packages/medusa/src/services/oauth.ts:88](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L88) ___ @@ -232,7 +232,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:122](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L122) +[packages/medusa/src/services/oauth.ts:122](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L122) ___ @@ -252,7 +252,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:80](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L80) +[packages/medusa/src/services/oauth.ts:80](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L80) ___ @@ -272,7 +272,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:156](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L156) +[packages/medusa/src/services/oauth.ts:156](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L156) ___ @@ -292,7 +292,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:112](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L112) +[packages/medusa/src/services/oauth.ts:112](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L112) ___ @@ -312,7 +312,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:57](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L57) +[packages/medusa/src/services/oauth.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L57) ___ @@ -332,7 +332,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L41) +[packages/medusa/src/services/oauth.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L41) ___ @@ -356,7 +356,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -377,7 +377,7 @@ ___ #### Defined in -[packages/medusa/src/services/oauth.ts:101](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/oauth.ts#L101) +[packages/medusa/src/services/oauth.ts:101](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/oauth.ts#L101) ___ @@ -401,4 +401,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/OrderEditItemChangeService.md b/docs/content/references/services/classes/OrderEditItemChangeService.md index 65b526bc3c..8d00e790c3 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/f8d635845/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/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:30](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L30) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L31) ___ @@ -100,7 +100,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L26) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:29](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L29) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:32](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L32) ___ @@ -134,7 +134,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L27) ___ @@ -151,7 +151,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:21](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L21) ## Methods @@ -190,7 +190,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -210,7 +210,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:86](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L86) ___ @@ -230,7 +230,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:102](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L102) ___ @@ -251,7 +251,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:73](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L73) ___ @@ -272,7 +272,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit-item-change.ts:51](https://github.com/medusajs/medusa/blob/f8d635845/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/fefc248a4/packages/medusa/src/services/order-edit-item-change.ts#L51) ___ @@ -296,7 +296,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -320,4 +320,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/OrderEditService.md b/docs/content/references/services/classes/OrderEditService.md index f7bcec8e79..c61070c58c 100644 --- a/docs/content/references/services/classes/OrderEditService.md +++ b/docs/content/references/services/classes/OrderEditService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/order-edit.ts:68](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L68) +[packages/medusa/src/services/order-edit.ts:68](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L63) +[packages/medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L63) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:65](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L65) +[packages/medusa/src/services/order-edit.ts:65](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L65) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:62](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L62) +[packages/medusa/src/services/order-edit.ts:62](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L62) ___ @@ -110,7 +110,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/order-edit.ts:54](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L54) +[packages/medusa/src/services/order-edit.ts:54](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L54) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:61](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L61) +[packages/medusa/src/services/order-edit.ts:61](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L61) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:66](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L66) +[packages/medusa/src/services/order-edit.ts:66](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L66) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:57](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L57) +[packages/medusa/src/services/order-edit.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L57) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:59](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L59) +[packages/medusa/src/services/order-edit.ts:59](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L59) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:64](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L64) +[packages/medusa/src/services/order-edit.ts:64](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L64) ___ @@ -170,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:60](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L60) +[packages/medusa/src/services/order-edit.ts:60](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L60) ___ @@ -184,7 +184,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/order-edit.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L55) +[packages/medusa/src/services/order-edit.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L55) ___ @@ -205,7 +205,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L45) +[packages/medusa/src/services/order-edit.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L45) ## Methods @@ -226,7 +226,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:534](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L534) +[packages/medusa/src/services/order-edit.ts:534](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L534) ___ @@ -265,7 +265,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -287,7 +287,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:678](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L678) +[packages/medusa/src/services/order-edit.ts:678](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L678) ___ @@ -309,7 +309,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:717](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L717) +[packages/medusa/src/services/order-edit.ts:717](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L717) ___ @@ -331,7 +331,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:156](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L156) +[packages/medusa/src/services/order-edit.ts:156](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L156) ___ @@ -354,7 +354,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:258](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L258) +[packages/medusa/src/services/order-edit.ts:258](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L258) ___ @@ -374,7 +374,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:491](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L491) +[packages/medusa/src/services/order-edit.ts:491](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L491) ___ @@ -394,7 +394,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:234](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L234) +[packages/medusa/src/services/order-edit.ts:234](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L234) ___ @@ -414,7 +414,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:790](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L790) +[packages/medusa/src/services/order-edit.ts:790](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L790) ___ @@ -435,7 +435,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:606](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L606) +[packages/medusa/src/services/order-edit.ts:606](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L606) ___ @@ -456,7 +456,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:148](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L148) +[packages/medusa/src/services/order-edit.ts:148](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L148) ___ @@ -477,7 +477,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:124](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L124) +[packages/medusa/src/services/order-edit.ts:124](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L124) ___ @@ -499,7 +499,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:439](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L439) +[packages/medusa/src/services/order-edit.ts:439](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L439) ___ @@ -520,7 +520,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:382](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L382) +[packages/medusa/src/services/order-edit.ts:382](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L382) ___ @@ -542,7 +542,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:638](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L638) +[packages/medusa/src/services/order-edit.ts:638](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L638) ___ @@ -563,7 +563,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:95](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L95) +[packages/medusa/src/services/order-edit.ts:95](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L95) ___ @@ -584,7 +584,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:769](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L769) +[packages/medusa/src/services/order-edit.ts:769](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L769) ___ @@ -608,7 +608,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -624,7 +624,7 @@ ___ | `data` | `Object` | | `data.canceled_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | | `data.canceled_by?` | `string` | -| `data.changes?` | (`undefined` \| { type?: OrderEditItemChangeType \| undefined; order\_edit\_id?: string \| undefined; order\_edit?: { order\_id?: string \| undefined; order?: { readonly object?: "order" \| undefined; ... 51 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 27 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 7 ...)[] | +| `data.changes?` | (`undefined` \| { type?: OrderEditItemChangeType \| undefined; order\_edit\_id?: string \| undefined; order\_edit?: { order\_id?: string \| undefined; order?: { readonly object?: "order" \| undefined; ... 52 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 27 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 7 ...)[] | | `data.confirmed_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | | `data.confirmed_by?` | `string` | | `data.created_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | @@ -639,7 +639,7 @@ ___ | `data.id?` | `string` | | `data.internal_note?` | `string` | | `data.items?` | (`undefined` \| { cart\_id?: string \| undefined; cart?: { readonly object?: "cart" \| undefined; email?: string \| undefined; billing\_address\_id?: string \| undefined; billing\_address?: { customer\_id?: string \| ... 1 more ... \| undefined; ... 16 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 36 more ...; updated\_at?: {...)[] | -| `data.order?` | { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; payment\_status?: PaymentStatus \| undefined; ... 48 more ...; updated\_at?: { ...; } \| undefined; } | +| `data.order?` | { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; payment\_status?: PaymentStatus \| undefined; ... 49 more ...; updated\_at?: { ...; } \| undefined; } | | `data.order_id?` | `string` | | `data.payment_collection?` | { type?: PaymentCollectionType \| undefined; status?: PaymentCollectionStatus \| undefined; description?: string \| null \| undefined; ... 13 more ...; updated\_at?: { ...; } \| undefined; } | | `data.payment_collection_id?` | `string` | @@ -659,7 +659,7 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:205](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L205) +[packages/medusa/src/services/order-edit.ts:205](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L205) ___ @@ -686,7 +686,7 @@ Create or update order edit item change line item and apply the quantity #### Defined in -[packages/medusa/src/services/order-edit.ts:309](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L309) +[packages/medusa/src/services/order-edit.ts:309](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L309) ___ @@ -710,7 +710,7 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ @@ -730,4 +730,4 @@ ___ #### Defined in -[packages/medusa/src/services/order-edit.ts:836](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order-edit.ts#L836) +[packages/medusa/src/services/order-edit.ts:836](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order-edit.ts#L836) diff --git a/docs/content/references/services/classes/OrderService.md b/docs/content/references/services/classes/OrderService.md index 91adffd680..2ec844ee56 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:129](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L129) +[packages/medusa/src/services/order.ts:125](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L125) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:121](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L121) +[packages/medusa/src/services/order.ts:117](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L117) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:120](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L120) +[packages/medusa/src/services/order.ts:116](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L116) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:108](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L108) +[packages/medusa/src/services/order.ts:104](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L104) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:112](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L112) +[packages/medusa/src/services/order.ts:108](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L108) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:123](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L123) +[packages/medusa/src/services/order.ts:119](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L119) ___ @@ -126,7 +126,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:124](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L124) +[packages/medusa/src/services/order.ts:120](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L120) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:125](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L125) +[packages/medusa/src/services/order.ts:121](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L121) ___ @@ -146,7 +146,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:113](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L113) +[packages/medusa/src/services/order.ts:109](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L109) ___ @@ -156,7 +156,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:114](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L114) +[packages/medusa/src/services/order.ts:110](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L110) ___ @@ -166,7 +166,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:122](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L122) +[packages/medusa/src/services/order.ts:118](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L118) ___ @@ -176,7 +176,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:115](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L115) +[packages/medusa/src/services/order.ts:111](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L111) ___ @@ -190,7 +190,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/order.ts:104](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L104) +[packages/medusa/src/services/order.ts:100](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L100) ___ @@ -200,7 +200,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:117](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L117) +[packages/medusa/src/services/order.ts:113](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L113) ___ @@ -210,7 +210,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:107](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L107) +[packages/medusa/src/services/order.ts:103](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L103) ___ @@ -220,7 +220,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:109](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L109) +[packages/medusa/src/services/order.ts:105](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L105) ___ @@ -230,7 +230,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:127](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L127) +[packages/medusa/src/services/order.ts:123](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L123) ___ @@ -240,7 +240,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:119](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L119) +[packages/medusa/src/services/order.ts:115](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L115) ___ @@ -250,7 +250,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:110](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L110) +[packages/medusa/src/services/order.ts:106](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L106) ___ @@ -260,7 +260,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:111](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L111) +[packages/medusa/src/services/order.ts:107](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L107) ___ @@ -270,7 +270,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:118](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L118) +[packages/medusa/src/services/order.ts:114](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L114) ___ @@ -280,7 +280,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:116](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L116) +[packages/medusa/src/services/order.ts:112](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L112) ___ @@ -294,7 +294,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/order.ts:105](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L105) +[packages/medusa/src/services/order.ts:101](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L101) ___ @@ -325,7 +325,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:85](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L85) +[packages/medusa/src/services/order.ts:81](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L81) ## Methods @@ -348,7 +348,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:947](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L947) +[packages/medusa/src/services/order.ts:943](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L943) ___ @@ -373,7 +373,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:1484](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1484) +[packages/medusa/src/services/order.ts:1480](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1480) ___ @@ -412,7 +412,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -438,7 +438,7 @@ result of the update operation. #### Defined in -[packages/medusa/src/services/order.ts:1099](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1099) +[packages/medusa/src/services/order.ts:1095](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1095) ___ @@ -462,7 +462,7 @@ updated order #### Defined in -[packages/medusa/src/services/order.ts:1421](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1421) +[packages/medusa/src/services/order.ts:1417](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1417) ___ @@ -486,7 +486,7 @@ result of the update operation. #### Defined in -[packages/medusa/src/services/order.ts:1188](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1188) +[packages/medusa/src/services/order.ts:1184](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1184) ___ @@ -508,7 +508,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/order.ts:517](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L517) +[packages/medusa/src/services/order.ts:513](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L513) ___ @@ -532,7 +532,7 @@ resolves to the creation result. #### Defined in -[packages/medusa/src/services/order.ts:545](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L545) +[packages/medusa/src/services/order.ts:541](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L541) ___ @@ -564,7 +564,7 @@ result of the update operation. #### Defined in -[packages/medusa/src/services/order.ts:1293](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1293) +[packages/medusa/src/services/order.ts:1289](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1289) ___ @@ -586,7 +586,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:735](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L735) +[packages/medusa/src/services/order.ts:731](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L731) ___ @@ -615,7 +615,7 @@ the result of the refund operation. #### Defined in -[packages/medusa/src/services/order.ts:1510](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1510) +[packages/medusa/src/services/order.ts:1506](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1506) ___ @@ -646,13 +646,13 @@ the resulting order following the update. #### Defined in -[packages/medusa/src/services/order.ts:789](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L789) +[packages/medusa/src/services/order.ts:785](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L785) ___ ### decorateTotals -â–¸ **decorateTotals**(`order`, `totalsFieldsOrConfig?`): `Promise`<`Order`\> +â–¸ **decorateTotals**(`order`, `totalsFields?`): `Promise`<`Order`\> Calculate and attach the different total fields on the object @@ -661,7 +661,7 @@ Calculate and attach the different total fields on the object | Name | Type | | :------ | :------ | | `order` | `Order` | -| `totalsFieldsOrConfig?` | `string`[] \| `TotalsConfig` | +| `totalsFields?` | `string`[] | #### Returns @@ -669,7 +669,26 @@ Calculate and attach the different total fields on the object #### Defined in -[packages/medusa/src/services/order.ts:1710](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1710) +[packages/medusa/src/services/order.ts:1701](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1701) + +â–¸ **decorateTotals**(`order`, `context?`): `Promise`<`Order`\> + +Calculate and attach the different total fields on the object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `order` | `Order` | +| `context?` | `TotalsContext` | + +#### Returns + +`Promise`<`Order`\> + +#### Defined in + +[packages/medusa/src/services/order.ts:1703](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1703) ___ @@ -690,7 +709,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:1576](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1576) +[packages/medusa/src/services/order.ts:1572](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1572) ___ @@ -716,7 +735,7 @@ the line items generated by the transformer. #### Defined in -[packages/medusa/src/services/order.ts:1463](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1463) +[packages/medusa/src/services/order.ts:1459](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1459) ___ @@ -736,7 +755,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:1936](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1936) +[packages/medusa/src/services/order.ts:1961](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1961) ___ @@ -759,7 +778,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/order.ts:183](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L183) +[packages/medusa/src/services/order.ts:179](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L179) ___ @@ -782,7 +801,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/order.ts:200](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L200) +[packages/medusa/src/services/order.ts:196](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L196) ___ @@ -814,7 +833,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:1861](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1861) +[packages/medusa/src/services/order.ts:1886](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1886) ___ @@ -839,7 +858,7 @@ the order document #### Defined in -[packages/medusa/src/services/order.ts:343](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L343) +[packages/medusa/src/services/order.ts:339](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L339) ___ @@ -864,7 +883,7 @@ the order document #### Defined in -[packages/medusa/src/services/order.ts:439](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L439) +[packages/medusa/src/services/order.ts:435](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L435) ___ @@ -889,7 +908,7 @@ the order document #### Defined in -[packages/medusa/src/services/order.ts:480](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L480) +[packages/medusa/src/services/order.ts:476](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L476) ___ @@ -910,13 +929,13 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:384](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L384) +[packages/medusa/src/services/order.ts:380](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L380) ___ ### retrieveWithTotals -â–¸ **retrieveWithTotals**(`orderId`, `options?`, `totalsConfig?`): `Promise`<`Order`\> +â–¸ **retrieveWithTotals**(`orderId`, `options?`, `context?`): `Promise`<`Order`\> #### Parameters @@ -924,7 +943,7 @@ ___ | :------ | :------ | | `orderId` | `string` | | `options` | `FindConfig`<`Order`\> | -| `totalsConfig` | `TotalsConfig` | +| `context` | `TotalsContext` | #### Returns @@ -932,7 +951,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:422](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L422) +[packages/medusa/src/services/order.ts:418](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L418) ___ @@ -956,7 +975,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -982,7 +1001,7 @@ ___ #### Defined in -[packages/medusa/src/services/order.ts:267](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L267) +[packages/medusa/src/services/order.ts:263](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L263) ___ @@ -1009,7 +1028,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/order.ts:1010](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1010) +[packages/medusa/src/services/order.ts:1006](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1006) ___ @@ -1034,7 +1053,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:877](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L877) +[packages/medusa/src/services/order.ts:873](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L873) ___ @@ -1059,7 +1078,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/order.ts:916](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L916) +[packages/medusa/src/services/order.ts:912](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L912) ___ @@ -1088,7 +1107,7 @@ a line item that has the requested fulfillment quantity #### Defined in -[packages/medusa/src/services/order.ts:1260](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/order.ts#L1260) +[packages/medusa/src/services/order.ts:1256](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/order.ts#L1256) ___ @@ -1112,4 +1131,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/PaymentCollectionService.md b/docs/content/references/services/classes/PaymentCollectionService.md index d887eebfa0..ca0c8a18a5 100644 --- a/docs/content/references/services/classes/PaymentCollectionService.md +++ b/docs/content/references/services/classes/PaymentCollectionService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/payment-collection.ts:51](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L51) +[packages/medusa/src/services/payment-collection.ts:51](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:47](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L47) +[packages/medusa/src/services/payment-collection.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L47) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L45) +[packages/medusa/src/services/payment-collection.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L45) ___ @@ -100,7 +100,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/payment-collection.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L43) +[packages/medusa/src/services/payment-collection.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L43) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L49) +[packages/medusa/src/services/payment-collection.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L49) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L46) +[packages/medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L46) ___ @@ -134,7 +134,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L44) +[packages/medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L44) ___ @@ -153,7 +153,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:36](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L36) +[packages/medusa/src/services/payment-collection.ts:36](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L36) ## Methods @@ -192,7 +192,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -218,7 +218,7 @@ the payment collection and its payment session. #### Defined in -[packages/medusa/src/services/payment-collection.ts:535](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L535) +[packages/medusa/src/services/payment-collection.ts:535](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L535) ___ @@ -242,7 +242,7 @@ the payment collection created. #### Defined in -[packages/medusa/src/services/payment-collection.ts:111](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L111) +[packages/medusa/src/services/payment-collection.ts:111](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L111) ___ @@ -266,7 +266,7 @@ the payment collection removed. #### Defined in -[packages/medusa/src/services/payment-collection.ts:180](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L180) +[packages/medusa/src/services/payment-collection.ts:180](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L180) ___ @@ -287,7 +287,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-collection.ts:218](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L218) +[packages/medusa/src/services/payment-collection.ts:218](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L218) ___ @@ -311,7 +311,7 @@ the payment session authorized. #### Defined in -[packages/medusa/src/services/payment-collection.ts:506](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L506) +[packages/medusa/src/services/payment-collection.ts:506](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L506) ___ @@ -337,7 +337,7 @@ the new payment session created. #### Defined in -[packages/medusa/src/services/payment-collection.ts:414](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L414) +[packages/medusa/src/services/payment-collection.ts:414](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L414) ___ @@ -362,7 +362,7 @@ the payment collection. #### Defined in -[packages/medusa/src/services/payment-collection.ts:74](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L74) +[packages/medusa/src/services/payment-collection.ts:74](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L74) ___ @@ -388,7 +388,7 @@ the payment collection and its payment session. #### Defined in -[packages/medusa/src/services/payment-collection.ts:368](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L368) +[packages/medusa/src/services/payment-collection.ts:368](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L368) ___ @@ -414,7 +414,7 @@ the payment collection and its payment sessions. #### Defined in -[packages/medusa/src/services/payment-collection.ts:233](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L233) +[packages/medusa/src/services/payment-collection.ts:233](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L233) ___ @@ -438,7 +438,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -480,7 +480,7 @@ the payment collection updated. #### Defined in -[packages/medusa/src/services/payment-collection.ts:146](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-collection.ts#L146) +[packages/medusa/src/services/payment-collection.ts:146](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-collection.ts#L146) ___ @@ -504,4 +504,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/PaymentProviderService.md b/docs/content/references/services/classes/PaymentProviderService.md index 4358ad3f6b..77b7be354c 100644 --- a/docs/content/references/services/classes/PaymentProviderService.md +++ b/docs/content/references/services/classes/PaymentProviderService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/payment-provider.ts:64](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L64) +[packages/medusa/src/services/payment-provider.ts:64](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L64) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:53](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L53) +[packages/medusa/src/services/payment-provider.ts:53](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L53) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:59](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L59) +[packages/medusa/src/services/payment-provider.ts:59](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L59) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:62](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L62) +[packages/medusa/src/services/payment-provider.ts:62](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L62) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:60](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L60) +[packages/medusa/src/services/payment-provider.ts:60](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L60) ___ @@ -122,7 +122,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/payment-provider.ts:51](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L51) +[packages/medusa/src/services/payment-provider.ts:51](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L51) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:56](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L56) +[packages/medusa/src/services/payment-provider.ts:56](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L56) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:57](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L57) +[packages/medusa/src/services/payment-provider.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L57) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:54](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L54) +[packages/medusa/src/services/payment-provider.ts:54](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L54) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:58](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L58) +[packages/medusa/src/services/payment-provider.ts:58](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L58) ___ @@ -176,7 +176,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/payment-provider.ts:52](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L52) +[packages/medusa/src/services/payment-provider.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L52) ## Methods @@ -215,7 +215,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -236,7 +236,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:395](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L395) +[packages/medusa/src/services/payment-provider.ts:395](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L395) ___ @@ -258,7 +258,7 @@ Build the create session context for both legacy and new API #### Defined in -[packages/medusa/src/services/payment-provider.ts:641](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L641) +[packages/medusa/src/services/payment-provider.ts:641](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L641) ___ @@ -278,7 +278,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:448](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L448) +[packages/medusa/src/services/payment-provider.ts:448](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L448) ___ @@ -298,7 +298,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:473](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L473) +[packages/medusa/src/services/payment-provider.ts:473](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L473) ___ @@ -318,7 +318,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:357](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L357) +[packages/medusa/src/services/payment-provider.ts:357](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L357) ___ @@ -349,7 +349,7 @@ the payment session #### Defined in -[packages/medusa/src/services/payment-provider.ts:180](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L180) +[packages/medusa/src/services/payment-provider.ts:180](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L180) ___ @@ -369,7 +369,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:303](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L303) +[packages/medusa/src/services/payment-provider.ts:303](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L303) ___ @@ -389,7 +389,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:468](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L468) +[packages/medusa/src/services/payment-provider.ts:468](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L468) ___ @@ -403,7 +403,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:97](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L97) +[packages/medusa/src/services/payment-provider.ts:97](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L97) ___ @@ -424,7 +424,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:132](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L132) +[packages/medusa/src/services/payment-provider.ts:132](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L132) ___ @@ -449,7 +449,7 @@ Process the collected data. Can be used every time we need to process some colle #### Defined in -[packages/medusa/src/services/payment-provider.ts:731](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L731) +[packages/medusa/src/services/payment-provider.ts:731](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L731) ___ @@ -478,7 +478,7 @@ the payment session #### Defined in -[packages/medusa/src/services/payment-provider.ts:238](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L238) +[packages/medusa/src/services/payment-provider.ts:238](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L238) ___ @@ -501,7 +501,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:578](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L578) +[packages/medusa/src/services/payment-provider.ts:578](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L578) ___ @@ -524,7 +524,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:493](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L493) +[packages/medusa/src/services/payment-provider.ts:493](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L493) ___ @@ -544,7 +544,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:78](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L78) +[packages/medusa/src/services/payment-provider.ts:78](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L78) ___ @@ -565,7 +565,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:104](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L104) +[packages/medusa/src/services/payment-provider.ts:104](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L104) ___ @@ -595,7 +595,7 @@ the payment provider #### Defined in -[packages/medusa/src/services/payment-provider.ts:333](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L333) +[packages/medusa/src/services/payment-provider.ts:333](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L333) ___ @@ -616,7 +616,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:618](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L618) +[packages/medusa/src/services/payment-provider.ts:618](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L618) ___ @@ -637,7 +637,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:145](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L145) +[packages/medusa/src/services/payment-provider.ts:145](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L145) ___ @@ -667,7 +667,7 @@ Create or update a Payment session data. #### Defined in -[packages/medusa/src/services/payment-provider.ts:681](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L681) +[packages/medusa/src/services/payment-provider.ts:681](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L681) ___ @@ -691,7 +691,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -714,7 +714,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:383](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L383) +[packages/medusa/src/services/payment-provider.ts:383](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L383) ___ @@ -742,7 +742,7 @@ the payment session #### Defined in -[packages/medusa/src/services/payment-provider.ts:268](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L268) +[packages/medusa/src/services/payment-provider.ts:268](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L268) ___ @@ -763,7 +763,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment-provider.ts:427](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment-provider.ts#L427) +[packages/medusa/src/services/payment-provider.ts:427](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment-provider.ts#L427) ___ @@ -787,4 +787,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/PaymentService.md b/docs/content/references/services/classes/PaymentService.md index c5e72d4542..526eb48e09 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/f8d635845/packages/medusa/src/services/payment.ts#L40) +[packages/medusa/src/services/payment.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L28) +[packages/medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L28) ___ @@ -90,7 +90,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/payment.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L26) +[packages/medusa/src/services/payment.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L26) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L29) +[packages/medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L29) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L30) +[packages/medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L30) ___ @@ -124,7 +124,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L27) +[packages/medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L27) ___ @@ -145,7 +145,7 @@ ___ #### Defined in -[packages/medusa/src/services/payment.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L31) +[packages/medusa/src/services/payment.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L31) ## Methods @@ -184,7 +184,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -208,7 +208,7 @@ the payment captured. #### Defined in -[packages/medusa/src/services/payment.ts:161](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L161) +[packages/medusa/src/services/payment.ts:161](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L161) ___ @@ -232,7 +232,7 @@ the payment created. #### Defined in -[packages/medusa/src/services/payment.ts:96](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L96) +[packages/medusa/src/services/payment.ts:96](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L96) ___ @@ -259,7 +259,7 @@ the refund created. #### Defined in -[packages/medusa/src/services/payment.ts:210](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L210) +[packages/medusa/src/services/payment.ts:210](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L210) ___ @@ -284,7 +284,7 @@ the payment. #### Defined in -[packages/medusa/src/services/payment.ts:61](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L61) +[packages/medusa/src/services/payment.ts:61](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L61) ___ @@ -308,7 +308,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -335,7 +335,7 @@ the payment updated. #### Defined in -[packages/medusa/src/services/payment.ts:127](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/payment.ts#L127) +[packages/medusa/src/services/payment.ts:127](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/payment.ts#L127) ___ @@ -359,4 +359,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/PriceListService.md b/docs/content/references/services/classes/PriceListService.md index 73985394b5..bb044cd362 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/f8d635845/packages/medusa/src/services/price-list.ts#L57) +[packages/medusa/src/services/price-list.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:48](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L48) +[packages/medusa/src/services/price-list.ts:48](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L48) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L55) +[packages/medusa/src/services/price-list.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L55) ___ @@ -102,7 +102,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/price-list.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L45) +[packages/medusa/src/services/price-list.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L45) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:53](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L53) +[packages/medusa/src/services/price-list.ts:53](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L53) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L52) +[packages/medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L52) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L50) +[packages/medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L50) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:54](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L54) +[packages/medusa/src/services/price-list.ts:54](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L54) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L49) +[packages/medusa/src/services/price-list.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L49) ___ @@ -166,7 +166,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/price-list.ts:46](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L46) +[packages/medusa/src/services/price-list.ts:46](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L46) ___ @@ -176,7 +176,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:51](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L51) +[packages/medusa/src/services/price-list.ts:51](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L51) ## Methods @@ -206,7 +206,7 @@ updated `prices` list #### Defined in -[packages/medusa/src/services/price-list.ts:519](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L519) +[packages/medusa/src/services/price-list.ts:519](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L519) ___ @@ -232,7 +232,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:218](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L218) +[packages/medusa/src/services/price-list.ts:218](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L218) ___ @@ -271,7 +271,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -295,7 +295,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:258](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L258) +[packages/medusa/src/services/price-list.ts:258](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L258) ___ @@ -319,7 +319,7 @@ created Price List #### Defined in -[packages/medusa/src/services/price-list.ts:119](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L119) +[packages/medusa/src/services/price-list.ts:119](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L119) ___ @@ -344,7 +344,7 @@ empty promise #### Defined in -[packages/medusa/src/services/price-list.ts:272](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L272) +[packages/medusa/src/services/price-list.ts:272](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L272) ___ @@ -369,7 +369,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:243](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L243) +[packages/medusa/src/services/price-list.ts:243](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L243) ___ @@ -390,7 +390,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:446](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L446) +[packages/medusa/src/services/price-list.ts:446](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L446) ___ @@ -411,7 +411,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:483](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L483) +[packages/medusa/src/services/price-list.ts:483](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L483) ___ @@ -436,7 +436,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/price-list.ts:292](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L292) +[packages/medusa/src/services/price-list.ts:292](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L292) ___ @@ -461,7 +461,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/price-list.ts:316](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L316) +[packages/medusa/src/services/price-list.ts:316](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L316) ___ @@ -484,7 +484,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:364](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L364) +[packages/medusa/src/services/price-list.ts:364](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L364) ___ @@ -507,7 +507,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:412](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L412) +[packages/medusa/src/services/price-list.ts:412](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L412) ___ @@ -532,7 +532,7 @@ the collection. #### Defined in -[packages/medusa/src/services/price-list.ts:88](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L88) +[packages/medusa/src/services/price-list.ts:88](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L88) ___ @@ -556,7 +556,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -581,7 +581,7 @@ updated Price List #### Defined in -[packages/medusa/src/services/price-list.ts:167](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L167) +[packages/medusa/src/services/price-list.ts:167](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L167) ___ @@ -602,7 +602,7 @@ ___ #### Defined in -[packages/medusa/src/services/price-list.ts:345](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/price-list.ts#L345) +[packages/medusa/src/services/price-list.ts:345](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/price-list.ts#L345) ___ @@ -626,4 +626,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/PricingService.md b/docs/content/references/services/classes/PricingService.md index 15b07c23ba..21e4bdccc8 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/f8d635845/packages/medusa/src/services/pricing.ts#L44) +[packages/medusa/src/services/pricing.ts:44](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:42](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L42) +[packages/medusa/src/services/pricing.ts:42](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L42) ___ @@ -92,7 +92,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/pricing.ts:36](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L36) +[packages/medusa/src/services/pricing.ts:36](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L36) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L40) +[packages/medusa/src/services/pricing.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L40) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L41) +[packages/medusa/src/services/pricing.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L41) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:38](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L38) +[packages/medusa/src/services/pricing.ts:38](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L38) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:39](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L39) +[packages/medusa/src/services/pricing.ts:39](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L39) ___ @@ -146,7 +146,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/pricing.ts:37](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L37) +[packages/medusa/src/services/pricing.ts:37](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L37) ## Methods @@ -185,7 +185,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -210,7 +210,7 @@ The tax related variant prices. #### Defined in -[packages/medusa/src/services/pricing.ts:105](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L105) +[packages/medusa/src/services/pricing.ts:105](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L105) ___ @@ -235,7 +235,7 @@ The pricing context #### Defined in -[packages/medusa/src/services/pricing.ts:69](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L69) +[packages/medusa/src/services/pricing.ts:69](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L69) ___ @@ -261,7 +261,7 @@ A map of variant ids to their corresponding prices #### Defined in -[packages/medusa/src/services/pricing.ts:389](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L389) +[packages/medusa/src/services/pricing.ts:389](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L389) ___ @@ -286,7 +286,7 @@ A map of variant ids to their corresponding prices #### Defined in -[packages/medusa/src/services/pricing.ts:407](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L407) +[packages/medusa/src/services/pricing.ts:407](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L407) ___ @@ -308,7 +308,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:351](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L351) +[packages/medusa/src/services/pricing.ts:351](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L351) ___ @@ -333,7 +333,7 @@ The product variant prices #### Defined in -[packages/medusa/src/services/pricing.ts:214](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L214) +[packages/medusa/src/services/pricing.ts:214](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L214) ___ @@ -362,7 +362,7 @@ The product variant prices #### Defined in -[packages/medusa/src/services/pricing.ts:253](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L253) +[packages/medusa/src/services/pricing.ts:253](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L253) ___ @@ -384,7 +384,7 @@ ___ #### Defined in -[packages/medusa/src/services/pricing.ts:167](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L167) +[packages/medusa/src/services/pricing.ts:167](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L167) ___ @@ -416,7 +416,7 @@ The product variant prices #### Defined in -[packages/medusa/src/services/pricing.ts:294](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L294) +[packages/medusa/src/services/pricing.ts:294](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L294) ___ @@ -441,7 +441,7 @@ The shipping option prices #### Defined in -[packages/medusa/src/services/pricing.ts:493](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L493) +[packages/medusa/src/services/pricing.ts:493](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L493) ___ @@ -466,7 +466,7 @@ A list of products with variants decorated with prices #### Defined in -[packages/medusa/src/services/pricing.ts:450](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L450) +[packages/medusa/src/services/pricing.ts:450](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L450) ___ @@ -491,7 +491,7 @@ A list of shipping options with prices #### Defined in -[packages/medusa/src/services/pricing.ts:555](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L555) +[packages/medusa/src/services/pricing.ts:555](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L555) ___ @@ -516,7 +516,7 @@ A list of products with variants decorated with prices #### Defined in -[packages/medusa/src/services/pricing.ts:425](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/pricing.ts#L425) +[packages/medusa/src/services/pricing.ts:425](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/pricing.ts#L425) ___ @@ -540,7 +540,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -564,4 +564,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ProductCategoryService.md b/docs/content/references/services/classes/ProductCategoryService.md index 105be31e83..aa1fda3c53 100644 --- a/docs/content/references/services/classes/ProductCategoryService.md +++ b/docs/content/references/services/classes/ProductCategoryService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/product-category.ts:35](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L35) +[packages/medusa/src/services/product-category.ts:35](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L35) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-category.ts:25](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L25) +[packages/medusa/src/services/product-category.ts:25](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L25) ___ @@ -92,7 +92,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-category.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L27) +[packages/medusa/src/services/product-category.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L27) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-category.ts:24](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L24) +[packages/medusa/src/services/product-category.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L24) ___ @@ -116,7 +116,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-category.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L26) +[packages/medusa/src/services/product-category.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L26) ___ @@ -134,7 +134,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-category.ts:29](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L29) +[packages/medusa/src/services/product-category.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L29) ## Methods @@ -159,7 +159,7 @@ the product category on which the products have been added #### Defined in -[packages/medusa/src/services/product-category.ts:227](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L227) +[packages/medusa/src/services/product-category.ts:227](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L227) ___ @@ -198,7 +198,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -222,7 +222,7 @@ created product category #### Defined in -[packages/medusa/src/services/product-category.ts:132](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L132) +[packages/medusa/src/services/product-category.ts:132](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L132) ___ @@ -246,7 +246,7 @@ a promise #### Defined in -[packages/medusa/src/services/product-category.ts:191](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L191) +[packages/medusa/src/services/product-category.ts:191](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L191) ___ @@ -275,7 +275,7 @@ an array containing the product category as #### Defined in -[packages/medusa/src/services/product-category.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L55) +[packages/medusa/src/services/product-category.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L55) ___ @@ -300,7 +300,7 @@ the product category on which the products have been removed #### Defined in -[packages/medusa/src/services/product-category.ts:245](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L245) +[packages/medusa/src/services/product-category.ts:245](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L245) ___ @@ -326,7 +326,7 @@ the product category. #### Defined in -[packages/medusa/src/services/product-category.ts:92](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L92) +[packages/medusa/src/services/product-category.ts:92](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L92) ___ @@ -350,7 +350,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -375,7 +375,7 @@ updated product category #### Defined in -[packages/medusa/src/services/product-category.ts:156](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-category.ts#L156) +[packages/medusa/src/services/product-category.ts:156](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-category.ts#L156) ___ @@ -399,4 +399,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ProductCollectionService.md b/docs/content/references/services/classes/ProductCollectionService.md index 4683afdf33..2e2ae07c54 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/f8d635845/packages/medusa/src/services/product-collection.ts#L34) +[packages/medusa/src/services/product-collection.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:29](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L29) +[packages/medusa/src/services/product-collection.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L29) ___ @@ -92,7 +92,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-collection.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L26) +[packages/medusa/src/services/product-collection.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L26) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L31) +[packages/medusa/src/services/product-collection.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L31) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:32](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L32) +[packages/medusa/src/services/product-collection.ts:32](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L32) ___ @@ -126,7 +126,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-collection.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L27) +[packages/medusa/src/services/product-collection.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L27) ## Methods @@ -147,7 +147,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-collection.ts:181](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L181) +[packages/medusa/src/services/product-collection.ts:181](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L181) ___ @@ -186,7 +186,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -210,7 +210,7 @@ created collection #### Defined in -[packages/medusa/src/services/product-collection.ts:114](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L114) +[packages/medusa/src/services/product-collection.ts:114](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L114) ___ @@ -234,7 +234,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-collection.ts:163](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L163) +[packages/medusa/src/services/product-collection.ts:163](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L163) ___ @@ -261,7 +261,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-collection.ts:219](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L219) +[packages/medusa/src/services/product-collection.ts:219](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L219) ___ @@ -286,7 +286,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-collection.ts:236](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L236) +[packages/medusa/src/services/product-collection.ts:236](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L236) ___ @@ -307,7 +307,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-collection.ts:198](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L198) +[packages/medusa/src/services/product-collection.ts:198](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L198) ___ @@ -332,7 +332,7 @@ the collection. #### Defined in -[packages/medusa/src/services/product-collection.ts:54](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L54) +[packages/medusa/src/services/product-collection.ts:54](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L54) ___ @@ -357,7 +357,7 @@ the collection. #### Defined in -[packages/medusa/src/services/product-collection.ts:88](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L88) +[packages/medusa/src/services/product-collection.ts:88](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L88) ___ @@ -381,7 +381,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -406,7 +406,7 @@ update collection #### Defined in -[packages/medusa/src/services/product-collection.ts:133](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-collection.ts#L133) +[packages/medusa/src/services/product-collection.ts:133](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-collection.ts#L133) ___ @@ -430,4 +430,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ProductService.md b/docs/content/references/services/classes/ProductService.md index 8cdf22b531..ec525439e4 100644 --- a/docs/content/references/services/classes/ProductService.md +++ b/docs/content/references/services/classes/ProductService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/product.ts:78](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L78) +[packages/medusa/src/services/product.ts:78](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L78) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:68](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L68) +[packages/medusa/src/services/product.ts:68](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L68) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:69](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L69) +[packages/medusa/src/services/product.ts:69](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L69) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:63](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L63) +[packages/medusa/src/services/product.ts:63](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L63) ___ @@ -110,7 +110,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L55) +[packages/medusa/src/services/product.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L55) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:65](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L65) +[packages/medusa/src/services/product.ts:65](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L65) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:58](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L58) +[packages/medusa/src/services/product.ts:58](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L58) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:59](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L59) +[packages/medusa/src/services/product.ts:59](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L59) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:62](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L62) +[packages/medusa/src/services/product.ts:62](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L62) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:61](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L61) +[packages/medusa/src/services/product.ts:61](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L61) ___ @@ -170,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:60](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L60) +[packages/medusa/src/services/product.ts:60](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L60) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:66](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L66) +[packages/medusa/src/services/product.ts:66](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L66) ___ @@ -190,7 +190,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:67](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L67) +[packages/medusa/src/services/product.ts:67](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L67) ___ @@ -204,7 +204,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product.ts:56](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L56) +[packages/medusa/src/services/product.ts:56](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L56) ___ @@ -222,7 +222,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:72](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L72) +[packages/medusa/src/services/product.ts:72](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L72) ___ @@ -232,7 +232,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:71](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L71) +[packages/medusa/src/services/product.ts:71](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L71) ## Methods @@ -259,7 +259,7 @@ the result of the model update operation #### Defined in -[packages/medusa/src/services/product.ts:646](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L646) +[packages/medusa/src/services/product.ts:646](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L646) ___ @@ -298,7 +298,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -322,7 +322,7 @@ the result of the count operation #### Defined in -[packages/medusa/src/services/product.ts:171](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L171) +[packages/medusa/src/services/product.ts:171](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L171) ___ @@ -346,7 +346,7 @@ resolves to the creation result. #### Defined in -[packages/medusa/src/services/product.ts:383](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L383) +[packages/medusa/src/services/product.ts:383](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L383) ___ @@ -371,7 +371,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product.ts:612](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L612) +[packages/medusa/src/services/product.ts:612](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L612) ___ @@ -396,7 +396,7 @@ the updated product #### Defined in -[packages/medusa/src/services/product.ts:811](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L811) +[packages/medusa/src/services/product.ts:811](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L811) ___ @@ -418,7 +418,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:306](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L306) +[packages/medusa/src/services/product.ts:306](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L306) ___ @@ -441,7 +441,7 @@ Check if the product is assigned to at least one of the provided sales channels. #### Defined in -[packages/medusa/src/services/product.ts:361](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L361) +[packages/medusa/src/services/product.ts:361](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L361) ___ @@ -466,7 +466,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product.ts:117](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L117) +[packages/medusa/src/services/product.ts:117](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L117) ___ @@ -494,7 +494,7 @@ an array containing the products as #### Defined in -[packages/medusa/src/services/product.ts:141](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L141) +[packages/medusa/src/services/product.ts:141](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L141) ___ @@ -514,7 +514,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:346](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L346) +[packages/medusa/src/services/product.ts:346](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L346) ___ @@ -528,7 +528,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:337](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L337) +[packages/medusa/src/services/product.ts:337](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L337) ___ @@ -560,7 +560,7 @@ an object containing the query, relations and free-text #### Defined in -[packages/medusa/src/services/product.ts:908](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L908) +[packages/medusa/src/services/product.ts:908](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L908) ___ @@ -581,7 +581,7 @@ ___ #### Defined in -[packages/medusa/src/services/product.ts:689](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L689) +[packages/medusa/src/services/product.ts:689](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L689) ___ @@ -607,7 +607,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:186](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L186) +[packages/medusa/src/services/product.ts:186](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L186) ___ @@ -633,7 +633,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:230](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L230) +[packages/medusa/src/services/product.ts:230](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L230) ___ @@ -659,7 +659,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:209](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L209) +[packages/medusa/src/services/product.ts:209](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L209) ___ @@ -684,7 +684,7 @@ product option #### Defined in -[packages/medusa/src/services/product.ts:792](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L792) +[packages/medusa/src/services/product.ts:792](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L792) ___ @@ -709,7 +709,7 @@ an array of variants #### Defined in -[packages/medusa/src/services/product.ts:288](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L288) +[packages/medusa/src/services/product.ts:288](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L288) ___ @@ -735,7 +735,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product.ts:252](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L252) +[packages/medusa/src/services/product.ts:252](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L252) ___ @@ -759,7 +759,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -786,7 +786,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/product.ts:492](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L492) +[packages/medusa/src/services/product.ts:492](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L492) ___ @@ -813,7 +813,7 @@ the updated product #### Defined in -[packages/medusa/src/services/product.ts:735](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L735) +[packages/medusa/src/services/product.ts:735](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L735) ___ @@ -836,7 +836,7 @@ updated shipping options #### Defined in -[packages/medusa/src/services/product.ts:882](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product.ts#L882) +[packages/medusa/src/services/product.ts:882](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product.ts#L882) ___ @@ -860,4 +860,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ProductTypeService.md b/docs/content/references/services/classes/ProductTypeService.md index 0e1eb9d958..74a06fa892 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/f8d635845/packages/medusa/src/services/product-type.ts#L15) +[packages/medusa/src/services/product-type.ts:15](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -80,7 +80,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-type.ts#L10) +[packages/medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-type.ts#L10) ___ @@ -94,7 +94,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-type.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-type.ts#L11) +[packages/medusa/src/services/product-type.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-type.ts#L11) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-type.ts:13](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-type.ts#L13) +[packages/medusa/src/services/product-type.ts:13](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-type.ts#L13) ## Methods @@ -143,7 +143,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -168,7 +168,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-type.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-type.ts#L55) +[packages/medusa/src/services/product-type.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-type.ts#L55) ___ @@ -193,7 +193,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-type.ts:72](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-type.ts#L72) +[packages/medusa/src/services/product-type.ts:72](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-type.ts#L72) ___ @@ -219,7 +219,7 @@ the result of the find one operation. #### Defined in -[packages/medusa/src/services/product-type.ts:30](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-type.ts#L30) +[packages/medusa/src/services/product-type.ts:30](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-type.ts#L30) ___ @@ -243,7 +243,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -267,4 +267,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ProductVariantInventoryService.md b/docs/content/references/services/classes/ProductVariantInventoryService.md index 6f07ff5c84..41ed6a7aed 100644 --- a/docs/content/references/services/classes/ProductVariantInventoryService.md +++ b/docs/content/references/services/classes/ProductVariantInventoryService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L43) +[packages/medusa/src/services/product-variant-inventory.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L43) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L41) +[packages/medusa/src/services/product-variant-inventory.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L41) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L40) +[packages/medusa/src/services/product-variant-inventory.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L40) ___ @@ -100,7 +100,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:33](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L33) +[packages/medusa/src/services/product-variant-inventory.ts:33](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L33) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:38](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L38) +[packages/medusa/src/services/product-variant-inventory.ts:38](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L38) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:37](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L37) +[packages/medusa/src/services/product-variant-inventory.ts:37](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L37) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:36](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L36) +[packages/medusa/src/services/product-variant-inventory.ts:36](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L36) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:39](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L39) +[packages/medusa/src/services/product-variant-inventory.ts:39](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L39) ___ @@ -154,7 +154,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:34](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L34) +[packages/medusa/src/services/product-variant-inventory.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L34) ## Methods @@ -178,7 +178,7 @@ Adjusts inventory of a variant on a location #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:569](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L569) +[packages/medusa/src/services/product-variant-inventory.ts:573](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L573) ___ @@ -203,7 +203,7 @@ Adjusts the quantity of reservations for a line item by a given amount. #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:415](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L415) +[packages/medusa/src/services/product-variant-inventory.ts:419](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L419) ___ @@ -242,7 +242,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -268,7 +268,7 @@ the variant inventory item #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:255](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L255) +[packages/medusa/src/services/product-variant-inventory.ts:255](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L255) ___ @@ -295,7 +295,7 @@ boolean indicating if inventory is available #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:69](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L69) +[packages/medusa/src/services/product-variant-inventory.ts:69](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L69) ___ @@ -319,13 +319,13 @@ delete a reservation of variant quantity #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:534](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L534) +[packages/medusa/src/services/product-variant-inventory.ts:538](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L538) ___ ### detachInventoryItem -â–¸ **detachInventoryItem**(`variantId`, `inventoryItemId`): `Promise`<`void`\> +â–¸ **detachInventoryItem**(`inventoryItemId`, `variantId?`): `Promise`<`void`\> Remove a variant from an inventory item @@ -333,8 +333,8 @@ Remove a variant from an inventory item | Name | Type | Description | | :------ | :------ | :------ | -| `variantId` | `string` | variant id | | `inventoryItemId` | `string` | inventory item id | +| `variantId?` | `string` | variant id or undefined if all the variants will be affected | #### Returns @@ -342,7 +342,7 @@ Remove a variant from an inventory item #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:317](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L317) +[packages/medusa/src/services/product-variant-inventory.ts:317](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L317) ___ @@ -366,7 +366,7 @@ list of inventory items #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:173](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L173) +[packages/medusa/src/services/product-variant-inventory.ts:173](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L173) ___ @@ -390,7 +390,7 @@ variant inventory items for the variant id #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:192](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L192) +[packages/medusa/src/services/product-variant-inventory.ts:192](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L192) ___ @@ -414,7 +414,7 @@ lidt of inventory items for the variant #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:233](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L233) +[packages/medusa/src/services/product-variant-inventory.ts:233](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L233) ___ @@ -438,7 +438,7 @@ a list of product variants that are associated with the item id #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:215](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L215) +[packages/medusa/src/services/product-variant-inventory.ts:215](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L215) ___ @@ -462,7 +462,7 @@ Reserves a quantity of a variant #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:345](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L345) +[packages/medusa/src/services/product-variant-inventory.ts:349](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L349) ___ @@ -487,7 +487,7 @@ A promise that resolves with the product variant inventory item. #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:144](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L144) +[packages/medusa/src/services/product-variant-inventory.ts:144](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L144) ___ @@ -508,7 +508,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:661](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L661) +[packages/medusa/src/services/product-variant-inventory.ts:665](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L665) ___ @@ -529,7 +529,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:613](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L613) +[packages/medusa/src/services/product-variant-inventory.ts:617](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L617) ___ @@ -553,7 +553,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -578,7 +578,7 @@ nothing if successful, throws error if not #### Defined in -[packages/medusa/src/services/product-variant-inventory.ts:488](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant-inventory.ts#L488) +[packages/medusa/src/services/product-variant-inventory.ts:492](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant-inventory.ts#L492) ___ @@ -602,4 +602,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ProductVariantService.md b/docs/content/references/services/classes/ProductVariantService.md index 00683fc6e8..f3225a51b4 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:54](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L54) +[packages/medusa/src/services/product-variant.ts:54](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L54) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:52](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L52) +[packages/medusa/src/services/product-variant.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L52) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:46](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L46) +[packages/medusa/src/services/product-variant.ts:46](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L46) ___ @@ -100,7 +100,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/product-variant.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L41) +[packages/medusa/src/services/product-variant.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L41) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L49) +[packages/medusa/src/services/product-variant.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L49) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:48](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L48) +[packages/medusa/src/services/product-variant.ts:48](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L48) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:51](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L51) +[packages/medusa/src/services/product-variant.ts:51](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L51) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L45) +[packages/medusa/src/services/product-variant.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L45) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:44](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L44) +[packages/medusa/src/services/product-variant.ts:44](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L44) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:47](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L47) +[packages/medusa/src/services/product-variant.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L47) ___ @@ -174,7 +174,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/product-variant.ts:42](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L42) +[packages/medusa/src/services/product-variant.ts:42](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L42) ___ @@ -192,7 +192,7 @@ ___ #### Defined in -[packages/medusa/src/services/product-variant.ts:35](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L35) +[packages/medusa/src/services/product-variant.ts:35](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L35) ## Methods @@ -222,7 +222,7 @@ the result of the update operation. #### Defined in -[packages/medusa/src/services/product-variant.ts:497](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L497) +[packages/medusa/src/services/product-variant.ts:497](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L497) ___ @@ -261,7 +261,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -287,7 +287,7 @@ resolves to the creation result. #### Defined in -[packages/medusa/src/services/product-variant.ts:149](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L149) +[packages/medusa/src/services/product-variant.ts:149](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L149) ___ @@ -312,7 +312,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:650](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L650) +[packages/medusa/src/services/product-variant.ts:650](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L650) ___ @@ -338,7 +338,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:524](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L524) +[packages/medusa/src/services/product-variant.ts:524](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L524) ___ @@ -366,7 +366,7 @@ an array containing the products as the first element and the total #### Defined in -[packages/medusa/src/services/product-variant.ts:745](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L745) +[packages/medusa/src/services/product-variant.ts:745](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L745) ___ @@ -393,7 +393,7 @@ the price specific to the region #### Defined in -[packages/medusa/src/services/product-variant.ts:373](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L373) +[packages/medusa/src/services/product-variant.ts:373](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L373) ___ @@ -416,7 +416,7 @@ Check if the variant is assigned to at least one of the provided sales channels. #### Defined in -[packages/medusa/src/services/product-variant.ts:683](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L683) +[packages/medusa/src/services/product-variant.ts:683](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L683) ___ @@ -439,7 +439,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-variant.ts:592](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L592) +[packages/medusa/src/services/product-variant.ts:592](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L592) ___ @@ -462,7 +462,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/product-variant.ts:551](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L551) +[packages/medusa/src/services/product-variant.ts:551](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L551) ___ @@ -494,7 +494,7 @@ an object containing the query, relations and free-text #### Defined in -[packages/medusa/src/services/product-variant.ts:706](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L706) +[packages/medusa/src/services/product-variant.ts:706](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L706) ___ @@ -519,7 +519,7 @@ the product document. #### Defined in -[packages/medusa/src/services/product-variant.ts:85](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L85) +[packages/medusa/src/services/product-variant.ts:85](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L85) ___ @@ -544,7 +544,7 @@ the product document. #### Defined in -[packages/medusa/src/services/product-variant.ts:113](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L113) +[packages/medusa/src/services/product-variant.ts:113](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L113) ___ @@ -569,7 +569,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/product-variant.ts:438](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L438) +[packages/medusa/src/services/product-variant.ts:438](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L438) ___ @@ -594,7 +594,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/product-variant.ts:402](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L402) +[packages/medusa/src/services/product-variant.ts:402](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L402) ___ @@ -618,7 +618,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -645,7 +645,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/product-variant.ts:257](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L257) +[packages/medusa/src/services/product-variant.ts:257](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L257) ___ @@ -672,7 +672,7 @@ the result of the update operation. #### Defined in -[packages/medusa/src/services/product-variant.ts:459](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L459) +[packages/medusa/src/services/product-variant.ts:459](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L459) ___ @@ -698,7 +698,7 @@ empty promise #### Defined in -[packages/medusa/src/services/product-variant.ts:335](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/product-variant.ts#L335) +[packages/medusa/src/services/product-variant.ts:335](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/product-variant.ts#L335) ___ @@ -722,4 +722,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/RegionService.md b/docs/content/references/services/classes/RegionService.md index 7149e93cee..51d8c449b7 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/f8d635845/packages/medusa/src/services/region.ts#L67) +[packages/medusa/src/services/region.ts:67](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:59](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L59) +[packages/medusa/src/services/region.ts:59](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L59) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:60](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L60) +[packages/medusa/src/services/region.ts:60](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L60) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L54) +[packages/medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L54) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L52) +[packages/medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L52) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:64](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L64) +[packages/medusa/src/services/region.ts:64](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L64) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L57) +[packages/medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L57) ___ @@ -142,7 +142,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/region.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L50) +[packages/medusa/src/services/region.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L50) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L62) +[packages/medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L62) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L56) +[packages/medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L56) ___ @@ -172,7 +172,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:58](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L58) +[packages/medusa/src/services/region.ts:58](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L58) ___ @@ -182,7 +182,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L55) +[packages/medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L55) ___ @@ -192,7 +192,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:65](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L65) +[packages/medusa/src/services/region.ts:65](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L65) ___ @@ -206,7 +206,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/region.ts:51](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L51) +[packages/medusa/src/services/region.ts:51](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L51) ___ @@ -224,7 +224,7 @@ ___ #### Defined in -[packages/medusa/src/services/region.ts:44](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L44) +[packages/medusa/src/services/region.ts:44](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L44) ## Methods @@ -249,7 +249,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:580](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L580) +[packages/medusa/src/services/region.ts:580](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L580) ___ @@ -275,7 +275,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:710](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L710) +[packages/medusa/src/services/region.ts:710](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L710) ___ @@ -301,7 +301,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:659](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L659) +[packages/medusa/src/services/region.ts:659](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L659) ___ @@ -340,7 +340,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -364,7 +364,7 @@ the newly created region #### Defined in -[packages/medusa/src/services/region.ts:117](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L117) +[packages/medusa/src/services/region.ts:117](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L117) ___ @@ -388,7 +388,7 @@ the result of the delete operation #### Defined in -[packages/medusa/src/services/region.ts:549](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L549) +[packages/medusa/src/services/region.ts:549](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L549) ___ @@ -413,7 +413,7 @@ result of the find operation #### Defined in -[packages/medusa/src/services/region.ts:529](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L529) +[packages/medusa/src/services/region.ts:529](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L529) ___ @@ -438,7 +438,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:618](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L618) +[packages/medusa/src/services/region.ts:618](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L618) ___ @@ -463,7 +463,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:798](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L798) +[packages/medusa/src/services/region.ts:798](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L798) ___ @@ -488,7 +488,7 @@ the updated Region #### Defined in -[packages/medusa/src/services/region.ts:759](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L759) +[packages/medusa/src/services/region.ts:759](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L759) ___ @@ -513,7 +513,7 @@ the region #### Defined in -[packages/medusa/src/services/region.ts:494](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L494) +[packages/medusa/src/services/region.ts:494](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L494) ___ @@ -538,7 +538,7 @@ a Region with country code #### Defined in -[packages/medusa/src/services/region.ts:437](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L437) +[packages/medusa/src/services/region.ts:437](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L437) ___ @@ -562,7 +562,7 @@ region with the matching name #### Defined in -[packages/medusa/src/services/region.ts:474](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L474) +[packages/medusa/src/services/region.ts:474](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L474) ___ @@ -586,7 +586,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -611,7 +611,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/region.ts:190](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L190) +[packages/medusa/src/services/region.ts:190](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L190) ___ @@ -637,7 +637,7 @@ the validated Country #### Defined in -[packages/medusa/src/services/region.ts:388](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L388) +[packages/medusa/src/services/region.ts:388](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L388) ___ @@ -665,7 +665,7 @@ void #### Defined in -[packages/medusa/src/services/region.ts:363](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L363) +[packages/medusa/src/services/region.ts:363](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L363) ___ @@ -697,7 +697,7 @@ the validated region data #### Defined in -[packages/medusa/src/services/region.ts:261](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L261) +[packages/medusa/src/services/region.ts:261](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L261) ___ @@ -725,7 +725,7 @@ void #### Defined in -[packages/medusa/src/services/region.ts:347](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/region.ts#L347) +[packages/medusa/src/services/region.ts:347](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/region.ts#L347) ___ @@ -749,4 +749,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ReturnReasonService.md b/docs/content/references/services/classes/ReturnReasonService.md index e74dfe5abd..f5a861aa65 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/f8d635845/packages/medusa/src/services/return-reason.ts#L21) +[packages/medusa/src/services/return-reason.ts:21](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -80,7 +80,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return-reason.ts#L18) +[packages/medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return-reason.ts#L18) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return-reason.ts#L16) +[packages/medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return-reason.ts#L16) ___ @@ -104,7 +104,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/return-reason.ts:19](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return-reason.ts#L19) +[packages/medusa/src/services/return-reason.ts:19](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return-reason.ts#L19) ## Methods @@ -143,7 +143,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -163,7 +163,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:29](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return-reason.ts#L29) +[packages/medusa/src/services/return-reason.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return-reason.ts#L29) ___ @@ -183,7 +183,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:117](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return-reason.ts#L117) +[packages/medusa/src/services/return-reason.ts:117](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return-reason.ts#L117) ___ @@ -206,7 +206,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/return-reason.ts:72](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return-reason.ts#L72) +[packages/medusa/src/services/return-reason.ts:72](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return-reason.ts#L72) ___ @@ -231,7 +231,7 @@ the order document #### Defined in -[packages/medusa/src/services/return-reason.ts:91](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return-reason.ts#L91) +[packages/medusa/src/services/return-reason.ts:91](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return-reason.ts#L91) ___ @@ -255,7 +255,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -276,7 +276,7 @@ ___ #### Defined in -[packages/medusa/src/services/return-reason.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return-reason.ts#L50) +[packages/medusa/src/services/return-reason.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return-reason.ts#L50) ___ @@ -300,4 +300,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ReturnService.md b/docs/content/references/services/classes/ReturnService.md index c26e207fe5..a8d2c81888 100644 --- a/docs/content/references/services/classes/ReturnService.md +++ b/docs/content/references/services/classes/ReturnService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/return.ts:67](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L67) +[packages/medusa/src/services/return.ts:67](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L67) ## Properties @@ -38,7 +38,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:61](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L61) +[packages/medusa/src/services/return.ts:61](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L61) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L58) +[packages/medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L58) ___ @@ -100,7 +100,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/return.ts:52](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L52) +[packages/medusa/src/services/return.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L52) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:63](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L63) +[packages/medusa/src/services/return.ts:63](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L63) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:65](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L65) +[packages/medusa/src/services/return.ts:65](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L65) ___ @@ -130,7 +130,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L57) +[packages/medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L57) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:62](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L62) +[packages/medusa/src/services/return.ts:62](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L62) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L56) +[packages/medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L56) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L60) +[packages/medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L60) ___ @@ -170,7 +170,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L59) +[packages/medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L59) ___ @@ -180,7 +180,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L55) +[packages/medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L55) ___ @@ -194,7 +194,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/return.ts:53](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L53) +[packages/medusa/src/services/return.ts:53](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L53) ## Methods @@ -233,7 +233,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -257,7 +257,7 @@ the updated Return #### Defined in -[packages/medusa/src/services/return.ts:164](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L164) +[packages/medusa/src/services/return.ts:164](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L164) ___ @@ -283,7 +283,7 @@ the created return #### Defined in -[packages/medusa/src/services/return.ts:349](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L349) +[packages/medusa/src/services/return.ts:349](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L349) ___ @@ -303,7 +303,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:495](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L495) +[packages/medusa/src/services/return.ts:495](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L495) ___ @@ -329,7 +329,7 @@ the line items generated by the transformer. #### Defined in -[packages/medusa/src/services/return.ts:106](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L106) +[packages/medusa/src/services/return.ts:106](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L106) ___ @@ -352,7 +352,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/return.ts:146](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L146) +[packages/medusa/src/services/return.ts:146](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L146) ___ @@ -387,7 +387,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/return.ts:566](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L566) +[packages/medusa/src/services/return.ts:566](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L566) ___ @@ -412,7 +412,7 @@ the return #### Defined in -[packages/medusa/src/services/return.ts:262](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L262) +[packages/medusa/src/services/return.ts:262](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L262) ___ @@ -433,7 +433,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:290](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L290) +[packages/medusa/src/services/return.ts:290](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L290) ___ @@ -457,7 +457,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -478,7 +478,7 @@ ___ #### Defined in -[packages/medusa/src/services/return.ts:315](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L315) +[packages/medusa/src/services/return.ts:315](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L315) ___ @@ -526,8 +526,8 @@ a line item where the quantity is set to the requested | `is_giftcard?` | `boolean` | | `is_return?` | `boolean` | | `metadata?` | { [x: string]: unknown; } | -| `order?` | { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; payment\_status?: PaymentStatus \| undefined; ... 48 more ...; updated\_at?: { ...; } \| undefined; } | -| `order_edit?` | ``null`` \| { order\_id?: string \| undefined; order?: { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; ... 49 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 27 more ...; updated\_at?: { ...; } \| undefined; } | +| `order?` | { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; payment\_status?: PaymentStatus \| undefined; ... 49 more ...; updated\_at?: { ...; } \| undefined; } | +| `order_edit?` | ``null`` \| { order\_id?: string \| undefined; order?: { readonly object?: "order" \| undefined; status?: OrderStatus \| undefined; fulfillment\_status?: FulfillmentStatus \| undefined; ... 50 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 27 more ...; updated\_at?: { ...; } \| undefined; } | | `order_edit_id?` | ``null`` \| `string` | | `order_id?` | ``null`` \| `string` | | `original_item_id?` | ``null`` \| `string` | @@ -548,12 +548,12 @@ a line item where the quantity is set to the requested | `total?` | ``null`` \| `number` | | `unit_price?` | `number` | | `updated_at?` | { toString?: {} \| undefined; toDateString?: {} \| undefined; toTimeString?: {} \| undefined; toLocaleString?: {} \| undefined; toLocaleDateString?: {} \| undefined; toLocaleTimeString?: {} \| undefined; ... 37 more ...; [Symbol.toPrimitive]?: {} \| undefined; } | -| `variant?` | { title?: string \| undefined; product\_id?: string \| undefined; product?: { title?: string \| undefined; subtitle?: string \| null \| undefined; description?: string \| null \| undefined; ... 30 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 22 more ...; updated\_at?: { ...; } \| undefined; } | +| `variant?` | { title?: string \| undefined; product\_id?: string \| undefined; product?: { title?: string \| undefined; subtitle?: string \| null \| undefined; description?: string \| null \| undefined; ... 30 more ...; updated\_at?: { ...; } \| undefined; } \| undefined; ... 23 more ...; updated\_at?: { ...; } \| undefined; } | | `variant_id?` | ``null`` \| `string` | #### Defined in -[packages/medusa/src/services/return.ts:220](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L220) +[packages/medusa/src/services/return.ts:220](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L220) ___ @@ -581,7 +581,7 @@ when statuses are not sufficient for returns. #### Defined in -[packages/medusa/src/services/return.ts:190](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/return.ts#L190) +[packages/medusa/src/services/return.ts:190](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/return.ts#L190) ___ @@ -605,4 +605,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/SalesChannelInventoryService.md b/docs/content/references/services/classes/SalesChannelInventoryService.md index 985e9c1326..090fed9f73 100644 --- a/docs/content/references/services/classes/SalesChannelInventoryService.md +++ b/docs/content/references/services/classes/SalesChannelInventoryService.md @@ -14,7 +14,7 @@ #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:21](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-inventory.ts#L21) +[packages/medusa/src/services/sales-channel-inventory.ts:21](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-inventory.ts#L21) ## Properties @@ -24,7 +24,7 @@ #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:18](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-inventory.ts#L18) +[packages/medusa/src/services/sales-channel-inventory.ts:18](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-inventory.ts#L18) ___ @@ -34,7 +34,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:19](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-inventory.ts#L19) +[packages/medusa/src/services/sales-channel-inventory.ts:19](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-inventory.ts#L19) ___ @@ -44,7 +44,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:15](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-inventory.ts#L15) +[packages/medusa/src/services/sales-channel-inventory.ts:15](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-inventory.ts#L15) ___ @@ -54,13 +54,13 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:17](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-inventory.ts#L17) +[packages/medusa/src/services/sales-channel-inventory.ts:17](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-inventory.ts#L17) ## Methods ### retrieveAvailableItemQuantity -â–¸ **retrieveAvailableItemQuantity**(`salesChannelId`, `itemId`): `Promise`<`number`\> +â–¸ **retrieveAvailableItemQuantity**(`salesChannelId`, `inventoryItemId`): `Promise`<`number`\> Retrieves the available quantity of an item across all sales channel locations @@ -69,7 +69,7 @@ Retrieves the available quantity of an item across all sales channel locations | Name | Type | Description | | :------ | :------ | :------ | | `salesChannelId` | `string` | Sales channel id | -| `itemId` | `string` | Item id | +| `inventoryItemId` | `string` | Item id | #### Returns @@ -79,4 +79,4 @@ available quantity of item across all sales channel locations #### Defined in -[packages/medusa/src/services/sales-channel-inventory.ts:39](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-inventory.ts#L39) +[packages/medusa/src/services/sales-channel-inventory.ts:39](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-inventory.ts#L39) diff --git a/docs/content/references/services/classes/SalesChannelLocationService.md b/docs/content/references/services/classes/SalesChannelLocationService.md index 5eba74fe3f..904c935d96 100644 --- a/docs/content/references/services/classes/SalesChannelLocationService.md +++ b/docs/content/references/services/classes/SalesChannelLocationService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-location.ts#L26) +[packages/medusa/src/services/sales-channel-location.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-location.ts#L26) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:23](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-location.ts#L23) +[packages/medusa/src/services/sales-channel-location.ts:23](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-location.ts#L23) ___ @@ -92,7 +92,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:19](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-location.ts#L19) +[packages/medusa/src/services/sales-channel-location.ts:19](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-location.ts#L19) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:22](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-location.ts#L22) +[packages/medusa/src/services/sales-channel-location.ts:22](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-location.ts#L22) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:24](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-location.ts#L24) +[packages/medusa/src/services/sales-channel-location.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-location.ts#L24) ___ @@ -126,7 +126,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:20](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-location.ts#L20) +[packages/medusa/src/services/sales-channel-location.ts:20](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-location.ts#L20) ## Methods @@ -151,7 +151,7 @@ A promise that resolves when the association has been created. #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:64](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-location.ts#L64) +[packages/medusa/src/services/sales-channel-location.ts:77](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-location.ts#L77) ___ @@ -190,7 +190,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -214,13 +214,13 @@ A promise that resolves with an array of location IDs. #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:93](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-location.ts#L93) +[packages/medusa/src/services/sales-channel-location.ts:104](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-location.ts#L104) ___ ### removeLocation -â–¸ **removeLocation**(`salesChannelId`, `locationId`): `Promise`<`void`\> +â–¸ **removeLocation**(`locationId`, `salesChannelId?`): `Promise`<`void`\> Removes an association between a sales channel and a stock location. @@ -228,8 +228,8 @@ Removes an association between a sales channel and a stock location. | Name | Type | Description | | :------ | :------ | :------ | -| `salesChannelId` | `string` | The ID of the sales channel. | | `locationId` | `string` | The ID of the stock location. | +| `salesChannelId?` | `string` | The ID of the sales channel or undefined if all the sales channel will be affected. | #### Returns @@ -239,7 +239,7 @@ A promise that resolves when the association has been removed. #### Defined in -[packages/medusa/src/services/sales-channel-location.ts:47](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel-location.ts#L47) +[packages/medusa/src/services/sales-channel-location.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel-location.ts#L47) ___ @@ -263,7 +263,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -287,4 +287,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/SalesChannelService.md b/docs/content/references/services/classes/SalesChannelService.md index b86af478c4..c7aefca1b3 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/f8d635845/packages/medusa/src/services/sales-channel.ts#L37) +[packages/medusa/src/services/sales-channel.ts:37](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L34) +[packages/medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L34) ___ @@ -90,7 +90,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L30) +[packages/medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L30) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:33](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L33) +[packages/medusa/src/services/sales-channel.ts:33](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L33) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:35](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L35) +[packages/medusa/src/services/sales-channel.ts:35](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L35) ___ @@ -124,7 +124,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L31) +[packages/medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L31) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L24) +[packages/medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L24) ## Methods @@ -167,7 +167,7 @@ the sales channel on which the products have been added #### Defined in -[packages/medusa/src/services/sales-channel.ts:319](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L319) +[packages/medusa/src/services/sales-channel.ts:344](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L344) ___ @@ -206,7 +206,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -233,7 +233,7 @@ the created channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:176](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L176) +[packages/medusa/src/services/sales-channel.ts:180](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L180) ___ @@ -251,7 +251,7 @@ the sales channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:266](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L266) +[packages/medusa/src/services/sales-channel.ts:270](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L270) ___ @@ -275,7 +275,21 @@ To use this feature please enable the corresponding feature flag in your medusa #### Defined in -[packages/medusa/src/services/sales-channel.ts:227](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L227) +[packages/medusa/src/services/sales-channel.ts:231](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L231) + +___ + +### getManager + +â–¸ `Private` **getManager**(): `EntityManager` + +#### Returns + +`EntityManager` + +#### Defined in + +[packages/medusa/src/services/sales-channel.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L52) ___ @@ -303,7 +317,7 @@ an array containing the sales channels as #### Defined in -[packages/medusa/src/services/sales-channel.ts:141](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L141) +[packages/medusa/src/services/sales-channel.ts:145](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L145) ___ @@ -328,7 +342,7 @@ the sales channel on which the products have been removed #### Defined in -[packages/medusa/src/services/sales-channel.ts:298](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L298) +[packages/medusa/src/services/sales-channel.ts:323](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L323) ___ @@ -353,7 +367,7 @@ a sales channel #### Defined in -[packages/medusa/src/services/sales-channel.ts:99](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L99) +[packages/medusa/src/services/sales-channel.ts:103](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L103) ___ @@ -378,7 +392,25 @@ a sales channel with matching name #### Defined in -[packages/medusa/src/services/sales-channel.ts:120](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L120) +[packages/medusa/src/services/sales-channel.ts:124](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L124) + +___ + +### retrieveDefault + +â–¸ **retrieveDefault**(): `Promise`<`SalesChannel`\> + +Retrieves the default sales channel. + +#### Returns + +`Promise`<`SalesChannel`\> + +the sales channel + +#### Defined in + +[packages/medusa/src/services/sales-channel.ts:300](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L300) ___ @@ -403,7 +435,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/f8d635845/packages/medusa/src/services/sales-channel.ts#L59) +[packages/medusa/src/services/sales-channel.ts:63](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L63) ___ @@ -427,7 +459,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -448,7 +480,7 @@ ___ #### Defined in -[packages/medusa/src/services/sales-channel.ts:193](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/sales-channel.ts#L193) +[packages/medusa/src/services/sales-channel.ts:197](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/sales-channel.ts#L197) ___ @@ -472,4 +504,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/SearchService.md b/docs/content/references/services/classes/SearchService.md index 9c31f5d331..1e228d1f31 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/f8d635845/packages/medusa/src/services/search.ts#L18) +[packages/medusa/src/services/search.ts:18](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -67,7 +67,7 @@ AbstractSearchService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -81,7 +81,7 @@ AbstractSearchService.isDefault #### Defined in -[packages/medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L11) +[packages/medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L11) ___ @@ -91,7 +91,7 @@ ___ #### Defined in -[packages/medusa/src/services/search.ts:15](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L15) +[packages/medusa/src/services/search.ts:15](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L15) ___ @@ -105,7 +105,7 @@ AbstractSearchService.manager\_ #### Defined in -[packages/medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L13) +[packages/medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L13) ___ @@ -119,7 +119,7 @@ AbstractSearchService.options\_ #### Defined in -[packages/medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L16) +[packages/medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L16) ___ @@ -133,7 +133,7 @@ AbstractSearchService.transactionManager\_ #### Defined in -[packages/medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L14) +[packages/medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L14) ## Accessors @@ -151,7 +151,7 @@ AbstractSearchService.options #### Defined in -[packages/medusa/src/interfaces/search-service.ts:82](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/search-service.ts#L82) +[packages/medusa/src/interfaces/search-service.ts:82](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/search-service.ts#L82) ## Methods @@ -177,7 +177,7 @@ AbstractSearchService.addDocuments #### Defined in -[packages/medusa/src/services/search.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L43) +[packages/medusa/src/services/search.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L43) ___ @@ -216,7 +216,7 @@ AbstractSearchService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -241,7 +241,7 @@ AbstractSearchService.createIndex #### Defined in -[packages/medusa/src/services/search.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L31) +[packages/medusa/src/services/search.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L31) ___ @@ -265,7 +265,7 @@ AbstractSearchService.deleteAllDocuments #### Defined in -[packages/medusa/src/services/search.ts:72](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L72) +[packages/medusa/src/services/search.ts:72](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L72) ___ @@ -290,7 +290,7 @@ AbstractSearchService.deleteDocument #### Defined in -[packages/medusa/src/services/search.ts:63](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L63) +[packages/medusa/src/services/search.ts:63](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L63) ___ @@ -314,7 +314,7 @@ AbstractSearchService.getIndex #### Defined in -[packages/medusa/src/services/search.ts:37](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L37) +[packages/medusa/src/services/search.ts:37](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L37) ___ @@ -340,7 +340,7 @@ AbstractSearchService.replaceDocuments #### Defined in -[packages/medusa/src/services/search.ts:53](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L53) +[packages/medusa/src/services/search.ts:53](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L53) ___ @@ -366,7 +366,7 @@ AbstractSearchService.search #### Defined in -[packages/medusa/src/services/search.ts:78](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L78) +[packages/medusa/src/services/search.ts:78](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L78) ___ @@ -390,7 +390,7 @@ AbstractSearchService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -415,7 +415,7 @@ AbstractSearchService.updateSettings #### Defined in -[packages/medusa/src/services/search.ts:89](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/search.ts#L89) +[packages/medusa/src/services/search.ts:89](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/search.ts#L89) ___ @@ -439,4 +439,4 @@ AbstractSearchService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ShippingOptionService.md b/docs/content/references/services/classes/ShippingOptionService.md index 161c9f0c6c..914c0a2e5a 100644 --- a/docs/content/references/services/classes/ShippingOptionService.md +++ b/docs/content/references/services/classes/ShippingOptionService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/shipping-option.ts:55](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L55) +[packages/medusa/src/services/shipping-option.ts:55](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L50) +[packages/medusa/src/services/shipping-option.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L50) ___ @@ -92,7 +92,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L52) +[packages/medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L52) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L49) +[packages/medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L49) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L48) +[packages/medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L48) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L44) +[packages/medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L44) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L45) +[packages/medusa/src/services/shipping-option.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L45) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L47) +[packages/medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L47) ___ @@ -156,7 +156,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/shipping-option.ts:53](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L53) +[packages/medusa/src/services/shipping-option.ts:53](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L53) ## Methods @@ -182,7 +182,7 @@ the result of update #### Defined in -[packages/medusa/src/services/shipping-option.ts:715](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L715) +[packages/medusa/src/services/shipping-option.ts:713](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L713) ___ @@ -221,7 +221,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -247,7 +247,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/shipping-option.ts:453](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L453) +[packages/medusa/src/services/shipping-option.ts:451](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L451) ___ @@ -273,7 +273,7 @@ the resulting shipping method. #### Defined in -[packages/medusa/src/services/shipping-option.ts:278](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L278) +[packages/medusa/src/services/shipping-option.ts:278](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L278) ___ @@ -297,7 +297,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/shipping-option.ts:693](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L693) +[packages/medusa/src/services/shipping-option.ts:691](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L691) ___ @@ -321,7 +321,7 @@ removed shipping methods #### Defined in -[packages/medusa/src/services/shipping-option.ts:258](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L258) +[packages/medusa/src/services/shipping-option.ts:258](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L258) ___ @@ -349,7 +349,7 @@ the price of the shipping option. #### Defined in -[packages/medusa/src/services/shipping-option.ts:793](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L793) +[packages/medusa/src/services/shipping-option.ts:791](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L791) ___ @@ -372,7 +372,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/shipping-option.ts:148](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L148) +[packages/medusa/src/services/shipping-option.ts:148](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L148) ___ @@ -395,7 +395,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/shipping-option.ts:164](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L164) +[packages/medusa/src/services/shipping-option.ts:164](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L164) ___ @@ -419,7 +419,7 @@ the result of update #### Defined in -[packages/medusa/src/services/shipping-option.ts:744](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L744) +[packages/medusa/src/services/shipping-option.ts:742](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L742) ___ @@ -447,7 +447,7 @@ the profile document. #### Defined in -[packages/medusa/src/services/shipping-option.ts:182](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L182) +[packages/medusa/src/services/shipping-option.ts:182](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L182) ___ @@ -471,7 +471,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -498,7 +498,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/shipping-option.ts:581](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L581) +[packages/medusa/src/services/shipping-option.ts:579](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L579) ___ @@ -524,7 +524,7 @@ the resulting shipping method #### Defined in -[packages/medusa/src/services/shipping-option.ts:229](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L229) +[packages/medusa/src/services/shipping-option.ts:229](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L229) ___ @@ -547,7 +547,7 @@ updated shipping options #### Defined in -[packages/medusa/src/services/shipping-option.ts:769](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L769) +[packages/medusa/src/services/shipping-option.ts:767](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L767) ___ @@ -568,7 +568,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-option.ts:410](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L410) +[packages/medusa/src/services/shipping-option.ts:408](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L408) ___ @@ -595,7 +595,7 @@ the validated shipping option #### Defined in -[packages/medusa/src/services/shipping-option.ts:366](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L366) +[packages/medusa/src/services/shipping-option.ts:366](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L366) ___ @@ -620,7 +620,7 @@ the validated price #### Defined in -[packages/medusa/src/services/shipping-option.ts:541](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L541) +[packages/medusa/src/services/shipping-option.ts:539](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L539) ___ @@ -645,7 +645,7 @@ a validated shipping requirement #### Defined in -[packages/medusa/src/services/shipping-option.ts:82](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-option.ts#L82) +[packages/medusa/src/services/shipping-option.ts:82](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-option.ts#L82) ___ @@ -669,4 +669,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/ShippingProfileService.md b/docs/content/references/services/classes/ShippingProfileService.md index 286f0b875b..3e6c83a1c2 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/f8d635845/packages/medusa/src/services/shipping-profile.ts#L48) +[packages/medusa/src/services/shipping-profile.ts:48](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -70,7 +70,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L40) +[packages/medusa/src/services/shipping-profile.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L40) ___ @@ -94,7 +94,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L45) +[packages/medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L45) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L43) +[packages/medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L43) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:38](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L38) +[packages/medusa/src/services/shipping-profile.ts:38](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L38) ___ @@ -124,7 +124,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:39](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L39) +[packages/medusa/src/services/shipping-profile.ts:39](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L39) ___ @@ -134,7 +134,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L42) +[packages/medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L42) ___ @@ -148,7 +148,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:46](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L46) +[packages/medusa/src/services/shipping-profile.ts:46](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L46) ## Methods @@ -173,7 +173,7 @@ the result of update #### Defined in -[packages/medusa/src/services/shipping-profile.ts:356](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L356) +[packages/medusa/src/services/shipping-profile.ts:356](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L356) ___ @@ -199,7 +199,7 @@ the result of the model update operation #### Defined in -[packages/medusa/src/services/shipping-profile.ts:386](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L386) +[packages/medusa/src/services/shipping-profile.ts:386](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L386) ___ @@ -238,7 +238,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -262,7 +262,7 @@ the result of the create operation #### Defined in -[packages/medusa/src/services/shipping-profile.ts:250](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L250) +[packages/medusa/src/services/shipping-profile.ts:250](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L250) ___ @@ -280,7 +280,7 @@ the shipping profile #### Defined in -[packages/medusa/src/services/shipping-profile.ts:180](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L180) +[packages/medusa/src/services/shipping-profile.ts:180](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L180) ___ @@ -299,7 +299,7 @@ the shipping profile #### Defined in -[packages/medusa/src/services/shipping-profile.ts:224](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L224) +[packages/medusa/src/services/shipping-profile.ts:224](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L224) ___ @@ -323,7 +323,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/shipping-profile.ts:331](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L331) +[packages/medusa/src/services/shipping-profile.ts:331](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L331) ___ @@ -348,7 +348,7 @@ a list of the available shipping options #### Defined in -[packages/medusa/src/services/shipping-profile.ts:416](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L416) +[packages/medusa/src/services/shipping-profile.ts:416](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L416) ___ @@ -369,7 +369,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:83](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L83) +[packages/medusa/src/services/shipping-profile.ts:83](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L83) ___ @@ -393,7 +393,7 @@ a list of product ids #### Defined in -[packages/medusa/src/services/shipping-profile.ts:482](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L482) +[packages/medusa/src/services/shipping-profile.ts:482](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L482) ___ @@ -416,7 +416,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/shipping-profile.ts:71](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L71) +[packages/medusa/src/services/shipping-profile.ts:71](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L71) ___ @@ -442,7 +442,7 @@ the profile document. #### Defined in -[packages/medusa/src/services/shipping-profile.ts:135](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L135) +[packages/medusa/src/services/shipping-profile.ts:135](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L135) ___ @@ -456,7 +456,7 @@ ___ #### Defined in -[packages/medusa/src/services/shipping-profile.ts:164](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L164) +[packages/medusa/src/services/shipping-profile.ts:164](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L164) ___ @@ -474,7 +474,7 @@ the shipping profile for gift cards #### Defined in -[packages/medusa/src/services/shipping-profile.ts:207](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L207) +[packages/medusa/src/services/shipping-profile.ts:207](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L207) ___ @@ -498,7 +498,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -525,7 +525,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/shipping-profile.ts:285](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/shipping-profile.ts#L285) +[packages/medusa/src/services/shipping-profile.ts:285](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/shipping-profile.ts#L285) ___ @@ -549,4 +549,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/StoreService.md b/docs/content/references/services/classes/StoreService.md index 9f0829e435..4e76750740 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/f8d635845/packages/medusa/src/services/store.ts#L31) +[packages/medusa/src/services/store.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L28) +[packages/medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L28) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:29](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L29) +[packages/medusa/src/services/store.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L29) ___ @@ -102,7 +102,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L24) +[packages/medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L24) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:27](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L27) +[packages/medusa/src/services/store.ts:27](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L27) ___ @@ -126,7 +126,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L25) +[packages/medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L25) ## Methods @@ -150,7 +150,7 @@ result after update #### Defined in -[packages/medusa/src/services/store.ts:204](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L204) +[packages/medusa/src/services/store.ts:204](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L204) ___ @@ -189,7 +189,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -207,7 +207,7 @@ The store. #### Defined in -[packages/medusa/src/services/store.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L49) +[packages/medusa/src/services/store.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L49) ___ @@ -227,7 +227,7 @@ ___ #### Defined in -[packages/medusa/src/services/store.ts:98](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L98) +[packages/medusa/src/services/store.ts:98](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L98) ___ @@ -251,7 +251,7 @@ result after update #### Defined in -[packages/medusa/src/services/store.ts:248](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L248) +[packages/medusa/src/services/store.ts:248](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L248) ___ @@ -275,7 +275,7 @@ the store #### Defined in -[packages/medusa/src/services/store.ts:85](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L85) +[packages/medusa/src/services/store.ts:85](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L85) ___ @@ -299,7 +299,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -323,7 +323,7 @@ resolves to the update result. #### Defined in -[packages/medusa/src/services/store.ts:114](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/store.ts#L114) +[packages/medusa/src/services/store.ts:114](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/store.ts#L114) ___ @@ -347,4 +347,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/StrategyResolverService.md b/docs/content/references/services/classes/StrategyResolverService.md index 0fc09999f1..efe8b39508 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/f8d635845/packages/medusa/src/services/strategy-resolver.ts#L14) +[packages/medusa/src/services/strategy-resolver.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/strategy-resolver.ts#L14) +[packages/medusa/src/services/strategy-resolver.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/strategy-resolver.ts#L14) ___ @@ -90,7 +90,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/strategy-resolver.ts#L11) +[packages/medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/strategy-resolver.ts#L11) ___ @@ -104,7 +104,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:12](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/strategy-resolver.ts#L12) +[packages/medusa/src/services/strategy-resolver.ts:12](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/strategy-resolver.ts#L12) ## Methods @@ -143,7 +143,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -163,7 +163,7 @@ ___ #### Defined in -[packages/medusa/src/services/strategy-resolver.ts:19](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/strategy-resolver.ts#L19) +[packages/medusa/src/services/strategy-resolver.ts:19](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/strategy-resolver.ts#L19) ___ @@ -187,7 +187,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -211,4 +211,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/SwapService.md b/docs/content/references/services/classes/SwapService.md index 54ba7f03f5..defa0a17f8 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:94](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L94) +[packages/medusa/src/services/swap.ts:96](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L96) ## Properties @@ -40,7 +40,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L80) +[packages/medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L82) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:90](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L90) +[packages/medusa/src/services/swap.ts:92](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L92) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:81](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L81) +[packages/medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L83) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L86) +[packages/medusa/src/services/swap.ts:88](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L88) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:89](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L89) +[packages/medusa/src/services/swap.ts:91](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L91) ___ @@ -128,7 +128,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L85) +[packages/medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L87) ___ @@ -142,7 +142,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/swap.ts:75](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L75) +[packages/medusa/src/services/swap.ts:77](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L77) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L82) +[packages/medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L84) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:88](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L88) +[packages/medusa/src/services/swap.ts:90](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L90) ___ @@ -172,7 +172,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:92](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L92) +[packages/medusa/src/services/swap.ts:94](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L94) ___ @@ -182,7 +182,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L83) +[packages/medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L85) ___ @@ -192,7 +192,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L87) +[packages/medusa/src/services/swap.ts:89](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L89) ___ @@ -202,7 +202,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L78) +[packages/medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L80) ___ @@ -212,7 +212,7 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L84) +[packages/medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L86) ___ @@ -226,7 +226,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/swap.ts:76](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L76) +[packages/medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L78) ___ @@ -250,10 +250,30 @@ ___ #### Defined in -[packages/medusa/src/services/swap.ts:63](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L63) +[packages/medusa/src/services/swap.ts:65](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L65) ## Methods +### areReturnItemsValid + +â–¸ `Protected` **areReturnItemsValid**(`returnItems`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `returnItems` | `WithRequiredProperty`<`Partial`<`ReturnItem`\>, ``"item_id"``\>[] | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[packages/medusa/src/services/swap.ts:1226](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L1226) + +___ + ### atomicPhase\_ â–¸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> @@ -289,7 +309,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -315,7 +335,7 @@ the canceled swap. #### Defined in -[packages/medusa/src/services/swap.ts:841](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L841) +[packages/medusa/src/services/swap.ts:842](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L842) ___ @@ -339,7 +359,7 @@ updated swap #### Defined in -[packages/medusa/src/services/swap.ts:1042](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L1042) +[packages/medusa/src/services/swap.ts:1043](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L1043) ___ @@ -355,7 +375,7 @@ and an optional return shipping method. | Name | Type | Description | | :------ | :------ | :------ | | `order` | `Order` | the order to base the swap off | -| `returnItems` | `Partial`<`ReturnItem`\>[] | the items to return in the swap | +| `returnItems` | `WithRequiredProperty`<`Partial`<`ReturnItem`\>, ``"item_id"``\>[] | the items to return in the swap | | `additionalItems?` | `Pick`<`LineItem`, ``"variant_id"`` \| ``"quantity"``\>[] | the items to send to the customer | | `returnShipping?` | `Object` | an optional shipping method for returning the returnItems | | `returnShipping.option_id` | `string` | - | @@ -373,7 +393,7 @@ the newly created swap #### Defined in -[packages/medusa/src/services/swap.ts:315](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L315) +[packages/medusa/src/services/swap.ts:317](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L317) ___ @@ -401,7 +421,7 @@ the swap with its cart_id prop set to the id of the new cart. #### Defined in -[packages/medusa/src/services/swap.ts:570](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L570) +[packages/medusa/src/services/swap.ts:571](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L571) ___ @@ -427,7 +447,7 @@ the updated swap with new status and fulfillments. #### Defined in -[packages/medusa/src/services/swap.ts:903](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L903) +[packages/medusa/src/services/swap.ts:904](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L904) ___ @@ -454,7 +474,7 @@ the updated swap with new fulfillments and status. #### Defined in -[packages/medusa/src/services/swap.ts:1073](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L1073) +[packages/medusa/src/services/swap.ts:1074](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L1074) ___ @@ -479,7 +499,7 @@ resolves to the updated result. #### Defined in -[packages/medusa/src/services/swap.ts:1151](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L1151) +[packages/medusa/src/services/swap.ts:1152](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L1152) ___ @@ -504,7 +524,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/swap.ts:285](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L285) +[packages/medusa/src/services/swap.ts:287](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L287) ___ @@ -528,7 +548,7 @@ processed swap #### Defined in -[packages/medusa/src/services/swap.ts:414](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L414) +[packages/medusa/src/services/swap.ts:415](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L415) ___ @@ -552,7 +572,7 @@ swap related to the cart #### Defined in -[packages/medusa/src/services/swap.ts:708](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L708) +[packages/medusa/src/services/swap.ts:709](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L709) ___ @@ -577,7 +597,7 @@ the resulting order #### Defined in -[packages/medusa/src/services/swap.ts:1191](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L1191) +[packages/medusa/src/services/swap.ts:1192](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L1192) ___ @@ -602,7 +622,7 @@ the swap #### Defined in -[packages/medusa/src/services/swap.ts:209](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L209) +[packages/medusa/src/services/swap.ts:211](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L211) ___ @@ -627,7 +647,7 @@ the swap #### Defined in -[packages/medusa/src/services/swap.ts:258](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L258) +[packages/medusa/src/services/swap.ts:260](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L260) ___ @@ -651,7 +671,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -675,7 +695,7 @@ transformed find swap config #### Defined in -[packages/medusa/src/services/swap.ts:136](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L136) +[packages/medusa/src/services/swap.ts:138](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L138) ___ @@ -700,7 +720,7 @@ updated swap record #### Defined in -[packages/medusa/src/services/swap.ts:537](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/swap.ts#L537) +[packages/medusa/src/services/swap.ts:538](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/swap.ts#L538) ___ @@ -724,4 +744,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/SystemPaymentProviderService.md b/docs/content/references/services/classes/SystemPaymentProviderService.md index c2af3352e1..6bcd4624fc 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/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L10) +[packages/medusa/src/services/system-payment-provider.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -80,7 +80,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:5](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L5) +[packages/medusa/src/services/system-payment-provider.ts:5](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L5) ___ @@ -94,7 +94,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L6) +[packages/medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L6) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:8](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L8) +[packages/medusa/src/services/system-payment-provider.ts:8](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L8) ## Methods @@ -143,7 +143,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -163,7 +163,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L26) +[packages/medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L26) ___ @@ -183,7 +183,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L50) +[packages/medusa/src/services/system-payment-provider.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L50) ___ @@ -203,7 +203,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L42) +[packages/medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L42) ___ @@ -223,7 +223,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L14) +[packages/medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L14) ___ @@ -243,7 +243,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L38) +[packages/medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L38) ___ @@ -263,7 +263,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L22) +[packages/medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L22) ___ @@ -283,7 +283,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L18) +[packages/medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L18) ___ @@ -303,7 +303,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L46) +[packages/medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L46) ___ @@ -327,7 +327,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -347,7 +347,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L34) +[packages/medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L34) ___ @@ -367,7 +367,7 @@ ___ #### Defined in -[packages/medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/system-payment-provider.ts#L30) +[packages/medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/system-payment-provider.ts#L30) ___ @@ -391,4 +391,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/TaxProviderService.md b/docs/content/references/services/classes/TaxProviderService.md index cdfac17488..6a9364647e 100644 --- a/docs/content/references/services/classes/TaxProviderService.md +++ b/docs/content/references/services/classes/TaxProviderService.md @@ -26,7 +26,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/tax-provider.ts:51](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L51) +[packages/medusa/src/services/tax-provider.ts:51](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:44](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L44) +[packages/medusa/src/services/tax-provider.ts:44](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L44) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L43) +[packages/medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L43) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L49) +[packages/medusa/src/services/tax-provider.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L49) ___ @@ -112,7 +112,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L40) +[packages/medusa/src/services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L40) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:47](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L47) +[packages/medusa/src/services/tax-provider.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L47) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:46](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L46) +[packages/medusa/src/services/tax-provider.ts:46](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L46) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:48](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L48) +[packages/medusa/src/services/tax-provider.ts:48](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L48) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L45) +[packages/medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L45) ___ @@ -166,7 +166,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L41) +[packages/medusa/src/services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L41) ## Methods @@ -205,7 +205,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -225,7 +225,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:97](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L97) +[packages/medusa/src/services/tax-provider.ts:97](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L97) ___ @@ -245,7 +245,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:107](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L107) +[packages/medusa/src/services/tax-provider.ts:107](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L107) ___ @@ -271,7 +271,7 @@ the newly created tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:183](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L183) +[packages/medusa/src/services/tax-provider.ts:183](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L183) ___ @@ -296,7 +296,7 @@ the newly created tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:129](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L129) +[packages/medusa/src/services/tax-provider.ts:129](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L129) ___ @@ -321,7 +321,7 @@ the cache key to use for the id set #### Defined in -[packages/medusa/src/services/tax-provider.ts:484](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L484) +[packages/medusa/src/services/tax-provider.ts:484](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L484) ___ @@ -347,7 +347,7 @@ the tax rates configured for the shipping option. #### Defined in -[packages/medusa/src/services/tax-provider.ts:436](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L436) +[packages/medusa/src/services/tax-provider.ts:436](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L436) ___ @@ -373,7 +373,7 @@ the tax rates configured for the shipping option. #### Defined in -[packages/medusa/src/services/tax-provider.ts:389](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L389) +[packages/medusa/src/services/tax-provider.ts:389](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L389) ___ @@ -400,7 +400,7 @@ the computed tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:204](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L204) +[packages/medusa/src/services/tax-provider.ts:204](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L204) ___ @@ -429,7 +429,7 @@ the computed tax lines #### Defined in -[packages/medusa/src/services/tax-provider.ts:256](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L256) +[packages/medusa/src/services/tax-provider.ts:256](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L256) ___ @@ -452,7 +452,7 @@ Return a map of tax lines for line items and shipping methods #### Defined in -[packages/medusa/src/services/tax-provider.ts:352](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L352) +[packages/medusa/src/services/tax-provider.ts:352](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L352) ___ @@ -466,7 +466,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:65](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L65) +[packages/medusa/src/services/tax-provider.ts:65](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L65) ___ @@ -486,7 +486,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-provider.ts:488](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L488) +[packages/medusa/src/services/tax-provider.ts:488](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L488) ___ @@ -510,7 +510,7 @@ the region specific tax provider #### Defined in -[packages/medusa/src/services/tax-provider.ts:75](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-provider.ts#L75) +[packages/medusa/src/services/tax-provider.ts:75](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-provider.ts#L75) ___ @@ -534,7 +534,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -558,4 +558,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/TaxRateService.md b/docs/content/references/services/classes/TaxRateService.md index e3a6994279..3bd9962a69 100644 --- a/docs/content/references/services/classes/TaxRateService.md +++ b/docs/content/references/services/classes/TaxRateService.md @@ -24,7 +24,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/tax-rate.ts:33](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L33) +[packages/medusa/src/services/tax-rate.ts:33](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -66,7 +66,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -80,7 +80,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L25) +[packages/medusa/src/services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L25) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:28](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L28) +[packages/medusa/src/services/tax-rate.ts:28](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L28) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L29) +[packages/medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L29) ___ @@ -110,7 +110,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:30](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L30) +[packages/medusa/src/services/tax-rate.ts:30](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L30) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L31) +[packages/medusa/src/services/tax-rate.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L31) ___ @@ -134,7 +134,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L26) +[packages/medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L26) ## Methods @@ -156,7 +156,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/tax-rate.ts:190](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L190) +[packages/medusa/src/services/tax-rate.ts:190](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L190) ___ @@ -178,7 +178,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:226](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L226) +[packages/medusa/src/services/tax-rate.ts:226](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L226) ___ @@ -200,7 +200,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:266](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L266) +[packages/medusa/src/services/tax-rate.ts:266](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L266) ___ @@ -239,7 +239,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -259,7 +259,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:97](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L97) +[packages/medusa/src/services/tax-rate.ts:97](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L97) ___ @@ -279,7 +279,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:128](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L128) +[packages/medusa/src/services/tax-rate.ts:128](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L128) ___ @@ -300,7 +300,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:49](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L49) +[packages/medusa/src/services/tax-rate.ts:49](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L49) ___ @@ -321,7 +321,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:60](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L60) +[packages/medusa/src/services/tax-rate.ts:60](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L60) ___ @@ -342,7 +342,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:314](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L314) +[packages/medusa/src/services/tax-rate.ts:314](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L314) ___ @@ -362,7 +362,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:324](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L324) +[packages/medusa/src/services/tax-rate.ts:324](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L324) ___ @@ -383,7 +383,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:136](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L136) +[packages/medusa/src/services/tax-rate.ts:136](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L136) ___ @@ -404,7 +404,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:154](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L154) +[packages/medusa/src/services/tax-rate.ts:154](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L154) ___ @@ -425,7 +425,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:172](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L172) +[packages/medusa/src/services/tax-rate.ts:172](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L172) ___ @@ -446,7 +446,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:71](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L71) +[packages/medusa/src/services/tax-rate.ts:71](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L71) ___ @@ -470,7 +470,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -491,7 +491,7 @@ ___ #### Defined in -[packages/medusa/src/services/tax-rate.ts:113](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/tax-rate.ts#L113) +[packages/medusa/src/services/tax-rate.ts:113](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/tax-rate.ts#L113) ___ @@ -515,4 +515,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/TokenService.md b/docs/content/references/services/classes/TokenService.md index a32f75858c..7b7804fe31 100644 --- a/docs/content/references/services/classes/TokenService.md +++ b/docs/content/references/services/classes/TokenService.md @@ -14,7 +14,7 @@ #### Defined in -[packages/medusa/src/services/token.ts:16](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/token.ts#L16) +[packages/medusa/src/services/token.ts:16](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/token.ts#L16) ## Properties @@ -24,7 +24,7 @@ #### Defined in -[packages/medusa/src/services/token.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/token.ts#L14) +[packages/medusa/src/services/token.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/token.ts#L14) ___ @@ -34,7 +34,7 @@ ___ #### Defined in -[packages/medusa/src/services/token.ts:12](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/token.ts#L12) +[packages/medusa/src/services/token.ts:12](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/token.ts#L12) ## Methods @@ -55,7 +55,7 @@ ___ #### Defined in -[packages/medusa/src/services/token.ts:34](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/token.ts#L34) +[packages/medusa/src/services/token.ts:34](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/token.ts#L34) ___ @@ -76,4 +76,4 @@ ___ #### Defined in -[packages/medusa/src/services/token.ts:20](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/token.ts#L20) +[packages/medusa/src/services/token.ts:20](https://github.com/medusajs/medusa/blob/fefc248a4/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 ccf26a4bbe..2736f8ff0c 100644 --- a/docs/content/references/services/classes/TotalsService.md +++ b/docs/content/references/services/classes/TotalsService.md @@ -28,7 +28,7 @@ TransactionBaseService.constructor #### Defined in -[packages/medusa/src/services/totals.ts:113](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L113) +[packages/medusa/src/services/totals.ts:113](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L113) ## Properties @@ -42,7 +42,7 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -70,7 +70,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:111](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L111) +[packages/medusa/src/services/totals.ts:111](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L111) ___ @@ -94,7 +94,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/totals.ts:105](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L105) +[packages/medusa/src/services/totals.ts:105](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L105) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:109](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L109) +[packages/medusa/src/services/totals.ts:109](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L109) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:110](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L110) +[packages/medusa/src/services/totals.ts:110](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L110) ___ @@ -124,7 +124,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:108](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L108) +[packages/medusa/src/services/totals.ts:108](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L108) ___ @@ -138,7 +138,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/totals.ts:106](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L106) +[packages/medusa/src/services/totals.ts:106](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L106) ## Methods @@ -177,7 +177,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -205,7 +205,7 @@ triples of lineitem, variant and applied discount #### Defined in -[packages/medusa/src/services/totals.ts:623](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L623) +[packages/medusa/src/services/totals.ts:629](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L629) ___ @@ -234,7 +234,7 @@ array of triples of lineitem, variant and applied discount #### Defined in -[packages/medusa/src/services/totals.ts:665](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L665) +[packages/medusa/src/services/totals.ts:671](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L671) ___ @@ -265,7 +265,7 @@ the allocation map for the line items in the cart or order. #### Defined in -[packages/medusa/src/services/totals.ts:438](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L438) +[packages/medusa/src/services/totals.ts:438](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L438) ___ @@ -290,7 +290,7 @@ the tax calculation context #### Defined in -[packages/medusa/src/services/totals.ts:1020](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L1020) +[packages/medusa/src/services/totals.ts:1025](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L1025) ___ @@ -315,7 +315,7 @@ the total discounts amount #### Defined in -[packages/medusa/src/services/totals.ts:1000](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L1000) +[packages/medusa/src/services/totals.ts:1005](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L1005) ___ @@ -341,7 +341,7 @@ the gift card amount applied to the cart or order #### Defined in -[packages/medusa/src/services/totals.ts:969](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L969) +[packages/medusa/src/services/totals.ts:974](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L974) ___ @@ -366,7 +366,7 @@ the gift card amount applied to the cart or order #### Defined in -[packages/medusa/src/services/totals.ts:952](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L952) +[packages/medusa/src/services/totals.ts:957](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L957) ___ @@ -395,7 +395,7 @@ the allocations that the discount has on the items in the cart or #### Defined in -[packages/medusa/src/services/totals.ts:716](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L716) +[packages/medusa/src/services/totals.ts:722](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L722) ___ @@ -415,7 +415,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:693](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L693) +[packages/medusa/src/services/totals.ts:699](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L699) ___ @@ -436,7 +436,7 @@ ___ #### Defined in -[packages/medusa/src/services/totals.ts:678](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L678) +[packages/medusa/src/services/totals.ts:684](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L684) ___ @@ -461,7 +461,7 @@ the line item refund amount. #### Defined in -[packages/medusa/src/services/totals.ts:501](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L501) +[packages/medusa/src/services/totals.ts:507](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L507) ___ @@ -488,7 +488,7 @@ the line item total #### Defined in -[packages/medusa/src/services/totals.ts:925](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L925) +[packages/medusa/src/services/totals.ts:930](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L930) ___ @@ -516,7 +516,7 @@ the breakdown of the line item totals #### Defined in -[packages/medusa/src/services/totals.ts:772](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L772) +[packages/medusa/src/services/totals.ts:778](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L778) ___ @@ -540,7 +540,7 @@ the total paid amount #### Defined in -[packages/medusa/src/services/totals.ts:160](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L160) +[packages/medusa/src/services/totals.ts:160](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L160) ___ @@ -567,7 +567,7 @@ the calculated subtotal #### Defined in -[packages/medusa/src/services/totals.ts:580](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L580) +[packages/medusa/src/services/totals.ts:586](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L586) ___ @@ -591,7 +591,7 @@ the total refunded amount for an order. #### Defined in -[packages/medusa/src/services/totals.ts:486](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L486) +[packages/medusa/src/services/totals.ts:492](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L492) ___ @@ -618,7 +618,7 @@ An object that breaks down the totals for the shipping method #### Defined in -[packages/medusa/src/services/totals.ts:194](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L194) +[packages/medusa/src/services/totals.ts:194](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L194) ___ @@ -642,7 +642,7 @@ shipping total #### Defined in -[packages/medusa/src/services/totals.ts:322](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L322) +[packages/medusa/src/services/totals.ts:322](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L322) ___ @@ -667,7 +667,7 @@ the calculated subtotal #### Defined in -[packages/medusa/src/services/totals.ts:286](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L286) +[packages/medusa/src/services/totals.ts:286](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L286) ___ @@ -692,7 +692,7 @@ the swap total #### Defined in -[packages/medusa/src/services/totals.ts:175](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L175) +[packages/medusa/src/services/totals.ts:175](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L175) ___ @@ -718,7 +718,7 @@ tax total #### Defined in -[packages/medusa/src/services/totals.ts:349](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L349) +[packages/medusa/src/services/totals.ts:349](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L349) ___ @@ -743,7 +743,7 @@ the calculated subtotal #### Defined in -[packages/medusa/src/services/totals.ts:137](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L137) +[packages/medusa/src/services/totals.ts:137](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L137) ___ @@ -767,7 +767,7 @@ the rounded value #### Defined in -[packages/medusa/src/services/totals.ts:1050](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/totals.ts#L1050) +[packages/medusa/src/services/totals.ts:1055](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/totals.ts#L1055) ___ @@ -791,7 +791,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -815,4 +815,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/references/services/classes/UserService.md b/docs/content/references/services/classes/UserService.md index e0826c183d..b99e56fef1 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/f8d635845/packages/medusa/src/services/user.ts#L47) +[packages/medusa/src/services/user.ts:47](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L10) +[packages/medusa/src/interfaces/transaction-base-service.ts:10](https://github.com/medusajs/medusa/blob/fefc248a4/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/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L9) +[packages/medusa/src/interfaces/transaction-base-service.ts:9](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L9) ___ @@ -68,7 +68,7 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L11) +[packages/medusa/src/interfaces/transaction-base-service.ts:11](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L42) +[packages/medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L42) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:44](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L44) +[packages/medusa/src/services/user.ts:44](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L44) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L45) +[packages/medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L45) ___ @@ -112,7 +112,7 @@ TransactionBaseService.manager\_ #### Defined in -[packages/medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L40) +[packages/medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L40) ___ @@ -126,7 +126,7 @@ TransactionBaseService.transactionManager\_ #### Defined in -[packages/medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L41) +[packages/medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L41) ___ @@ -136,7 +136,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L43) +[packages/medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L43) ___ @@ -155,7 +155,7 @@ ___ #### Defined in -[packages/medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L33) +[packages/medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L33) ## Methods @@ -194,7 +194,7 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L50) +[packages/medusa/src/interfaces/transaction-base-service.ts:50](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L50) ___ @@ -220,7 +220,7 @@ the result of create #### Defined in -[packages/medusa/src/services/user.ts:179](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L179) +[packages/medusa/src/services/user.ts:179](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L179) ___ @@ -244,7 +244,7 @@ the result of the delete operation. #### Defined in -[packages/medusa/src/services/user.ts:259](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L259) +[packages/medusa/src/services/user.ts:259](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L259) ___ @@ -272,7 +272,7 @@ the generated JSON web token #### Defined in -[packages/medusa/src/services/user.ts:321](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L321) +[packages/medusa/src/services/user.ts:321](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L321) ___ @@ -296,7 +296,7 @@ hashed password #### Defined in -[packages/medusa/src/services/user.ts:167](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L167) +[packages/medusa/src/services/user.ts:167](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L167) ___ @@ -319,7 +319,7 @@ the result of the find operation #### Defined in -[packages/medusa/src/services/user.ts:69](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L69) +[packages/medusa/src/services/user.ts:69](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L69) ___ @@ -345,7 +345,7 @@ the user document. #### Defined in -[packages/medusa/src/services/user.ts:82](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L82) +[packages/medusa/src/services/user.ts:82](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L82) ___ @@ -371,7 +371,7 @@ the user document. #### Defined in -[packages/medusa/src/services/user.ts:113](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L113) +[packages/medusa/src/services/user.ts:113](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L113) ___ @@ -397,7 +397,7 @@ the user document. #### Defined in -[packages/medusa/src/services/user.ts:142](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L142) +[packages/medusa/src/services/user.ts:142](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L142) ___ @@ -424,7 +424,7 @@ the result of the update operation #### Defined in -[packages/medusa/src/services/user.ts:292](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L292) +[packages/medusa/src/services/user.ts:292](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L292) ___ @@ -448,7 +448,7 @@ TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L31) +[packages/medusa/src/interfaces/transaction-base-service.ts:31](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L31) ___ @@ -473,7 +473,7 @@ the result of create #### Defined in -[packages/medusa/src/services/user.ts:213](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/services/user.ts#L213) +[packages/medusa/src/services/user.ts:213](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/services/user.ts#L213) ___ @@ -497,4 +497,4 @@ TransactionBaseService.withTransaction #### Defined in -[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/f8d635845/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[packages/medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/fefc248a4/packages/medusa/src/interfaces/transaction-base-service.ts#L14) diff --git a/docs/content/usage/configurations.md b/docs/content/usage/configurations.md index 9bf320cf0d..514b8c6186 100644 --- a/docs/content/usage/configurations.md +++ b/docs/content/usage/configurations.md @@ -243,6 +243,32 @@ For both of the Admin and the Storefront CORS configurations, the value is expec 1. The accepted origin as is. For example, `http://localhost:8000`. 2. A regular expression pattern that can match more than one origin. For example, `*.example.com`. The regex pattern that the server tests for is `^([\/~@;%#'])(.*?)\1([gimsuy]*)$`. +Here are some examples of common use cases: + +```bash +# Allow different ports locally starting with 700 +ADMIN_CORS=/http:\/\/localhost:700\d+$/ + +# Allow any origin ending with vercel.app. For example, storefront.vercel.app +STORE_CORS=/vercel\.app$/ + +# Allow all HTTP requests +ADMIN_CORS=/http:\/\/*/ +``` + +Although this is not recommended, but when setting these values directly in `medusa-config.json`, make sure to add an extra escaping `backslash` for every backslash in the pattern. For example: + +```js +const ADMIN_CORS = process.env.ADMIN_CORS || + "/http:\\/\\/localhost:700\\d+$/" +``` + +:::tip + +The examples above apply to both Admin and Store CORS. + +::: + ### Admin CORS To make sure your Admin dashboard can access the Medusa server’s admin endpoints, set this configuration: diff --git a/integration-tests/api/__tests__/admin/__snapshots__/price-list.js.snap b/integration-tests/api/__tests__/admin/__snapshots__/price-list.js.snap index 5d7eb27d4a..08b9f4d089 100644 --- a/integration-tests/api/__tests__/admin/__snapshots__/price-list.js.snap +++ b/integration-tests/api/__tests__/admin/__snapshots__/price-list.js.snap @@ -292,46 +292,3 @@ Array [ ] `; -exports[`/admin/price-lists POST /admin/price-lists/:id/prices/batch Adds a batch of new prices where a MA record have a \`region_id\` instead of \`currency_code\` 1`] = ` -Array [ - Object { - "amount": 70, - "created_at": Any, - "currency_code": "usd", - "deleted_at": null, - "id": "ma_test_4", - "max_quantity": null, - "min_quantity": null, - "price_list_id": "pl_with_some_ma", - "region_id": null, - "updated_at": Any, - "variant_id": "test-variant", - }, - Object { - "amount": 100, - "created_at": Any, - "currency_code": "eur", - "deleted_at": null, - "id": Any, - "max_quantity": null, - "min_quantity": null, - "price_list_id": "pl_with_some_ma", - "region_id": "region-pl", - "updated_at": Any, - "variant_id": "test-variant", - }, - Object { - "amount": 200, - "created_at": Any, - "currency_code": "usd", - "deleted_at": null, - "id": Any, - "max_quantity": null, - "min_quantity": null, - "price_list_id": "pl_with_some_ma", - "region_id": null, - "updated_at": Any, - "variant_id": "test-variant", - }, -] -`; diff --git a/integration-tests/api/__tests__/admin/price-list.js b/integration-tests/api/__tests__/admin/price-list.js index e66d8e9ccb..587805baf5 100644 --- a/integration-tests/api/__tests__/admin/price-list.js +++ b/integration-tests/api/__tests__/admin/price-list.js @@ -859,45 +859,47 @@ describe("/admin/price-lists", () => { expect(response.status).toEqual(200) expect(response.data.price_list.prices.length).toEqual(3) // initially this PL has 1 MA record - expect(response.data.price_list.prices).toMatchSnapshot([ - { - id: "ma_test_4", - currency_code: "usd", - amount: 70, - price_list_id: "pl_with_some_ma", - variant_id: "test-variant", - region_id: null, - created_at: expect.any(String), - updated_at: expect.any(String), - deleted_at: null, - }, - { - id: expect.any(String), - currency_code: "eur", - amount: 100, - min_quantity: null, - max_quantity: null, - price_list_id: "pl_with_some_ma", - variant_id: "test-variant", - region_id: "region-pl", - created_at: expect.any(String), - updated_at: expect.any(String), - deleted_at: null, - }, - { - id: expect.any(String), - currency_code: "usd", - amount: 200, - min_quantity: null, - max_quantity: null, - price_list_id: "pl_with_some_ma", - variant_id: "test-variant", - region_id: null, - created_at: expect.any(String), - updated_at: expect.any(String), - deleted_at: null, - }, - ]) + expect(response.data.price_list.prices).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + id: "ma_test_4", + currency_code: "usd", + amount: 70, + price_list_id: "pl_with_some_ma", + variant_id: "test-variant", + region_id: null, + created_at: expect.any(String), + updated_at: expect.any(String), + deleted_at: null, + }), + expect.objectContaining({ + id: expect.any(String), + currency_code: "usd", + amount: 200, + min_quantity: null, + max_quantity: null, + price_list_id: "pl_with_some_ma", + variant_id: "test-variant", + region_id: null, + created_at: expect.any(String), + updated_at: expect.any(String), + deleted_at: null, + }), + expect.objectContaining({ + id: expect.any(String), + currency_code: "eur", + amount: 100, + min_quantity: null, + max_quantity: null, + price_list_id: "pl_with_some_ma", + variant_id: "test-variant", + region_id: "region-pl", + created_at: expect.any(String), + updated_at: expect.any(String), + deleted_at: null, + }), + ]) + ) }) }) diff --git a/integration-tests/api/__tests__/admin/returns.js b/integration-tests/api/__tests__/admin/returns.js index 9e18caff20..ecb4507580 100644 --- a/integration-tests/api/__tests__/admin/returns.js +++ b/integration-tests/api/__tests__/admin/returns.js @@ -1,5 +1,6 @@ const path = require("path") import { ReturnReason, ShippingMethod } from "@medusajs/medusa" +import { createReturnableOrder } from "../claims" const setupServer = require("../../../helpers/setup-server") const { useApi } = require("../../../helpers/use-api") @@ -10,6 +11,12 @@ const adminSeeder = require("../../helpers/admin-seeder") jest.setTimeout(30000) +const authHeader = { + headers: { + Authorization: "Bearer test_token", + }, +} + describe("/admin/returns", () => { let medusaProcess let dbConnection @@ -51,26 +58,20 @@ describe("/admin/returns", () => { const api = useApi() // create a swap - const response = await api - .post( - "/admin/orders/test-order/swaps", - { - custom_shipping_options: [{ option_id: "test-option", price: 0 }], - return_items: [ - { - item_id: "test-item", - quantity: 1, - }, - ], - additional_items: [{ variant_id: "test-variant-2", quantity: 1 }], - }, - { - headers: { - authorization: "Bearer test_token", + const response = await api.post( + "/admin/orders/test-order/swaps", + { + custom_shipping_options: [{ option_id: "test-option", price: 0 }], + return_items: [ + { + item_id: "test-item", + quantity: 1, }, - } - ) - .catch((e) => console.log(e)) + ], + additional_items: [{ variant_id: "test-variant-2", quantity: 1 }], + }, + authHeader + ) const sid = response.data.order.swaps[0].id const manager = dbConnection.manager @@ -87,76 +88,52 @@ describe("/admin/returns", () => { await manager.save(sm) // fulfill the swap - const fulRes = await api - .post( - `/admin/orders/test-order/swaps/${sid}/fulfillments`, - {}, - { - headers: { - Authorization: "Bearer test_token", - }, - } - ) - .catch((e) => console.log(e)) + const fulRes = await api.post( + `/admin/orders/test-order/swaps/${sid}/fulfillments`, + {}, + authHeader + ) // ship the swap - await api - .post( - `/admin/orders/test-order/swaps/${sid}/shipments`, - { - fulfillment_id: fulRes.data.order.swaps[0].fulfillments[0].id, - }, - { - headers: { - Authorization: "Bearer test_token", - }, - } - ) - .catch((e) => console.log(e)) + await api.post( + `/admin/orders/test-order/swaps/${sid}/shipments`, + { + fulfillment_id: fulRes.data.order.swaps[0].fulfillments[0].id, + }, + authHeader + ) const swapItemId = fulRes.data.order.swaps[0].additional_items[0].id // request a return - const returnRes = await api - .post( - `/admin/orders/test-order/return`, - { - items: [ - { - item_id: swapItemId, - quantity: 1, - reason_id: rrId, - }, - ], - }, - { - headers: { - Authorization: "Bearer test_token", + const returnRes = await api.post( + `/admin/orders/test-order/return`, + { + items: [ + { + item_id: swapItemId, + quantity: 1, + reason_id: rrId, }, - } - ) - .catch((e) => console.log(e.response)) + ], + }, + authHeader + ) const returnId = returnRes.data.order.returns[0].id - const receiveRes = await api - .post( - `/admin/returns/${returnId}/receive`, - { - items: [ - { - item_id: swapItemId, - quantity: 1, - }, - ], - }, - { - headers: { - Authorization: "Bearer test_token", + const receiveRes = await api.post( + `/admin/returns/${returnId}/receive`, + { + items: [ + { + item_id: swapItemId, + quantity: 1, }, - } - ) - .catch((e) => console.log(e.response)) + ], + }, + authHeader + ) expect(receiveRes.status).toEqual(200) }) @@ -190,11 +167,7 @@ describe("/admin/returns", () => { }, ], }, - { - headers: { - Authorization: "Bearer test_token", - }, - } + authHeader ) .catch((err) => { console.log(err) @@ -214,52 +187,96 @@ describe("/admin/returns", () => { const claimItemId = fulRes.data.order.claims[0].additional_items[0].id // request a return - const returnRes = await api - .post( - `/admin/orders/test-order/return`, - { - items: [ - { - item_id: claimItemId, - quantity: 1, - reason_id: rrId, - }, - ], - return_shipping: { - option_id: "test-option", - price: 0, + const returnRes = await api.post( + `/admin/orders/test-order/return`, + { + items: [ + { + item_id: claimItemId, + quantity: 1, + reason_id: rrId, }, + ], + return_shipping: { + option_id: "test-option", + price: 0, }, - { - headers: { - Authorization: "Bearer test_token", - }, - } - ) - .catch((e) => console.log(e.response)) + }, + authHeader + ) const returnId = returnRes.data.order.returns[0].id - const receiveRes = await api - .post( - `/admin/returns/${returnId}/receive`, - { - items: [ - { - item_id: claimItemId, - quantity: 1, - }, - ], - }, - { - headers: { - Authorization: "Bearer test_token", + const receiveRes = await api.post( + `/admin/returns/${returnId}/receive`, + { + items: [ + { + item_id: claimItemId, + quantity: 1, }, - } - ) - .catch((e) => console.log(e.response)) + ], + }, + authHeader + ) expect(receiveRes.status).toEqual(200) }) }) + + describe("POST /admin/returns/:id/receive", () => { + beforeEach(async () => { + await adminSeeder(dbConnection) + }) + + afterEach(async () => { + const db = useDb() + return await db.teardown() + }) + + it("should receive a return partially", async () => { + const api = useApi() + + const order = await createReturnableOrder(dbConnection) + const itemId = "test-item" + + // create a return + const response = await api.post( + `/admin/orders/${order.id}/return`, + { + items: [ + { + item_id: itemId, + quantity: 2, + }, + ], + }, + authHeader + ) + + const returnId = response.data.order.returns[0].id + + // receive a return + const receiveRes = await api.post( + `/admin/returns/${returnId}/receive`, + { + items: [ + { + item_id: itemId, + quantity: 1, + }, + ], + }, + authHeader + ) + + const receivedReturn = receiveRes.data.return + + expect(receivedReturn.items.length).toEqual(1) + const receivedItem = receivedReturn.items[0] + + expect(receivedItem.requested_quantity).toEqual(2) + expect(receivedItem.received_quantity).toEqual(1) + }) + }) }) diff --git a/integration-tests/api/__tests__/admin/swaps.js b/integration-tests/api/__tests__/admin/swaps.js index 577bae9b74..814da8fe22 100644 --- a/integration-tests/api/__tests__/admin/swaps.js +++ b/integration-tests/api/__tests__/admin/swaps.js @@ -301,7 +301,7 @@ describe("/admin/swaps", () => { // ********* CREATE SWAP ********* const createSwap = await api.post( - `/admin/orders/${completedOrder.data.data.id}/swaps`, + `/admin/orders/${completedOrder.data.data.id}/swaps?fields=returnable_items`, { return_items: [ { @@ -318,6 +318,13 @@ describe("/admin/swaps", () => { } ) + expect(createSwap.data.order.returnable_items).toHaveLength(1) + expect(createSwap.data.order.returnable_items[0]).toEqual( + expect.objectContaining({ + id: "line-item", + }) + ) + let swap = createSwap.data.order.swaps[0] // ********* PREPARE SWAP CART ********* @@ -349,7 +356,7 @@ describe("/admin/swaps", () => { {} ) - // ********* VALIDATE ********* + // ********* VALIDATE ********* expect(swap.data.swap.difference_due).toBe(swapCart.data.cart.total) }) }) diff --git a/integration-tests/api/__tests__/claims/index.js b/integration-tests/api/__tests__/claims/index.js index 2a39509ee3..cc7690bc28 100644 --- a/integration-tests/api/__tests__/claims/index.js +++ b/integration-tests/api/__tests__/claims/index.js @@ -351,7 +351,7 @@ describe("Claims", () => { }) }) -const createReturnableOrder = async (dbConnection, options = {}) => { +export const createReturnableOrder = async (dbConnection, options = {}) => { await simpleProductFactory( dbConnection, { diff --git a/integration-tests/plugins/__tests__/medusa-plugin-sendgrid/__snapshots__/index.js.snap b/integration-tests/plugins/__tests__/medusa-plugin-sendgrid/__snapshots__/index.js.snap index f5936e289b..6774ac9f14 100644 --- a/integration-tests/plugins/__tests__/medusa-plugin-sendgrid/__snapshots__/index.js.snap +++ b/integration-tests/plugins/__tests__/medusa-plugin-sendgrid/__snapshots__/index.js.snap @@ -576,7 +576,7 @@ Object { "note": null, "quantity": 1, "reason_id": null, - "received_quantity": null, + "received_quantity": 1, "requested_quantity": 1, "return_id": Any, }, @@ -724,7 +724,7 @@ Object { "note": null, "quantity": 1, "reason_id": null, - "received_quantity": null, + "received_quantity": 1, "requested_quantity": 1, "return_id": Any, }, diff --git a/packages/inventory/CHANGELOG.md b/packages/inventory/CHANGELOG.md index e5c9ff92d8..8b64dc72cf 100644 --- a/packages/inventory/CHANGELOG.md +++ b/packages/inventory/CHANGELOG.md @@ -1,5 +1,12 @@ # @medusajs/inventory +## 1.0.5 + +### Patch Changes + +- Updated dependencies [[`9690f07bc`](https://github.com/medusajs/medusa/commit/9690f07bc062c85fcf8b7f0f35a162b930944183), [`5301a1e9d`](https://github.com/medusajs/medusa/commit/5301a1e9d632ddac94e7864fecfdc860a4c2a66d), [`d11ab924b`](https://github.com/medusajs/medusa/commit/d11ab924b88211bc18ed019ca300f6d452972167), [`f88af0c28`](https://github.com/medusajs/medusa/commit/f88af0c28d3fa574cdeea3694607d4df563cb88d)]: + - @medusajs/medusa@1.7.8 + ## 1.0.4 ### Patch Changes diff --git a/packages/inventory/package.json b/packages/inventory/package.json index 6b51979f92..7784ad2227 100644 --- a/packages/inventory/package.json +++ b/packages/inventory/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/inventory", - "version": "1.0.4", + "version": "1.0.5", "description": "Inventory Module for Medusa", "main": "dist/index.js", "repository": { @@ -32,7 +32,7 @@ "test:unit": "jest --passWithNoTests" }, "peerDependencies": { - "@medusajs/medusa": "1.7.7", + "@medusajs/medusa": "1.7.8", "typeorm": "^0.3.11" } } diff --git a/packages/medusa-js/CHANGELOG.md b/packages/medusa-js/CHANGELOG.md index dda4c0af79..6c87175e56 100644 --- a/packages/medusa-js/CHANGELOG.md +++ b/packages/medusa-js/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 1.3.10 + +### Patch Changes + +- [#3271](https://github.com/medusajs/medusa/pull/3271) [`3a911091f`](https://github.com/medusajs/medusa/commit/3a911091f18c03260d92d81498f63bba31ba61ac) Thanks [@kasperkristensen](https://github.com/kasperkristensen)! - hotfix(medusa-js): Export all resources and make client of medusa-js public + +- Updated dependencies [[`9690f07bc`](https://github.com/medusajs/medusa/commit/9690f07bc062c85fcf8b7f0f35a162b930944183), [`5301a1e9d`](https://github.com/medusajs/medusa/commit/5301a1e9d632ddac94e7864fecfdc860a4c2a66d), [`d11ab924b`](https://github.com/medusajs/medusa/commit/d11ab924b88211bc18ed019ca300f6d452972167), [`f88af0c28`](https://github.com/medusajs/medusa/commit/f88af0c28d3fa574cdeea3694607d4df563cb88d)]: + - @medusajs/medusa@1.7.8 + ## 1.3.9 ### Patch Changes diff --git a/packages/medusa-js/package.json b/packages/medusa-js/package.json index 638dc7ccc4..457e2e77fb 100644 --- a/packages/medusa-js/package.json +++ b/packages/medusa-js/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa-js", - "version": "1.3.9", + "version": "1.3.10", "description": "Client for Medusa Commerce Rest API", "main": "dist/index.js", "module": "dist/index.mjs", @@ -32,7 +32,7 @@ "uuid": "^9.0.0" }, "peerDependencies": { - "@medusajs/medusa": "^1.7.7" + "@medusajs/medusa": "^1.7.8" }, "repository": { "type": "git", @@ -43,7 +43,7 @@ "url": "https://github.com/medusajs/medusa/issues" }, "devDependencies": { - "@medusajs/medusa": "^1.7.7", + "@medusajs/medusa": "^1.7.8", "@types/uuid": "^9.0.0", "cross-env": "^7.0.3", "jest": "^27.4.7", diff --git a/packages/medusa-js/src/index.ts b/packages/medusa-js/src/index.ts index 389662c51d..a27fef1355 100644 --- a/packages/medusa-js/src/index.ts +++ b/packages/medusa-js/src/index.ts @@ -1,28 +1,30 @@ import MedusaError from "./error" import KeyManager from "./key-manager" import Client, { Config } from "./request" -import Admin from "./resources/admin" -import AuthResource from "./resources/auth" -import CartsResource from "./resources/carts" -import CollectionsResource from "./resources/collections" -import CustomersResource from "./resources/customers" -import GiftCardsResource from "./resources/gift-cards" -import OrderEditsResource from "./resources/order-edits" -import OrdersResource from "./resources/orders" -import PaymentCollectionsResource from "./resources/payment-collections" -import PaymentMethodsResource from "./resources/payment-methods" -import ProductTagsResource from "./resources/product-tags" -import ProductTypesResource from "./resources/product-types" -import ProductsResource from "./resources/products" -import RegionsResource from "./resources/regions" -import ReturnReasonsResource from "./resources/return-reasons" -import ReturnsResource from "./resources/returns" -import ShippingOptionsResource from "./resources/shipping-options" -import SwapsResource from "./resources/swaps" -import ProductCategoriesResource from "./resources/product-categories" +import { + Admin, + AuthResource, + CartsResource, + CollectionsResource, + CustomersResource, + GiftCardsResource, + OrderEditsResource, + OrdersResource, + PaymentCollectionsResource, + PaymentMethodsResource, + ProductCategoriesResource, + ProductsResource, + ProductTagsResource, + ProductTypesResource, + RegionsResource, + ReturnReasonsResource, + ReturnsResource, + ShippingOptionsResource, + SwapsResource, +} from "./resources" class Medusa { - private client: Client + public client: Client public admin: Admin public auth: AuthResource @@ -83,5 +85,8 @@ class Medusa { } export default Medusa +export { default as MedusaError } from "./error" export { default as KeyManager } from "./key-manager" +export { Config, default as Client } from "./request" +export * from "./resources" export * from "./typings" diff --git a/packages/medusa-js/src/resources/admin/index.ts b/packages/medusa-js/src/resources/admin/index.ts index 40f8fc0020..a5574dbadb 100644 --- a/packages/medusa-js/src/resources/admin/index.ts +++ b/packages/medusa-js/src/resources/admin/index.ts @@ -1,24 +1,29 @@ import BaseResource from "../base" import AdminAuthResource from "./auth" import AdminBatchJobsResource from "./batch-jobs" -import CollectionsResource from "./collections" +import AdminCollectionsResource from "./collections" import AdminCurrenciesResource from "./currencies" import AdminCustomerGroupsResource from "./customer-groups" import AdminCustomersResource from "./customers" import AdminDiscountsResource from "./discounts" import AdminDraftOrdersResource from "./draft-orders" import AdminGiftCardsResource from "./gift-cards" +import AdminInventoryItemsResource from "./inventory-item" import AdminInvitesResource from "./invites" import AdminNotesResource from "./notes" import AdminNotificationsResource from "./notifications" -import AdminOrdersResource from "./orders" import AdminOrderEditsResource from "./order-edits" +import AdminOrdersResource from "./orders" +import AdminPaymentCollectionsResource from "./payment-collections" +import AdminPaymentsResource from "./payments" import AdminPriceListResource from "./price-lists" +import AdminProductCategoriesResource from "./product-categories" import AdminProductTagsResource from "./product-tags" import AdminProductTypesResource from "./product-types" import AdminProductsResource from "./products" import AdminPublishableApiKeyResource from "./publishable-api-keys" import AdminRegionsResource from "./regions" +import AdminReservationsResource from "./reservations" import AdminReturnReasonsResource from "./return-reasons" import AdminReturnsResource from "./returns" import AdminSalesChannelsResource from "./sales-channels" @@ -31,11 +36,6 @@ import AdminTaxRatesResource from "./tax-rates" import AdminUploadsResource from "./uploads" import AdminUsersResource from "./users" import AdminVariantsResource from "./variants" -import AdminPaymentCollectionsResource from "./payment-collections" -import AdminPaymentsResource from "./payments" -import AdminInventoryItemsResource from "./inventory-item" -import AdminReservationsResource from "./reservations" -import AdminProductCategoriesResource from "./product-categories" class Admin extends BaseResource { public auth = new AdminAuthResource(this.client) @@ -44,7 +44,7 @@ class Admin extends BaseResource { public customerGroups = new AdminCustomerGroupsResource(this.client) public discounts = new AdminDiscountsResource(this.client) public currencies = new AdminCurrenciesResource(this.client) - public collections = new CollectionsResource(this.client) + public collections = new AdminCollectionsResource(this.client) public draftOrders = new AdminDraftOrdersResource(this.client) public giftCards = new AdminGiftCardsResource(this.client) public invites = new AdminInvitesResource(this.client) @@ -77,4 +77,41 @@ class Admin extends BaseResource { public productCategories = new AdminProductCategoriesResource(this.client) } -export default Admin +export { + Admin, + AdminAuthResource, + AdminBatchJobsResource, + AdminCollectionsResource, + AdminCurrenciesResource, + AdminCustomerGroupsResource, + AdminCustomersResource, + AdminDiscountsResource, + AdminDraftOrdersResource, + AdminGiftCardsResource, + AdminInvitesResource, + AdminNotesResource, + AdminNotificationsResource, + AdminOrdersResource, + AdminOrderEditsResource, + AdminPriceListResource, + AdminProductTagsResource, + AdminProductTypesResource, + AdminProductsResource, + AdminPublishableApiKeyResource, + AdminRegionsResource, + AdminReturnReasonsResource, + AdminReturnsResource, + AdminSalesChannelsResource, + AdminShippingOptionsResource, + AdminShippingProfilesResource, + AdminStockLocationsResource, + AdminStoresResource, + AdminSwapsResource, + AdminTaxRatesResource, + AdminUploadsResource, + AdminUsersResource, + AdminVariantsResource, + AdminPaymentCollectionsResource, + AdminPaymentsResource, + AdminProductCategoriesResource, +} diff --git a/packages/medusa-js/src/resources/index.ts b/packages/medusa-js/src/resources/index.ts new file mode 100644 index 0000000000..a02be7ec7e --- /dev/null +++ b/packages/medusa-js/src/resources/index.ts @@ -0,0 +1,46 @@ +import AddressesResource from "./addresses" +import AuthResource from "./auth" +import BaseResource from "./base" +import CartsResource from "./carts" +import CollectionsResource from "./collections" +import CustomersResource from "./customers" +import GiftCardsResource from "./gift-cards" +import LineItemsResource from "./line-items" +import OrderEditsResource from "./order-edits" +import OrdersResource from "./orders" +import PaymentCollectionsResource from "./payment-collections" +import PaymentMethodsResource from "./payment-methods" +import ProductCategoriesResource from "./product-categories" +import ProductTagsResource from "./product-tags" +import ProductTypesResource from "./product-types" +import ProductsResource from "./products" +import RegionsResource from "./regions" +import ReturnReasonsResource from "./return-reasons" +import ReturnsResource from "./returns" +import ShippingOptionsResource from "./shipping-options" +import SwapsResource from "./swaps" + +export * from "./admin" +export { + AddressesResource, + AuthResource, + BaseResource, + CartsResource, + CollectionsResource, + CustomersResource, + GiftCardsResource, + LineItemsResource, + OrderEditsResource, + OrdersResource, + PaymentCollectionsResource, + PaymentMethodsResource, + ProductCategoriesResource, + ProductTagsResource, + ProductTypesResource, + ProductsResource, + RegionsResource, + ReturnReasonsResource, + ReturnsResource, + ShippingOptionsResource, + SwapsResource, +} diff --git a/packages/medusa/CHANGELOG.md b/packages/medusa/CHANGELOG.md index fbd7e77fad..9b504325a0 100644 --- a/packages/medusa/CHANGELOG.md +++ b/packages/medusa/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 1.7.8 + +### Patch Changes + +- [#3285](https://github.com/medusajs/medusa/pull/3285) [`9690f07bc`](https://github.com/medusajs/medusa/commit/9690f07bc062c85fcf8b7f0f35a162b930944183) Thanks [@patrick-medusajs](https://github.com/patrick-medusajs)! - fix(oas): patch circular references in docs + +- [#3298](https://github.com/medusajs/medusa/pull/3298) [`5301a1e9d`](https://github.com/medusajs/medusa/commit/5301a1e9d632ddac94e7864fecfdc860a4c2a66d) Thanks [@adrien2p](https://github.com/adrien2p)! - chore(medusa): Remove payment service deprecation temporarely + +- [#3276](https://github.com/medusajs/medusa/pull/3276) [`d11ab924b`](https://github.com/medusajs/medusa/commit/d11ab924b88211bc18ed019ca300f6d452972167) Thanks [@adrien2p](https://github.com/adrien2p)! - feat(medusa): Configurable returnable_items on order decorate totals + +- [#3267](https://github.com/medusajs/medusa/pull/3267) [`f88af0c28`](https://github.com/medusajs/medusa/commit/f88af0c28d3fa574cdeea3694607d4df563cb88d) Thanks [@olivermrbl](https://github.com/olivermrbl)! - fix(medusa): Received quantity on return lines + ## 1.7.7 ### Patch Changes diff --git a/packages/medusa/package.json b/packages/medusa/package.json index 27d31217fe..e3ee6f2096 100644 --- a/packages/medusa/package.json +++ b/packages/medusa/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa", - "version": "1.7.7", + "version": "1.7.8", "description": "E-commerce for JAMstack", "main": "dist/index.js", "bin": "./cli.js", diff --git a/packages/medusa/src/api/middlewares/index.ts b/packages/medusa/src/api/middlewares/index.ts index 0647f8e822..68aa757c54 100644 --- a/packages/medusa/src/api/middlewares/index.ts +++ b/packages/medusa/src/api/middlewares/index.ts @@ -7,6 +7,7 @@ import { default as requireCustomerAuthentication } from "./require-customer-aut export { canAccessBatchJob } from "./batch-job/can-access-batch-job" export { getRequestedBatchJob } from "./batch-job/get-requested-batch-job" export { doesConditionBelongToDiscount } from "./discount/does-condition-belong-to-discount" +export { transformIncludesOptions } from "./transform-includes-options" export { transformBody } from "./transform-body" export { transformQuery } from "./transform-query" diff --git a/packages/medusa/src/api/middlewares/transform-includes-options.ts b/packages/medusa/src/api/middlewares/transform-includes-options.ts new file mode 100644 index 0000000000..da10b2dbae --- /dev/null +++ b/packages/medusa/src/api/middlewares/transform-includes-options.ts @@ -0,0 +1,58 @@ +import { NextFunction, Request, Response } from "express" +import { Order } from "../../models" +import { MedusaError } from "medusa-core-utils" + +/** + * Retrieve the includes options from the fields query param. + * If the include option is present then assigned it to includes on req + * @param allowedIncludesFields The list of fields that can be passed and assign to req.includes + * @param expectedIncludesFields The list of fields that the consumer can pass to the end point using this middleware. It is a subset of `allowedIncludesFields` + */ +export function transformIncludesOptions( + allowedIncludesFields: string[] = [], + expectedIncludesFields: string[] = [] +) { + return (req: Request, res: Response, next: NextFunction): void => { + if (!allowedIncludesFields.length || !req.query["fields"]) { + return next() + } + + const fields = (req.query["fields"] as string).split(",") ?? [] + + for (const includesField of allowedIncludesFields) { + const fieldIndex = fields.indexOf(includesField as keyof Order) ?? -1 + + const isPresent = fieldIndex !== -1 + + if (isPresent) { + fields.splice(fieldIndex, 1) + + if (!expectedIncludesFields.includes(includesField)) { + throw new MedusaError( + MedusaError.Types.INVALID_DATA, + `The field "${includesField}" is not supported by this end point. ${ + expectedIncludesFields.length + ? `The includes fields can be one of entity properties or in [${expectedIncludesFields.join( + ", " + )}]` + : "" + }` + ) + } + + req["includes"] = req["includes"] ?? {} + req["includes"][includesField] = true + } + } + + if (req.query["fields"]) { + if (fields.length) { + req.query["fields"] = fields.join(",") + } else { + delete req.query["fields"] + } + } + + next() + } +} diff --git a/packages/medusa/src/api/middlewares/transform-query.ts b/packages/medusa/src/api/middlewares/transform-query.ts index 1fe4b967c7..6d3f93c9fe 100644 --- a/packages/medusa/src/api/middlewares/transform-query.ts +++ b/packages/medusa/src/api/middlewares/transform-query.ts @@ -53,6 +53,12 @@ export function transformQuery< ] as unknown as string[] } + const includesFields = Object.keys(req["includes"] ?? {}) + if (includesFields.length) { + req.allowedProperties = req.allowedProperties ?? [] + req.allowedProperties.push(...includesFields) + } + if (queryConfig?.isList) { req.listConfig = prepareListQuery( validated, diff --git a/packages/medusa/src/api/routes/admin/orders/__tests__/get-order.js b/packages/medusa/src/api/routes/admin/orders/__tests__/get-order.js index 0145ffa4a4..a54a9d8c3e 100644 --- a/packages/medusa/src/api/routes/admin/orders/__tests__/get-order.js +++ b/packages/medusa/src/api/routes/admin/orders/__tests__/get-order.js @@ -48,6 +48,9 @@ describe("GET /admin/orders", () => { ), // TODO [MEDUSA_FF_SALES_CHANNELS]: Remove when sales channel flag is removed entirely relations: [...defaultAdminOrdersRelations, "sales_channel"], + }, + { + includes: undefined, } ) }) diff --git a/packages/medusa/src/api/routes/admin/orders/add-shipping-method.ts b/packages/medusa/src/api/routes/admin/orders/add-shipping-method.ts index aaf4596604..d7179b28a0 100644 --- a/packages/medusa/src/api/routes/admin/orders/add-shipping-method.ts +++ b/packages/medusa/src/api/routes/admin/orders/add-shipping-method.ts @@ -5,11 +5,10 @@ import { IsOptional, IsString, } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { OrderService } from "../../../../services" -import { validator } from "../../../../utils/validator" import { EntityManager } from "typeorm" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/shipping-methods @@ -18,6 +17,8 @@ import { EntityManager } from "typeorm" * description: "Adds a Shipping Method to an Order. If another Shipping Method exists with the same Shipping Profile, the previous Shipping Method will be replaced." * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -26,6 +27,7 @@ import { EntityManager } from "typeorm" * x-authenticated: true * x-codegen: * method: addShippingMethod + * params: AdminPostOrdersOrderShippingMethodsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -78,10 +80,7 @@ import { EntityManager } from "typeorm" export default async (req, res) => { const { id } = req.params - const validated = await validator( - AdminPostOrdersOrderShippingMethodsReq, - req.body - ) + const validated = req.validatedBody const orderService: OrderService = req.scope.resolve("orderService") @@ -94,9 +93,8 @@ export default async (req, res) => { }) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.status(200).json({ order }) @@ -132,3 +130,5 @@ export class AdminPostOrdersOrderShippingMethodsReq { @IsOptional() data?: Record = {} } + +export class AdminPostOrdersOrderShippingMethodsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/archive-order.ts b/packages/medusa/src/api/routes/admin/orders/archive-order.ts index 2b2f77f8aa..bb78229523 100644 --- a/packages/medusa/src/api/routes/admin/orders/archive-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/archive-order.ts @@ -1,5 +1,6 @@ import { OrderService } from "../../../../services" import { EntityManager } from "typeorm" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/archive @@ -9,8 +10,11 @@ import { EntityManager } from "typeorm" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: archive + * params: AdminPostOrdersOrderArchiveParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -62,9 +66,11 @@ export default async (req, res) => { return await orderService.withTransaction(transactionManager).archive(id) }) - const order = await orderService.retrieve(id, { - relations: ["region", "customer", "swaps"], + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) } + +export class AdminPostOrdersOrderArchiveParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-claim.ts b/packages/medusa/src/api/routes/admin/orders/cancel-claim.ts index be3021ceec..7b6fba54f8 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-claim.ts @@ -1,8 +1,8 @@ import { ClaimService, OrderService } from "../../../../services" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { MedusaError } from "medusa-core-utils" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/claims/{claim_id}/cancel @@ -13,8 +13,11 @@ import { MedusaError } from "medusa-core-utils" * parameters: * - (path) id=* {string} The ID of the Order. * - (path) claim_id=* {string} The ID of the Claim. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: cancelClaim + * params: AdminPostOrdersClaimCancel * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -78,10 +81,11 @@ export default async (req, res) => { .cancel(claim_id) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) } + +export class AdminPostOrdersClaimCancel extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.ts b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.ts index 525ba91d57..9bab02e1bc 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-claim.ts @@ -3,10 +3,10 @@ import { FulfillmentService, OrderService, } from "../../../../services" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { MedusaError } from "medusa-core-utils" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel @@ -18,8 +18,11 @@ import { MedusaError } from "medusa-core-utils" * - (path) id=* {string} The ID of the Order which the Claim relates to. * - (path) claim_id=* {string} The ID of the Claim which the Fulfillment relates to. * - (path) fulfillment_id=* {string} The ID of the Fulfillment. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: cancelClaimFulfillment + * params: AdminPostOrdersClaimFulfillmentsCancelParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -94,9 +97,11 @@ export default async (req, res) => { .cancelFulfillment(fulfillment_id) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) + res.json({ order }) } + +export class AdminPostOrdersClaimFulfillmentsCancelParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-swap.ts b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-swap.ts index 81817dedbb..ea44001128 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-swap.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment-swap.ts @@ -3,10 +3,10 @@ import { OrderService, SwapService, } from "../../../../services" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { MedusaError } from "medusa-core-utils" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel @@ -18,8 +18,11 @@ import { MedusaError } from "medusa-core-utils" * - (path) id=* {string} The ID of the Order which the Swap relates to. * - (path) swap_id=* {string} The ID of the Swap which the Fulfillment relates to. * - (path) fulfillment_id=* {string} The ID of the Fulfillment. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: cancelSwapFulfillment + * params: AdminPostOrdersSwapFulfillementsCancelParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -94,10 +97,12 @@ export default async (req, res) => { .cancelFulfillment(fulfillment_id) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) } + +// eslint-disable-next-line max-len +export class AdminPostOrdersOrderSwapFulfillementsCancelParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment.ts b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment.ts index cba0f750f1..1df5d2cebf 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-fulfillment.ts @@ -3,12 +3,12 @@ import { OrderService, ProductVariantInventoryService, } from "../../../../services" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { MedusaError } from "medusa-core-utils" import { Fulfillment } from "../../../../models" import { IInventoryService } from "../../../../interfaces" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/fulfillments/{fulfillment_id}/cancel @@ -19,8 +19,11 @@ import { IInventoryService } from "../../../../interfaces" * parameters: * - (path) id=* {string} The ID of the Order which the Fulfillment relates to. * - (path) fulfillment_id=* {string} The ID of the Fulfillment + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: cancelFulfillment + * params: AdminPostOrdersOrderFulfillementsCancelParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -101,9 +104,8 @@ export default async (req, res) => { } }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) @@ -128,3 +130,5 @@ export const adjustInventoryForCancelledFulfillment = async ( }) ) } + +export class AdminPostOrdersOrderFulfillementsCancelParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-order.ts b/packages/medusa/src/api/routes/admin/orders/cancel-order.ts index 99ab316e81..a0b7f43ba3 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-order.ts @@ -1,7 +1,6 @@ -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." - import { OrderService } from "../../../../services" import { EntityManager } from "typeorm" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/cancel @@ -11,8 +10,11 @@ import { EntityManager } from "typeorm" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: cancel + * params: AdminPostOrdersOrderCancel * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -63,10 +65,11 @@ export default async (req, res) => { return await orderService.withTransaction(transactionManager).cancel(id) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) } + +export class AdminPostOrdersOrderCancel extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/cancel-swap.ts b/packages/medusa/src/api/routes/admin/orders/cancel-swap.ts index 24fee02b43..57830f568f 100644 --- a/packages/medusa/src/api/routes/admin/orders/cancel-swap.ts +++ b/packages/medusa/src/api/routes/admin/orders/cancel-swap.ts @@ -1,8 +1,8 @@ import { OrderService, SwapService } from "../../../../services" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { MedusaError } from "medusa-core-utils" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/swaps/{swap_id}/cancel @@ -13,8 +13,11 @@ import { MedusaError } from "medusa-core-utils" * parameters: * - (path) id=* {string} The ID of the Order. * - (path) swap_id=* {string} The ID of the Swap. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: cancelSwap + * params: AdminPostOrdersSwapCancelParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -76,10 +79,11 @@ export default async (req, res) => { return await swapService.withTransaction(transactionManager).cancel(swap_id) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) } + +export class AdminPostOrdersSwapCancelParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/capture-payment.ts b/packages/medusa/src/api/routes/admin/orders/capture-payment.ts index 15b5c16779..627c51c390 100644 --- a/packages/medusa/src/api/routes/admin/orders/capture-payment.ts +++ b/packages/medusa/src/api/routes/admin/orders/capture-payment.ts @@ -1,7 +1,6 @@ -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." - import { OrderService } from "../../../../services" import { EntityManager } from "typeorm" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/capture @@ -11,8 +10,11 @@ import { EntityManager } from "typeorm" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: capturePayment + * params: AdminPostOrdersOrderCaptureParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -66,10 +68,11 @@ export default async (req, res) => { .capturePayment(id) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) } + +export class AdminPostOrdersOrderCaptureParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/complete-order.ts b/packages/medusa/src/api/routes/admin/orders/complete-order.ts index 7c46a707b8..de0d7e4345 100644 --- a/packages/medusa/src/api/routes/admin/orders/complete-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/complete-order.ts @@ -1,5 +1,6 @@ import { OrderService } from "../../../../services" import { EntityManager } from "typeorm" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/complete @@ -9,8 +10,11 @@ import { EntityManager } from "typeorm" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: complete + * params: AdminPostOrdersOrderCompleteParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -64,9 +68,11 @@ export default async (req, res) => { .completeOrder(id) }) - const order = await orderService.retrieve(id, { - relations: ["region", "customer", "swaps"], + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) } + +export class AdminPostOrdersOrderCompleteParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/create-claim-shipment.ts b/packages/medusa/src/api/routes/admin/orders/create-claim-shipment.ts index ba7fac8f84..72be6f60c5 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-claim-shipment.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-claim-shipment.ts @@ -1,9 +1,7 @@ import { ClaimService, OrderService } from "../../../../services" import { IsArray, IsNotEmpty, IsOptional, IsString } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." - -import { validator } from "../../../../utils/validator" import { EntityManager } from "typeorm" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/claims/{claim_id}/shipments @@ -14,6 +12,8 @@ import { EntityManager } from "typeorm" * parameters: * - (path) id=* {string} The ID of the Order. * - (path) claim_id=* {string} The ID of the Claim. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -21,6 +21,7 @@ import { EntityManager } from "typeorm" * $ref: "#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq" * x-codegen: * method: createClaimShipment + * params: AdminPostOrdersOrderClaimsClaimShipmentsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -71,10 +72,7 @@ import { EntityManager } from "typeorm" export default async (req, res) => { const { id, claim_id } = req.params - const validated = await validator( - AdminPostOrdersOrderClaimsClaimShipmentsReq, - req.body - ) + const validated = req.validatedBody const orderService: OrderService = req.scope.resolve("orderService") const claimService: ClaimService = req.scope.resolve("claimService") @@ -90,9 +88,8 @@ export default async (req, res) => { ) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) @@ -123,3 +120,6 @@ export class AdminPostOrdersOrderClaimsClaimShipmentsReq { @IsString({ each: true }) tracking_numbers?: string[] } + +// eslint-disable-next-line max-len +export class AdminPostOrdersOrderClaimsClaimShipmentsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/create-claim.ts b/packages/medusa/src/api/routes/admin/orders/create-claim.ts index 5e86608065..37ffcf3396 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-claim.ts @@ -9,15 +9,13 @@ import { IsString, ValidateNested, } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { ClaimReason, ClaimType } from "../../../../models" import { Type } from "class-transformer" import { MedusaError } from "medusa-core-utils" import { EntityManager } from "typeorm" import { ClaimTypeValue } from "../../../../types/claim" -import { AddressPayload } from "../../../../types/common" -import { validator } from "../../../../utils/validator" +import { AddressPayload, FindParams } from "../../../../types/common" /** * @oas [post] /admin/order/{id}/claims @@ -27,6 +25,8 @@ import { validator } from "../../../../utils/validator" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -34,6 +34,7 @@ import { validator } from "../../../../utils/validator" * $ref: "#/components/schemas/AdminPostOrdersOrderClaimsReq" * x-codegen: * method: createClaim + * params: AdminPostOrdersOrderClaimsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -97,7 +98,7 @@ import { validator } from "../../../../utils/validator" export default async (req, res) => { const { id } = req.params - const value = await validator(AdminPostOrdersOrderClaimsReq, req.body) + const value = req.validatedBody const idempotencyKeyService = req.scope.resolve("idempotencyKeyService") const manager: EntityManager = req.scope.resolve("manager") @@ -247,9 +248,8 @@ export default async (req, res) => { order = await orderService .withTransaction(manager) - .retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + .retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) return { @@ -508,3 +508,5 @@ class AdditionalItem { @IsNotEmpty() quantity: number } + +export class AdminPostOrdersOrderClaimsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/create-fulfillment.ts b/packages/medusa/src/api/routes/admin/orders/create-fulfillment.ts index 19f6fbfc2d..473ebe56ac 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-fulfillment.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-fulfillment.ts @@ -9,16 +9,15 @@ import { ValidateNested, } from "class-validator" import { Transform, Type } from "class-transformer" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { OrderService, ProductVariantInventoryService, } from "../../../../services" -import { validator } from "../../../../utils/validator" import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean" import { Fulfillment, LineItem } from "../../../../models" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/fulfillment @@ -28,6 +27,8 @@ import { Fulfillment, LineItem } from "../../../../models" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -35,6 +36,7 @@ import { Fulfillment, LineItem } from "../../../../models" * $ref: "#/components/schemas/AdminPostOrdersOrderFulfillmentsReq" * x-codegen: * method: createFulfillment + * params: AdminPostOrdersOrderFulfillmentsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -95,10 +97,7 @@ import { Fulfillment, LineItem } from "../../../../models" export default async (req, res) => { const { id } = req.params - const validated = await validator( - AdminPostOrdersOrderFulfillmentsReq, - req.body - ) + const validated = req.validatedBody const orderService: OrderService = req.scope.resolve("orderService") const pvInventoryService: ProductVariantInventoryService = req.scope.resolve( @@ -136,9 +135,8 @@ export default async (req, res) => { } }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) @@ -239,3 +237,5 @@ class Item { @IsNotEmpty() quantity: number } + +export class AdminPostOrdersOrderFulfillmentsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/create-shipment.ts b/packages/medusa/src/api/routes/admin/orders/create-shipment.ts index 6044f298dd..8fb0a1a148 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-shipment.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-shipment.ts @@ -5,12 +5,11 @@ import { IsOptional, IsString, } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { OrderService } from "../../../../services" import { TrackingLink } from "../../../../models" -import { validator } from "../../../../utils/validator" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/shipment @@ -20,6 +19,8 @@ import { validator } from "../../../../utils/validator" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -27,6 +28,7 @@ import { validator } from "../../../../utils/validator" * $ref: "#/components/schemas/AdminPostOrdersOrderShipmentReq" * x-codegen: * method: createShipment + * params: AdminPostOrdersOrderShipmentParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -77,7 +79,7 @@ import { validator } from "../../../../utils/validator" export default async (req, res) => { const { id } = req.params - const validated = await validator(AdminPostOrdersOrderShipmentReq, req.body) + const validated = req.validatedBody const orderService: OrderService = req.scope.resolve("orderService") @@ -98,9 +100,8 @@ export default async (req, res) => { ) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) @@ -138,3 +139,5 @@ export class AdminPostOrdersOrderShipmentReq { @IsOptional() no_notification?: boolean } + +export class AdminPostOrdersOrderShipmentParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/create-swap-shipment.ts b/packages/medusa/src/api/routes/admin/orders/create-swap-shipment.ts index 0f84f850b1..0f5952fe53 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-swap-shipment.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-swap-shipment.ts @@ -6,10 +6,10 @@ import { IsString, } from "class-validator" import { OrderService, SwapService } from "../../../../services" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { validator } from "../../../../utils/validator" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/swaps/{swap_id}/shipments @@ -20,6 +20,8 @@ import { validator } from "../../../../utils/validator" * parameters: * - (path) id=* {string} The ID of the Order. * - (path) swap_id=* {string} The ID of the Swap. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -27,6 +29,7 @@ import { validator } from "../../../../utils/validator" * $ref: "#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq" * x-codegen: * method: createSwapShipment + * params: AdminPostOrdersOrderSwapsSwapShipmentsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -95,9 +98,8 @@ export default async (req, res) => { ) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order }) @@ -135,3 +137,5 @@ export class AdminPostOrdersOrderSwapsSwapShipmentsReq { @IsOptional() no_notification?: boolean } + +export class AdminPostOrdersOrderSwapsSwapShipmentsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/create-swap.ts b/packages/medusa/src/api/routes/admin/orders/create-swap.ts index 0decab7462..56a43b137b 100644 --- a/packages/medusa/src/api/routes/admin/orders/create-swap.ts +++ b/packages/medusa/src/api/routes/admin/orders/create-swap.ts @@ -16,12 +16,11 @@ import { Min, ValidateNested, } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { MedusaError } from "medusa-core-utils" import { Type } from "class-transformer" -import { validator } from "../../../../utils/validator" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/order/{id}/swaps @@ -31,6 +30,8 @@ import { validator } from "../../../../utils/validator" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} (Comma separated) Which fields should be expanded the order of the result. + * - (query) fields {string} (Comma separated) Which fields should be included the order of the result. * requestBody: * content: * application/json: @@ -38,6 +39,7 @@ import { validator } from "../../../../utils/validator" * $ref: "#/components/schemas/AdminPostOrdersOrderSwapsReq" * x-codegen: * method: createSwap + * queryParams: AdminPostOrdersOrderSwapsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -98,7 +100,7 @@ import { validator } from "../../../../utils/validator" export default async (req, res) => { const { id } = req.params - const validated = await validator(AdminPostOrdersOrderSwapsReq, req.body) + const validated = req.validatedBody const idempotencyKeyService: IdempotencyKeyService = req.scope.resolve( "idempotencyKeyService" @@ -210,9 +212,8 @@ export default async (req, res) => { const order = await orderService .withTransaction(transactionManager) - .retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + .retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) return { @@ -413,3 +414,5 @@ class AdditionalItem { @IsNotEmpty() quantity: number } + +export class AdminPostOrdersOrderSwapsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/fulfill-claim.ts b/packages/medusa/src/api/routes/admin/orders/fulfill-claim.ts index b370e87a9a..dda9d6a67b 100644 --- a/packages/medusa/src/api/routes/admin/orders/fulfill-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/fulfill-claim.ts @@ -1,9 +1,8 @@ import { ClaimService, OrderService } from "../../../../services" import { IsBoolean, IsObject, IsOptional } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" -import { validator } from "../../../../utils/validator" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/claims/{claim_id}/fulfillments @@ -14,6 +13,8 @@ import { validator } from "../../../../utils/validator" * parameters: * - (path) id=* {string} The ID of the Order. * - (path) claim_id=* {string} The ID of the Claim. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -21,6 +22,7 @@ import { validator } from "../../../../utils/validator" * $ref: "#/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq" * x-codegen: * method: fulfillClaim + * params: AdminPostOrdersOrderClaimsClaimFulfillmentsReq * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -65,10 +67,7 @@ import { validator } from "../../../../utils/validator" export default async (req, res) => { const { id, claim_id } = req.params - const validated = await validator( - AdminPostOrdersOrderClaimsClaimFulfillmentsReq, - req.body - ) + const validated = req.validatedBody const orderService: OrderService = req.scope.resolve("orderService") const claimService: ClaimService = req.scope.resolve("claimService") @@ -81,9 +80,8 @@ export default async (req, res) => { }) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.status(200).json({ order }) @@ -109,3 +107,6 @@ export class AdminPostOrdersOrderClaimsClaimFulfillmentsReq { @IsOptional() no_notification?: boolean } + +// eslint-disable-next-line max-len +export class AdminPostOrdersOrderClaimsClaimFulfillmentsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/fulfill-swap.ts b/packages/medusa/src/api/routes/admin/orders/fulfill-swap.ts index a8678a0bf6..753ea740b6 100644 --- a/packages/medusa/src/api/routes/admin/orders/fulfill-swap.ts +++ b/packages/medusa/src/api/routes/admin/orders/fulfill-swap.ts @@ -1,9 +1,9 @@ import { IsBoolean, IsObject, IsOptional } from "class-validator" import { OrderService, SwapService } from "../../../../services" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" import { validator } from "../../../../utils/validator" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/swaps/{swap_id}/fulfillments @@ -14,6 +14,8 @@ import { validator } from "../../../../utils/validator" * parameters: * - (path) id=* {string} The ID of the Order. * - (path) swap_id=* {string} The ID of the Swap. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -21,6 +23,7 @@ import { validator } from "../../../../utils/validator" * $ref: "#/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq" * x-codegen: * method: fulfillSwap + * params: AdminPostOrdersOrderSwapsSwapFulfillmentsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -81,9 +84,8 @@ export default async (req, res) => { }) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.status(200).json({ order }) @@ -109,3 +111,6 @@ export class AdminPostOrdersOrderSwapsSwapFulfillmentsReq { @IsOptional() no_notification?: boolean } + +// eslint-disable-next-line max-len +export class AdminPostOrdersOrderSwapsSwapFulfillmentsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/get-order.ts b/packages/medusa/src/api/routes/admin/orders/get-order.ts index b88f9fc490..36c0cf86da 100644 --- a/packages/medusa/src/api/routes/admin/orders/get-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/get-order.ts @@ -60,9 +60,11 @@ export default async (req, res) => { const orderService: OrderService = req.scope.resolve("orderService") - const order = await orderService.retrieveWithTotals(id, req.retrieveConfig) + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, + }) - res.json({ order }) + res.json({ order: order }) } export class AdminGetOrdersOrderParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/index.ts b/packages/medusa/src/api/routes/admin/orders/index.ts index 16642f31f6..cedf1c331a 100644 --- a/packages/medusa/src/api/routes/admin/orders/index.ts +++ b/packages/medusa/src/api/routes/admin/orders/index.ts @@ -6,12 +6,72 @@ import { FindParams, PaginatedResponse } from "../../../../types/common" import { FlagRouter } from "../../../../utils/flag-router" import middlewares, { transformBody, + transformIncludesOptions, transformQuery, } from "../../../middlewares" import { checkRegisteredModules } from "../../../middlewares/check-registered-modules" import { AdminOrdersOrderLineItemReservationReq } from "./create-reservation-for-line-item" import { AdminGetOrdersOrderReservationsParams } from "./get-reservations" import { AdminGetOrdersParams } from "./list-orders" +import { + AdminPostOrdersOrderSwapsParams, + AdminPostOrdersOrderSwapsReq, +} from "./create-swap" +import { + AdminPostOrdersOrderParams, + AdminPostOrdersOrderReq, +} from "./update-order" +import { AdminPostOrdersOrderCompleteParams } from "./complete-order" +import { + AdminPostOrdersOrderRefundsParams, + AdminPostOrdersOrderRefundsReq, +} from "./refund-payment" +import { AdminPostOrdersOrderCaptureParams } from "./capture-payment" +import { + AdminPostOrdersOrderFulfillmentsParams, + AdminPostOrdersOrderFulfillmentsReq, +} from "./create-fulfillment" +import { AdminPostOrdersOrderFulfillementsCancelParams } from "./cancel-fulfillment" +import { AdminPostOrdersOrderSwapFulfillementsCancelParams } from "./cancel-fulfillment-swap" +import { AdminPostOrdersClaimFulfillmentsCancelParams } from "./cancel-fulfillment-claim" +import { + AdminPostOrdersOrderShipmentParams, + AdminPostOrdersOrderShipmentReq, +} from "./create-shipment" +import { + AdminPostOrdersOrderReturnsParams, + AdminPostOrdersOrderReturnsReq, +} from "./request-return" +import { AdminPostOrdersOrderCancel } from "./cancel-order" +import { + AdminPostOrdersOrderShippingMethodsParams, + AdminPostOrdersOrderShippingMethodsReq, +} from "./add-shipping-method" +import { AdminPostOrdersOrderArchiveParams } from "./archive-order" +import { AdminPostOrdersSwapCancelParams } from "./cancel-swap" +import { AdminPostOrdersOrderSwapsSwapFulfillmentsParams } from "./fulfill-swap" +import { + AdminPostOrdersOrderSwapsSwapShipmentsParams, + AdminPostOrdersOrderSwapsSwapShipmentsReq, +} from "./create-swap-shipment" +import { AdminPostOrdersOrderSwapsSwapProcessPaymentParams } from "./process-swap-payment" +import { + AdminPostOrdersOrderClaimsParams, + AdminPostOrdersOrderClaimsReq, +} from "./create-claim" +import { AdminPostOrdersClaimCancel } from "./cancel-claim" +import { + AdminPostOrdersOrderClaimsClaimParams, + AdminPostOrdersOrderClaimsClaimReq, +} from "./update-claim" +import { + AdminPostOrdersOrderClaimsClaimFulfillmentsParams, + AdminPostOrdersOrderClaimsClaimFulfillmentsReq, +} from "./fulfill-claim" +import { + AdminPostOrdersOrderClaimsClaimShipmentsParams, + AdminPostOrdersOrderClaimsClaimShipmentsReq, +} from "./create-claim-shipment" const route = Router() @@ -31,6 +91,7 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.get( "/", + transformIncludesOptions(allowedOrderIncludesFields), transformQuery(AdminGetOrdersParams, { defaultRelations: relations, defaultFields: defaultAdminOrdersFields, @@ -44,21 +105,12 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.get( "/:id", - transformQuery(FindParams, { + transformIncludesOptions(allowedOrderIncludesFields, [ + AvailableOrderIncludesFields.RETURNABLE_ITEMS, + ]), + transformQuery(AdminPostOrdersOrderParams, { defaultRelations: relations, - defaultFields: defaultFields.filter((field) => { - return ![ - "shipping_total", - "discount_total", - "tax_total", - "refunded_total", - "total", - "subtotal", - "refundable_amount", - "gift_card_total", - "gift_card_tax_total", - ].includes(field) - }), + defaultFields: defaultFields, isList: false, }), middlewares.wrap(require("./get-order").default) @@ -67,13 +119,29 @@ export default (app, featureFlagRouter: FlagRouter) => { /** * Update an order */ - route.post("/:id", middlewares.wrap(require("./update-order").default)) + route.post( + "/:id", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderReq), + transformQuery(FindParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), + middlewares.wrap(require("./update-order").default) + ) /** * Mark an order as completed */ route.post( "/:id/complete", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersOrderCompleteParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./complete-order").default) ) @@ -82,6 +150,13 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/refund", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderRefundsReq), + transformQuery(AdminPostOrdersOrderRefundsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./refund-payment").default) ) @@ -90,6 +165,12 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/capture", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersOrderCaptureParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./capture-payment").default) ) @@ -98,6 +179,13 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/fulfillment", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderFulfillmentsReq), + transformQuery(AdminPostOrdersOrderFulfillmentsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./create-fulfillment").default) ) @@ -106,6 +194,12 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/fulfillments/:fulfillment_id/cancel", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersOrderFulfillementsCancelParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./cancel-fulfillment").default) ) @@ -114,6 +208,12 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/swaps/:swap_id/fulfillments/:fulfillment_id/cancel", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersOrderSwapFulfillementsCancelParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./cancel-fulfillment-swap").default) ) @@ -122,6 +222,12 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/claims/:claim_id/fulfillments/:fulfillment_id/cancel", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersClaimFulfillmentsCancelParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./cancel-fulfillment-claim").default) ) @@ -130,6 +236,13 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/shipment", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderShipmentReq), + transformQuery(AdminPostOrdersOrderShipmentParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./create-shipment").default) ) @@ -138,19 +251,42 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/return", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderReturnsReq), + transformQuery(AdminPostOrdersOrderReturnsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./request-return").default) ) /** * Cancel an order. */ - route.post("/:id/cancel", middlewares.wrap(require("./cancel-order").default)) + route.post( + "/:id/cancel", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersOrderCancel, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), + middlewares.wrap(require("./cancel-order").default) + ) /** * Add a shipping method */ route.post( "/:id/shipping-methods", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderShippingMethodsReq), + transformQuery(AdminPostOrdersOrderShippingMethodsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./add-shipping-method").default) ) @@ -159,19 +295,43 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/archive", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersOrderArchiveParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./archive-order").default) ) /** * Creates a swap, requests a return and prepares a cart for payment. */ - route.post("/:id/swaps", middlewares.wrap(require("./create-swap").default)) + route.post( + "/:id/swaps", + transformIncludesOptions(allowedOrderIncludesFields, [ + AvailableOrderIncludesFields.RETURNABLE_ITEMS, + ]), + transformBody(AdminPostOrdersOrderSwapsReq), + transformQuery(AdminPostOrdersOrderSwapsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), + middlewares.wrap(require("./create-swap").default) + ) /** * Cancels a swap. */ route.post( "/:id/swaps/:swap_id/cancel", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersSwapCancelParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./cancel-swap").default) ) @@ -180,6 +340,12 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/swaps/:swap_id/fulfillments", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersOrderSwapsSwapFulfillmentsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./fulfill-swap").default) ) @@ -188,6 +354,13 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/swaps/:swap_id/shipments", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderSwapsSwapShipmentsReq), + transformQuery(AdminPostOrdersOrderSwapsSwapShipmentsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./create-swap-shipment").default) ) @@ -196,19 +369,41 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/swaps/:swap_id/process-payment", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersOrderSwapsSwapProcessPaymentParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./process-swap-payment").default) ) /** * Creates a claim */ - route.post("/:id/claims", middlewares.wrap(require("./create-claim").default)) + route.post( + "/:id/claims", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderClaimsReq), + transformQuery(AdminPostOrdersOrderClaimsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), + middlewares.wrap(require("./create-claim").default) + ) /** * Cancels a claim */ route.post( "/:id/claims/:claim_id/cancel", + transformIncludesOptions(allowedOrderIncludesFields), + transformQuery(AdminPostOrdersClaimCancel, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./cancel-claim").default) ) @@ -217,6 +412,13 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/claims/:claim_id", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderClaimsClaimReq), + transformQuery(AdminPostOrdersOrderClaimsClaimParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./update-claim").default) ) @@ -225,6 +427,13 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/claims/:claim_id/fulfillments", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderClaimsClaimFulfillmentsReq), + transformQuery(AdminPostOrdersOrderClaimsClaimFulfillmentsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./fulfill-claim").default) ) @@ -233,6 +442,13 @@ export default (app, featureFlagRouter: FlagRouter) => { */ route.post( "/:id/claims/:claim_id/shipments", + transformIncludesOptions(allowedOrderIncludesFields), + transformBody(AdminPostOrdersOrderClaimsClaimShipmentsReq), + transformQuery(AdminPostOrdersOrderClaimsClaimShipmentsParams, { + defaultRelations: relations, + defaultFields: defaultFields, + isList: false, + }), middlewares.wrap(require("./create-claim-shipment").default) ) @@ -367,15 +583,6 @@ export const defaultAdminOrdersFields = [ "items.refundable", "swaps.additional_items.refundable", "claims.additional_items.refundable", - "shipping_total", - "discount_total", - "tax_total", - "refunded_total", - "gift_card_total", - "subtotal", - "total", - "paid_total", - "refundable_amount", "no_notification", ] as (keyof Order)[] @@ -396,6 +603,14 @@ export const filterableAdminOrdersFields = [ "updated_at", ] +export const AvailableOrderIncludesFields = { + RETURNABLE_ITEMS: "returnable_items", +} + +export const allowedOrderIncludesFields = [ + AvailableOrderIncludesFields.RETURNABLE_ITEMS, +] + export * from "./add-shipping-method" export * from "./archive-order" export * from "./cancel-claim" diff --git a/packages/medusa/src/api/routes/admin/orders/process-swap-payment.ts b/packages/medusa/src/api/routes/admin/orders/process-swap-payment.ts index 99a8cdef87..5954e51e99 100644 --- a/packages/medusa/src/api/routes/admin/orders/process-swap-payment.ts +++ b/packages/medusa/src/api/routes/admin/orders/process-swap-payment.ts @@ -1,7 +1,7 @@ import { OrderService, SwapService } from "../../../../services" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EntityManager } from "typeorm" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/swaps/{swap_id}/process-payment @@ -12,8 +12,11 @@ import { EntityManager } from "typeorm" * parameters: * - (path) id=* {string} The ID of the Order. * - (path) swap_id=* {string} The ID of the Swap. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * x-codegen: * method: processSwapPayment + * params: AdminPostOrdersOrderSwapsSwapProcessPaymentParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -64,12 +67,14 @@ export default async (req, res) => { await entityManager.transaction(async (manager) => { await swapService.withTransaction(manager).processDifference(swap_id) - - const order = await orderService.withTransaction(manager).retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, - }) - - res.json({ order }) }) + + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, + }) + + res.json({ order }) } + +// eslint-disable-next-line max-len +export class AdminPostOrdersOrderSwapsSwapProcessPaymentParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/refund-payment.ts b/packages/medusa/src/api/routes/admin/orders/refund-payment.ts index c68837b599..3a04a4664d 100644 --- a/packages/medusa/src/api/routes/admin/orders/refund-payment.ts +++ b/packages/medusa/src/api/routes/admin/orders/refund-payment.ts @@ -5,11 +5,10 @@ import { IsOptional, IsString, } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { OrderService } from "../../../../services" -import { validator } from "../../../../utils/validator" import { EntityManager } from "typeorm" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/refund @@ -19,6 +18,8 @@ import { EntityManager } from "typeorm" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -26,6 +27,7 @@ import { EntityManager } from "typeorm" * $ref: "#/components/schemas/AdminPostOrdersOrderRefundsReq" * x-codegen: * method: refundPayment + * params: AdminPostOrdersOrderRefundsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -78,7 +80,7 @@ import { EntityManager } from "typeorm" export default async (req, res) => { const { id } = req.params - const validated = await validator(AdminPostOrdersOrderRefundsReq, req.body) + const validated = req.validatedBody const orderService: OrderService = req.scope.resolve("orderService") @@ -91,9 +93,8 @@ export default async (req, res) => { }) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.status(200).json({ order }) @@ -136,3 +137,5 @@ export class AdminPostOrdersOrderRefundsReq { @IsOptional() no_notification?: boolean } + +export class AdminPostOrdersOrderRefundsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/request-return.ts b/packages/medusa/src/api/routes/admin/orders/request-return.ts index 95e5b47b25..89226d3cbb 100644 --- a/packages/medusa/src/api/routes/admin/orders/request-return.ts +++ b/packages/medusa/src/api/routes/admin/orders/request-return.ts @@ -6,7 +6,6 @@ import { IsString, ValidateNested, } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { EventBusService, OrderService, @@ -18,7 +17,7 @@ import { isDefined, MedusaError } from "medusa-core-utils" import { EntityManager } from "typeorm" import { Order, Return } from "../../../../models" import { OrdersReturnItem } from "../../../../types/orders" -import { validator } from "../../../../utils/validator" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/orders/{id}/return @@ -28,6 +27,8 @@ import { validator } from "../../../../utils/validator" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -35,6 +36,7 @@ import { validator } from "../../../../utils/validator" * $ref: "#/components/schemas/AdminPostOrdersOrderReturnsReq" * x-codegen: * method: requestReturn + * params: AdminPostOrdersOrderReturnsParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -96,7 +98,7 @@ import { validator } from "../../../../utils/validator" export default async (req, res) => { const { id } = req.params - const value = await validator(AdminPostOrdersOrderReturnsReq, req.body) + const value = req.validatedBody const idempotencyKeyService = req.scope.resolve("idempotencyKeyService") const manager: EntityManager = req.scope.resolve("manager") @@ -152,14 +154,16 @@ export default async (req, res) => { } } - const order = await orderService - .withTransaction(manager) - .retrieve(id) + let evaluatedNoNotification = value.no_notification + + if (!isDefined(evaluatedNoNotification)) { + const order = await orderService + .withTransaction(manager) + .retrieve(id) + + evaluatedNoNotification = order.no_notification + } - const evaluatedNoNotification = - value.no_notification !== undefined - ? value.no_notification - : order.no_notification returnObj.no_notification = evaluatedNoNotification const createdReturn = await returnService @@ -174,7 +178,7 @@ export default async (req, res) => { await eventBus .withTransaction(manager) - .emit("order.return_requested", { + .emit(OrderService.Events.RETURN_REQUESTED, { id, return_id: createdReturn.id, no_notification: evaluatedNoNotification, @@ -198,9 +202,7 @@ export default async (req, res) => { idempotencyKey = await idempotencyKeyService .withTransaction(transactionManager) .workStage(idempotencyKey.idempotency_key, async (manager) => { - let order: Order | Return = await orderService - .withTransaction(manager) - .retrieve(id, { relations: ["returns"] }) + let order: Order | Return /** * If we are ready to receive immediately, we find the newly created return @@ -229,9 +231,8 @@ export default async (req, res) => { order = await orderService .withTransaction(manager) - .retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + .retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) return { @@ -374,3 +375,5 @@ class ReturnShipping { @IsOptional() price?: number } + +export class AdminPostOrdersOrderReturnsParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/update-claim.ts b/packages/medusa/src/api/routes/admin/orders/update-claim.ts index 489437eaea..178f2cf594 100644 --- a/packages/medusa/src/api/routes/admin/orders/update-claim.ts +++ b/packages/medusa/src/api/routes/admin/orders/update-claim.ts @@ -8,12 +8,12 @@ import { IsString, ValidateNested, } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." import { ClaimService, OrderService } from "../../../../services" import { Type } from "class-transformer" import { EntityManager } from "typeorm" import { validator } from "../../../../utils/validator" +import { FindParams } from "../../../../types/common" /** * @oas [post] /admin/order/{id}/claims/{claim_id} @@ -24,6 +24,8 @@ import { validator } from "../../../../utils/validator" * parameters: * - (path) id=* {string} The ID of the Order. * - (path) claim_id=* {string} The ID of the Claim. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -31,6 +33,7 @@ import { validator } from "../../../../utils/validator" * $ref: "#/components/schemas/AdminPostOrdersOrderClaimsClaimReq" * x-codegen: * method: updateClaim + * params: AdminPostOrdersOrderClaimsClaimParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -96,9 +99,8 @@ export default async (req, res) => { .update(claim_id, validated) }) - const data = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const data = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.json({ order: data }) @@ -277,3 +279,5 @@ class Tag { @IsOptional() value?: string } + +export class AdminPostOrdersOrderClaimsClaimParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/orders/update-order.ts b/packages/medusa/src/api/routes/admin/orders/update-order.ts index 83ff2f3c3d..2d10cf95ed 100644 --- a/packages/medusa/src/api/routes/admin/orders/update-order.ts +++ b/packages/medusa/src/api/routes/admin/orders/update-order.ts @@ -8,13 +8,11 @@ import { IsString, ValidateNested, } from "class-validator" -import { defaultAdminOrdersFields, defaultAdminOrdersRelations } from "." -import { AddressPayload } from "../../../../types/common" +import { AddressPayload, FindParams } from "../../../../types/common" import { EntityManager } from "typeorm" import { OrderService } from "../../../../services" import { Type } from "class-transformer" -import { validator } from "../../../../utils/validator" /** * @oas [post] /admin/orders/{id} @@ -24,6 +22,8 @@ import { validator } from "../../../../utils/validator" * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Order. + * - (query) expand {string} Comma separated list of relations to include in the result. + * - (query) fields {string} Comma separated list of fields to include in the result. * requestBody: * content: * application/json: @@ -31,6 +31,7 @@ import { validator } from "../../../../utils/validator" * $ref: "#/components/schemas/AdminPostOrdersOrderReq" * x-codegen: * method: update + * params: AdminPostOrdersOrderParams * x-codeSamples: * - lang: JavaScript * label: JS Client @@ -82,20 +83,17 @@ import { validator } from "../../../../utils/validator" export default async (req, res) => { const { id } = req.params - const value = await validator(AdminPostOrdersOrderReq, req.body) - const orderService: OrderService = req.scope.resolve("orderService") const manager: EntityManager = req.scope.resolve("manager") await manager.transaction(async (transactionManager) => { return await orderService .withTransaction(transactionManager) - .update(id, value) + .update(id, req.validatedBody) }) - const order = await orderService.retrieve(id, { - select: defaultAdminOrdersFields, - relations: defaultAdminOrdersRelations, + const order = await orderService.retrieveWithTotals(id, req.retrieveConfig, { + includes: req.includes, }) res.status(200).json({ order }) @@ -244,3 +242,5 @@ class ShippingMethod { @IsOptional() items?: Record[] } + +export class AdminPostOrdersOrderParams extends FindParams {} diff --git a/packages/medusa/src/api/routes/admin/returns/receive-return.ts b/packages/medusa/src/api/routes/admin/returns/receive-return.ts index 61683324b0..152b236f67 100644 --- a/packages/medusa/src/api/routes/admin/returns/receive-return.ts +++ b/packages/medusa/src/api/routes/admin/returns/receive-return.ts @@ -7,10 +7,10 @@ import { } from "class-validator" import { OrderService, ReturnService, SwapService } from "../../../../services" -import { EntityManager } from "typeorm" import { Type } from "class-transformer" -import { validator } from "../../../../utils/validator" import { isDefined } from "medusa-core-utils" +import { EntityManager } from "typeorm" +import { validator } from "../../../../utils/validator" /** * @oas [post] /admin/returns/{id}/receive diff --git a/packages/medusa/src/interfaces/payment-service.ts b/packages/medusa/src/interfaces/payment-service.ts index a32d2c1c3d..c6a01dec39 100644 --- a/packages/medusa/src/interfaces/payment-service.ts +++ b/packages/medusa/src/interfaces/payment-service.ts @@ -36,19 +36,19 @@ export type PaymentSessionResponse = { } /** - * @deprecated use the new PaymentProcessor interface instead + * This will be @deprecated in the near future use the new PaymentProcessor interface instead */ export interface PaymentService extends TransactionBaseService { getIdentifier(): string /** - * @deprecated use PaymentProcessor.retrievePayment instead + * This will be @deprecated in the near future use PaymentProcessor.retrievePayment instead * @param paymentSession */ getPaymentData(paymentSession: PaymentSession): Promise /** - * @deprecated use PaymentProcessor.updatePayment instead + * This will be @deprecated in the near future use PaymentProcessor.updatePayment instead * @param paymentSessionData * @param data */ @@ -58,20 +58,20 @@ export interface PaymentService extends TransactionBaseService { ): Promise /** - * @deprecated use PaymentProcessor.initiatePayment instead + * This will be @deprecated in the near future use PaymentProcessor.initiatePayment instead * @param context The type of this argument is meant to be temporary and once the previous method signature * will be removed, the type will only be PaymentContext instead of Cart & PaymentContext */ createPayment(context: Cart & PaymentContext): Promise /** - * @deprecated use createPayment(context: Cart & PaymentContext): Promise instead + * This will be @deprecated in the near future use createPayment(context: Cart & PaymentContext): Promise instead * @param cart */ createPayment(cart: Cart): Promise /** - * @deprecated use PaymentProcessor.retrievePayment instead + * This will be @deprecated in the near future use PaymentProcessor.retrievePayment instead * @param paymentData */ retrievePayment(paymentData: PaymentData): Promise @@ -82,7 +82,7 @@ export interface PaymentService extends TransactionBaseService { ): Promise /** - * @deprecated use PaymentProcessor.updatePayment instead + * This will be @deprecated in the near future use PaymentProcessor.updatePayment instead * @param paymentSessionData * @param cart */ @@ -92,7 +92,7 @@ export interface PaymentService extends TransactionBaseService { ): Promise /** - * @deprecated use PaymentProcessor.authorizePayment instead + * This will be @deprecated in the near future use PaymentProcessor.authorizePayment instead * @param paymentSession * @param context */ @@ -102,45 +102,45 @@ export interface PaymentService extends TransactionBaseService { ): Promise<{ data: PaymentSessionData; status: PaymentSessionStatus }> /** - * @deprecated use PaymentProcessor.capturePayment instead + * This will be @deprecated in the near future use PaymentProcessor.capturePayment instead * @param payment */ capturePayment(payment: Payment): Promise /** - * @deprecated use PaymentProcessor.refundPayment instead + * This will be @deprecated in the near future use PaymentProcessor.refundPayment instead * @param payment * @param refundAmount */ refundPayment(payment: Payment, refundAmount: number): Promise /** - * @deprecated use PaymentProcessor.cancelPayment instead + * This will be @deprecated in the near future use PaymentProcessor.cancelPayment instead * @param payment */ cancelPayment(payment: Payment): Promise /** - * @deprecated use PaymentProcessor.cancelPayment instead + * This will be @deprecated in the near future use PaymentProcessor.cancelPayment instead * @param paymentSession */ deletePayment(paymentSession: PaymentSession): Promise /** - * @deprecated use PaymentProcessor.getSavedMethods instead + * This will be @deprecated in the near future use PaymentProcessor.getSavedMethods instead * @param customer */ retrieveSavedMethods(customer: Customer): Promise /** - * @deprecated use PaymentProcessor.getPaymentStatus instead + * This will be @deprecated in the near future use PaymentProcessor.getPaymentStatus instead * @param data */ getStatus(data: Data): Promise } /** - * @deprecated use the AbstractPaymentProcessor instead + * This will be @deprecated in the near future use the AbstractPaymentProcessor instead */ export abstract class AbstractPaymentService extends TransactionBaseService @@ -183,7 +183,7 @@ export abstract class AbstractPaymentService ): Promise /** - * @deprecated use createPayment(context: Cart & PaymentContext): Promise instead + * This will be @deprecated in the near future use createPayment(context: Cart & PaymentContext): Promise instead * @param cart */ public abstract createPayment(cart: Cart): Promise @@ -205,7 +205,7 @@ export abstract class AbstractPaymentService ): Promise /** - * @deprecated use updatePayment(paymentSessionData: PaymentSessionData, context: Cart & PaymentContext): Promise instead + * This will be @deprecated in the near future use updatePayment(paymentSessionData: PaymentSessionData, context: Cart & PaymentContext): Promise instead * @param paymentSessionData * @param cart */ @@ -223,12 +223,12 @@ export abstract class AbstractPaymentService ): Promise<{ data: PaymentSessionData; status: PaymentSessionStatus }> /** - * @deprecated + * This will be @deprecated in the near future */ public abstract capturePayment(payment: Payment): Promise /** - * @deprecated + * This will be @deprecated in the near future */ public abstract refundPayment( payment: Payment, @@ -236,17 +236,17 @@ export abstract class AbstractPaymentService ): Promise /** - * @deprecated + * This will be @deprecated in the near future */ public abstract cancelPayment(payment: Payment): Promise /** - * @deprecated + * This will be @deprecated in the near future */ public abstract deletePayment(paymentSession: PaymentSession): Promise /** - * @deprecated + * This will be @deprecated in the near future */ // eslint-disable-next-line @typescript-eslint/no-unused-vars public async retrieveSavedMethods(customer: Customer): Promise { @@ -254,7 +254,7 @@ export abstract class AbstractPaymentService } /** - * @deprecated + * This will be @deprecated in the near future */ public abstract getStatus(data: Data): Promise } diff --git a/packages/medusa/src/models/order.ts b/packages/medusa/src/models/order.ts index 24a58b7ad6..19c17eb066 100644 --- a/packages/medusa/src/models/order.ts +++ b/packages/medusa/src/models/order.ts @@ -250,6 +250,8 @@ export class Order extends BaseEntity { gift_card_total: number gift_card_tax_total: number + returnable_items?: LineItem[] + @BeforeInsert() private async beforeInsert(): Promise { this.id = generateEntityId(this.id, "order") @@ -540,6 +542,11 @@ export class Order extends BaseEntity { * description: The total of gift cards with taxes * type: integer * example: 0 + * returnable_items: + * description: The items that are returnable as part of the order, order swaps or order claims + * type: array + * items: + * $ref: "#/components/schemas/LineItem" * created_at: * description: The date with timezone at which the resource was created. * type: string diff --git a/packages/medusa/src/models/return.ts b/packages/medusa/src/models/return.ts index 5b5f6558cc..49f41bc5ac 100644 --- a/packages/medusa/src/models/return.ts +++ b/packages/medusa/src/models/return.ts @@ -11,12 +11,12 @@ import { import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" import { BaseEntity } from "../interfaces/models/base-entity" +import { generateEntityId } from "../utils/generate-entity-id" import { ClaimOrder } from "./claim-order" import { Order } from "./order" import { ReturnItem } from "./return-item" import { ShippingMethod } from "./shipping-method" import { Swap } from "./swap" -import { generateEntityId } from "../utils/generate-entity-id" export enum ReturnStatus { REQUESTED = "requested", @@ -36,7 +36,7 @@ export class Return extends BaseEntity { @OneToMany(() => ReturnItem, (item) => item.return_order, { eager: true, - cascade: ["insert"], + cascade: ["insert", "update"], }) items: ReturnItem[] diff --git a/packages/medusa/src/services/order.ts b/packages/medusa/src/services/order.ts index 7b3afff055..6d40c9a653 100644 --- a/packages/medusa/src/services/order.ts +++ b/packages/medusa/src/services/order.ts @@ -34,7 +34,7 @@ import { CreateFulfillmentOrder, FulFillmentItemType, } from "../types/fulfillment" -import { UpdateOrderInput } from "../types/orders" +import { TotalsContext, UpdateOrderInput } from "../types/orders" import { CreateShippingMethodDto } from "../types/shipping-options" import { buildQuery, @@ -91,10 +91,6 @@ type InjectedDependencies = { productVariantInventoryService: ProductVariantInventoryService } -type TotalsConfig = { - force_taxes?: boolean -} - class OrderService extends TransactionBaseService { static readonly Events = { GIFT_CARD_CREATED: "order.gift_card_created", @@ -472,12 +468,12 @@ class OrderService extends TransactionBaseService { async retrieveWithTotals( orderId: string, options: FindConfig = {}, - totalsConfig: TotalsConfig = {} + context: TotalsContext = {} ): Promise { const relations = this.getTotalsRelations(options) const order = await this.retrieve(orderId, { ...options, relations }) - return await this.decorateTotals(order, totalsConfig) + return await this.decorateTotals(order, context) } /** @@ -1759,17 +1755,24 @@ class OrderService extends TransactionBaseService { return order } + async decorateTotals(order: Order, totalsFields?: string[]): Promise + + async decorateTotals(order: Order, context?: TotalsContext): Promise + /** * Calculate and attach the different total fields on the object * @param order - * @param totalsFieldsOrConfig + * @param totalsFieldsOrContext */ async decorateTotals( order: Order, - totalsFieldsOrConfig?: string[] | TotalsConfig + totalsFieldsOrContext?: string[] | TotalsContext ): Promise { - if (Array.isArray(totalsFieldsOrConfig)) { - return await this.decorateTotalsLegacy(order, totalsFieldsOrConfig) + if (Array.isArray(totalsFieldsOrContext)) { + if (totalsFieldsOrContext.length) { + return await this.decorateTotalsLegacy(order, totalsFieldsOrContext) + } + totalsFieldsOrContext = {} } const newTotalsServiceTx = this.newTotalsService_.withTransaction( @@ -1779,10 +1782,31 @@ class OrderService extends TransactionBaseService { const calculationContext = await this.totalsService_.getCalculationContext( order ) - const orderItems = [...(order.items ?? [])] + + const { returnable_items } = totalsFieldsOrContext?.includes ?? {} + + const returnableItems: LineItem[] | undefined = isDefined(returnable_items) + ? [] + : undefined + + const isReturnableItem = (item) => + returnable_items && + (item.returned_quantity ?? 0) < (item.shipped_quantity ?? 0) + + const allItems: LineItem[] = [...(order.items ?? [])] + + if (returnable_items) { + // All items must receive their totals and if some of them are returnable + // They will be pushed to `returnable_items` at a later point + allItems.push( + ...(order.swaps?.map((s) => s.additional_items ?? []).flat() ?? []), + ...(order.claims?.map((c) => c.additional_items ?? []).flat() ?? []) + ) + } + const orderShippingMethods = [...(order.shipping_methods ?? [])] - const itemsTotals = await newTotalsServiceTx.getLineItemTotals(orderItems, { + const itemsTotals = await newTotalsServiceTx.getLineItemTotals(allItems, { taxRate: order.tax_rate, includeTax: true, calculationContext, @@ -1810,28 +1834,23 @@ class OrderService extends TransactionBaseService { let shipping_tax_total = 0 order.items = (order.items || []).map((item) => { - const refundable = newTotalsServiceTx.getLineItemRefund( - { - ...item, - quantity: item.quantity - (item.returned_quantity || 0), - }, - { - calculationContext, - taxRate: order.tax_rate, - } - ) + item.quantity = item.quantity - (item.returned_quantity || 0) + const refundable = newTotalsServiceTx.getLineItemRefund(item, { + calculationContext, + taxRate: order.tax_rate, + }) - const itemWithTotals = { - ...item, - ...(itemsTotals[item.id] ?? {}), - refundable, + Object.assign(item, itemsTotals[item.id] ?? {}, { refundable }) + + order.subtotal += item.subtotal ?? 0 + order.discount_total += item.discount_total ?? 0 + item_tax_total += item.tax_total ?? 0 + + if (isReturnableItem(item)) { + returnableItems?.push(item) } - order.subtotal += itemWithTotals.subtotal ?? 0 - order.discount_total += itemWithTotals.discount_total ?? 0 - item_tax_total += itemWithTotals.tax_total ?? 0 - - return itemWithTotals as LineItem + return item }) order.shipping_methods = (order.shipping_methods || []).map( @@ -1864,32 +1883,36 @@ class OrderService extends TransactionBaseService { for (const swap of order.swaps ?? []) { swap.additional_items = swap.additional_items.map((item) => { - item.refundable = newTotalsServiceTx.getLineItemRefund( - { - ...item, - quantity: item.quantity - (item.returned_quantity || 0), - }, - { - calculationContext, - taxRate: order.tax_rate, - } - ) + item.quantity = item.quantity - (item.returned_quantity || 0) + const refundable = newTotalsServiceTx.getLineItemRefund(item, { + calculationContext, + taxRate: order.tax_rate, + }) + + Object.assign(item, itemsTotals[item.id] ?? {}, { refundable }) + + if (isReturnableItem(item)) { + returnableItems?.push(item) + } + return item }) } for (const claim of order.claims ?? []) { claim.additional_items = claim.additional_items.map((item) => { - item.refundable = newTotalsServiceTx.getLineItemRefund( - { - ...item, - quantity: item.quantity - (item.returned_quantity || 0), - }, - { - calculationContext, - taxRate: order.tax_rate, - } - ) + item.quantity = item.quantity - (item.returned_quantity || 0) + const refundable = newTotalsServiceTx.getLineItemRefund(item, { + calculationContext, + taxRate: order.tax_rate, + }) + + Object.assign(item, itemsTotals[item.id] ?? {}, { refundable }) + + if (isReturnableItem(item)) { + returnableItems?.push(item) + } + return item }) } @@ -1900,6 +1923,8 @@ class OrderService extends TransactionBaseService { order.tax_total - (order.gift_card_total + order.discount_total) + order.returnable_items = returnableItems + return order } diff --git a/packages/medusa/src/types/orders.ts b/packages/medusa/src/types/orders.ts index 30b02e3472..e3127f4959 100644 --- a/packages/medusa/src/types/orders.ts +++ b/packages/medusa/src/types/orders.ts @@ -17,6 +17,11 @@ export function isOrder(object: any): object is Order { return object.object === "order" } +export type TotalsContext = { + force_taxes?: boolean + includes?: { returnable_items?: boolean } +} + enum OrderStatus { pending = "pending", completed = "completed", diff --git a/www/docs/announcement.json b/www/docs/announcement.json index 9e26dfeeb6..aaa64f4c8d 100644 --- a/www/docs/announcement.json +++ b/www/docs/announcement.json @@ -1 +1 @@ -{} \ No newline at end of file +{"id":"https://github.com/medusajs/medusa/releases/tag/v1.7.8","content":"v1.7.8 is out","isCloseable":true} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 251b81d552..5707dcf83a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5225,7 +5225,7 @@ __metadata: typeorm: ^0.3.11 typescript: ^4.4.4 peerDependencies: - "@medusajs/medusa": 1.7.7 + "@medusajs/medusa": 1.7.8 typeorm: ^0.3.11 languageName: unknown linkType: soft @@ -5279,7 +5279,7 @@ __metadata: version: 0.0.0-use.local resolution: "@medusajs/medusa-js@workspace:packages/medusa-js" dependencies: - "@medusajs/medusa": ^1.7.7 + "@medusajs/medusa": ^1.7.8 "@types/uuid": ^9.0.0 axios: ^0.24.0 cross-env: ^7.0.3 @@ -5291,7 +5291,7 @@ __metadata: typescript: ^4.9.5 uuid: ^9.0.0 peerDependencies: - "@medusajs/medusa": ^1.7.7 + "@medusajs/medusa": ^1.7.8 languageName: unknown linkType: soft @@ -5314,7 +5314,7 @@ __metadata: languageName: unknown linkType: soft -"@medusajs/medusa@*, @medusajs/medusa@^1.7.6, @medusajs/medusa@^1.7.7, @medusajs/medusa@workspace:packages/medusa": +"@medusajs/medusa@*, @medusajs/medusa@^1.7.6, @medusajs/medusa@^1.7.7, @medusajs/medusa@^1.7.8, @medusajs/medusa@workspace:packages/medusa": version: 0.0.0-use.local resolution: "@medusajs/medusa@workspace:packages/medusa" dependencies: