From d1abe7cd859a2adece5c4f06399a9ac36e047ff6 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 17 Feb 2023 15:23:20 +0200 Subject: [PATCH] chore(docs): manually generated API reference to fix load issue (#3286) --- docs/api/admin-spec3.json | 6088 ++++++++--------- docs/api/admin-spec3.yaml | 4668 ++++++------- docs/api/admin/components/schemas/Cart.yaml | 4 +- .../admin/components/schemas/ClaimImage.yaml | 2 +- .../api/admin/components/schemas/Country.yaml | 2 +- .../components/schemas/CustomerGroup.yaml | 4 +- .../admin/components/schemas/Discount.yaml | 2 +- .../components/schemas/DiscountRule.yaml | 2 +- .../components/schemas/FulfillmentItem.yaml | 2 +- .../schemas/LineItemAdjustment.yaml | 2 +- .../components/schemas/LineItemTaxLine.yaml | 2 +- .../admin/components/schemas/MoneyAmount.yaml | 6 +- .../components/schemas/Notification.yaml | 4 +- .../components/schemas/OrderItemChange.yaml | 2 +- .../components/schemas/ProductCategory.yaml | 6 +- .../components/schemas/ProductCollection.yaml | 2 +- .../components/schemas/ProductOption.yaml | 2 +- .../schemas/ProductOptionValue.yaml | 4 +- .../components/schemas/ProductVariant.yaml | 2 +- .../schemas/ProductVariantInventoryItem.yaml | 2 +- .../admin/components/schemas/ReturnItem.yaml | 2 +- .../components/schemas/ReturnReason.yaml | 4 +- .../schemas/SalesChannelLocation.yaml | 2 +- .../schemas/ShippingMethodTaxLine.yaml | 2 +- .../components/schemas/ShippingOption.yaml | 2 +- .../schemas/ShippingOptionRequirement.yaml | 2 +- .../components/schemas/ShippingProfile.yaml | 4 +- .../api/admin/components/schemas/TaxRate.yaml | 2 +- .../components/schemas/TrackingLink.yaml | 2 +- docs/api/admin/openapi.yaml | 80 +- docs/api/store-spec3.json | 1812 ++--- docs/api/store-spec3.yaml | 436 +- docs/api/store/components/schemas/Cart.yaml | 4 +- .../store/components/schemas/ClaimImage.yaml | 2 +- .../api/store/components/schemas/Country.yaml | 2 +- .../components/schemas/CustomerGroup.yaml | 4 +- .../store/components/schemas/Discount.yaml | 2 +- .../components/schemas/DiscountRule.yaml | 2 +- .../components/schemas/FulfillmentItem.yaml | 2 +- .../schemas/LineItemAdjustment.yaml | 2 +- .../components/schemas/LineItemTaxLine.yaml | 2 +- .../store/components/schemas/MoneyAmount.yaml | 6 +- .../components/schemas/Notification.yaml | 4 +- .../components/schemas/OrderItemChange.yaml | 2 +- .../components/schemas/ProductCategory.yaml | 6 +- .../components/schemas/ProductCollection.yaml | 2 +- .../components/schemas/ProductOption.yaml | 2 +- .../schemas/ProductOptionValue.yaml | 4 +- .../components/schemas/ProductVariant.yaml | 2 +- .../schemas/ProductVariantInventoryItem.yaml | 2 +- .../store/components/schemas/ReturnItem.yaml | 2 +- .../components/schemas/ReturnReason.yaml | 4 +- .../schemas/SalesChannelLocation.yaml | 2 +- .../schemas/ShippingMethodTaxLine.yaml | 2 +- .../components/schemas/ShippingOption.yaml | 2 +- .../schemas/ShippingOptionRequirement.yaml | 2 +- .../components/schemas/ShippingProfile.yaml | 4 +- .../api/store/components/schemas/TaxRate.yaml | 2 +- .../components/schemas/TrackingLink.yaml | 2 +- docs/api/store/openapi.yaml | 12 +- 60 files changed, 6622 insertions(+), 6622 deletions(-) diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index 6c26000ecf..2eb1e5fa0c 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -1517,6 +1517,314 @@ paths: $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' /currencies: get: operationId: GetCurrencies @@ -2352,314 +2660,6 @@ paths: $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 @@ -4007,6 +4007,348 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /gift-cards: + post: + operationId: PostGiftCards + summary: Create a Gift Card + description: >- + Creates a Gift Card that can redeemed by its unique code. The Gift Card + is only valid within 1 region. + 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' /draft-orders: post: operationId: PostDraftOrders @@ -4659,19 +5001,94 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /gift-cards: + /invites/accept: post: - operationId: PostGiftCards - summary: Create a Gift Card - description: >- - Creates a Gift Card that can redeemed by its unique code. The Gift Card - is only valid within 1 region. + operationId: 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/AdminPostGiftCardsReq' + $ref: '#/components/schemas/AdminPostInvitesReq' x-codegen: method: create x-codeSamples: @@ -4685,38 +5102,40 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.create({ - region_id + medusa.admin.invites.create({ + user: "user@example.com", + role: "admin" }) - .then(({ gift_card }) => { - console.log(gift_card.id); + .then(() => { + // successful + }) + + .catch(() => { + // an error occurred }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/gift-cards' \ + 'https://medusa-url.com/admin/invites' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "region_id": "{region_id}" + "user": "user@example.com", + "role": "admin" }' security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Invite responses: '200': description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AdminGiftCardsRes' '400': $ref: '#/components/responses/400_error' '401': @@ -4730,31 +5149,12 @@ paths: '500': $ref: '#/components/responses/500_error' get: - operationId: GetGiftCards - summary: List Gift Cards - description: Retrieves a list of Gift Cards. + operationId: GetInvites + summary: Lists Invites + description: Lists all Invites 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 @@ -4766,30 +5166,30 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.list() + medusa.admin.invites.list() - .then(({ gift_cards, limit, offset, count }) => { - console.log(gift_cards.length); + .then(({ invites }) => { + console.log(invites.length); }); - lang: Shell label: cURL source: > - curl --location --request GET - 'https://medusa-url.com/admin/gift-cards' \ + curl --location --request GET 'https://medusa-url.com/admin/invites' + \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Invite responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/AdminGiftCardsListRes' + $ref: '#/components/schemas/AdminListInvitesRes' '400': $ref: '#/components/responses/400_error' '401': @@ -4802,17 +5202,17 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/gift-cards/{id}': + '/invites/{invite_id}': delete: - operationId: DeleteGiftCardsGiftCard - summary: Delete a Gift Card - description: Deletes a Gift Card + operationId: DeleteInvitesInvite + summary: Delete an Invite + description: Deletes an Invite x-authenticated: true parameters: - in: path - name: id + name: invite_id required: true - description: The ID of the Gift Card to delete. + description: The ID of the Invite schema: type: string x-codegen: @@ -4828,7 +5228,7 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.delete(gift_card_id) + medusa.admin.invites.delete(invite_id) .then(({ id, object, deleted }) => { console.log(id); @@ -4837,82 +5237,21 @@ paths: label: cURL source: > curl --location --request DELETE - 'https://medusa-url.com/admin/gift-cards/{id}' \ + 'https://medusa-url.com/admin/invites/{invite_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Invite 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' + $ref: '#/components/schemas/AdminInviteDeleteRes' '400': $ref: '#/components/responses/400_error' '401': @@ -4925,27 +5264,21 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/invites/{invite_id}/resend': post: - operationId: PostGiftCardsGiftCard - summary: Update a Gift Card - description: >- - Update a Gift Card that can redeemed by its unique code. The Gift Card - is only valid within 1 region. + operationId: PostInvitesInviteResend + summary: Resend an Invite + description: Resends an Invite by triggering the 'invite' created event again x-authenticated: true parameters: - in: path - name: id + name: invite_id required: true - description: The ID of the Gift Card. + description: The ID of the Invite schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' x-codegen: - method: update + method: resend x-codeSamples: - lang: JavaScript label: JS Client @@ -4957,38 +5290,30 @@ paths: // must be previously logged in or use api token - medusa.admin.giftCards.update(gift_card_id, { - region_id + medusa.admin.invites.resend(invite_id) + + .then(() => { + // successful }) - .then(({ gift_card }) => { - console.log(gift_card.id); + .catch(() => { + // an error occurred }); - lang: Shell label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/gift-cards/{id}' \ + 'https://medusa-url.com/admin/invites/{invite_id}/resend' \ - --header 'Authorization: Bearer {api_token}' \ - - --header 'Content-Type: application/json' \ - - --data-raw '{ - "region_id": "{region_id}" - }' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Gift Card + - Invite responses: '200': description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AdminGiftCardsRes' '400': $ref: '#/components/responses/400_error' '401': @@ -5695,331 +6020,6 @@ paths: $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 @@ -7336,6 +7336,468 @@ paths: $ref: '#/components/responses/not_found_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' '/orders/{id}/shipping-methods': post: operationId: PostOrdersOrderShippingMethods @@ -9565,468 +10027,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}': - delete: - operationId: DeletePaymentCollectionsPaymentCollection - summary: Del a PaymentCollection - description: Deletes a Payment Collection - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collection to delete. - schema: - type: string - x-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 @@ -11048,604 +11048,6 @@ paths: $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 @@ -13231,6 +12633,604 @@ paths: $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' '/publishable-api-keys/{id}/sales-channels/batch': post: operationId: PostPublishableApiKeySalesChannelsChannelsBatch @@ -13870,6 +13870,394 @@ paths: $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' '/regions/{id}/countries': post: operationId: PostRegionsRegionCountries @@ -14749,394 +15137,6 @@ paths: $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 @@ -15458,221 +15458,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/returns/{id}/cancel': - post: - operationId: PostReturnsReturnCancel - summary: Cancel a Return - description: Registers a Return as canceled. - 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 @@ -16430,6 +16215,221 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/returns/{id}/cancel': + post: + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. + 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' /shipping-options: post: operationId: PostShippingOptions @@ -17553,6 +17553,135 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/swaps/{id}': + get: + operationId: GetSwapsSwap + summary: Get a Swap + description: Retrieves a Swap. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Swap. + schema: + type: string + x-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' '/store/currencies/{code}': post: operationId: PostStoreCurrenciesCode @@ -17912,135 +18041,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/swaps/{id}': - get: - operationId: GetSwapsSwap - summary: Get a Swap - description: Retrieves a Swap. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Swap. - schema: - type: string - x-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 @@ -27478,6 +27478,89 @@ components: metadata: description: An optional set of key-value pairs to hold additional information. type: object + AdminPostCustomersReq: + type: object + required: + - email + - first_name + - last_name + - password + properties: + email: + type: string + description: The customer's email. + format: email + first_name: + type: string + description: The customer's first name. + last_name: + type: string + description: The customer's last name. + password: + type: string + description: The customer's password. + format: password + phone: + type: string + description: The customer's phone number. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + 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 AdminCurrenciesListRes: type: object properties: @@ -27592,89 +27675,6 @@ components: 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: @@ -28103,6 +28103,85 @@ components: metadata: description: An object containing metadata of the discount type: object + AdminPostGiftCardsReq: + type: object + required: + - region_id + properties: + value: + type: integer + description: The value (excluding VAT) that the Gift Card should represent. + is_disabled: + type: boolean + description: >- + Whether the Gift Card is disabled on creation. You will have to + enable it later to make it available to Customers. + ends_at: + type: string + format: date-time + description: The time at which the Gift Card should no longer be available. + region_id: + description: The ID of the Region in which the Gift Card can be used. + type: string + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + 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 AdminPostDraftOrdersReq: type: object required: @@ -28325,85 +28404,71 @@ components: The optional key-value map with additional details about the Line Item. type: object - AdminPostGiftCardsReq: + AdminPostInvitesInviteAcceptReq: type: object required: - - region_id + - token + - user 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: + token: + description: The invite token provided by the admin. 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. + user: + description: The User to create. type: object - AdminGiftCardsRes: + 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: - gift_card: - $ref: '#/components/schemas/GiftCard' - AdminGiftCardsDeleteRes: + 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 Gift Card + description: The ID of the deleted Invite. object: type: string description: The type of the object that was deleted. - default: gift-card + default: invite deleted: type: boolean - description: Whether the gift card was deleted successfully or not. + description: Whether or not the Invite was deleted. default: true - AdminGiftCardsListRes: + AdminListInvitesRes: type: object properties: - gift_cards: + invites: 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 + $ref: '#/components/schemas/Invite' AdminPostInventoryItemsItemLocationLevelsReq: type: object required: @@ -28558,71 +28623,6 @@ components: 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: @@ -28791,6 +28791,59 @@ components: internal_note: description: An optional note to create or update for the order edit. type: string + 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 AdminPostOrdersOrderShippingMethodsReq: type: object required: @@ -29356,59 +29409,6 @@ components: 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: @@ -29723,113 +29723,6 @@ components: 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: @@ -30681,6 +30574,113 @@ components: value: description: The value to give for the Product Option. type: string + 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 AdminPostPublishableApiKeySalesChannelsBatchReq: type: object required: @@ -30769,6 +30769,41 @@ components: title: description: A title to update for the key. 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 AdminPostRegionsRegionCountriesReq: type: object required: @@ -30954,41 +30989,6 @@ components: 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: @@ -31055,55 +31055,6 @@ components: 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: @@ -31227,6 +31178,55 @@ components: is_disabled: type: boolean description: Indication of if the sales channel is active. + 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 AdminPostShippingOptionsReq: type: object required: @@ -31505,6 +31505,27 @@ components: car: white address: $ref: '#/components/schemas/StockLocationAddressInput' + 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' AdminStoresRes: type: object properties: @@ -31559,27 +31580,6 @@ components: 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: diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index 9d6f435924..2089e9a46b 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -1455,6 +1455,282 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminCurrenciesRes' + /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' /customer-groups/{id}/customers/batch: post: operationId: PostCustomerGroupsGroupCustomersBatch @@ -2087,282 +2363,6 @@ paths: $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 @@ -4405,6 +4405,289 @@ paths: $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' /inventory-items/{id}/location-levels: post: operationId: PostInventoryItemsInventoryItemLocationLevels @@ -5023,140 +5306,63 @@ paths: $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' + /notifications: get: - operationId: GetInvites - summary: Lists Invites - description: Lists all Invites + 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 @@ -5164,27 +5370,27 @@ paths: import Medusa from "@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); + medusa.admin.notifications.list() + .then(({ notifications }) => { + console.log(notifications.length); }); - lang: Shell label: cURL source: | - curl --location --request GET 'https://medusa-url.com/admin/invites' \ + curl --location --request GET 'https://medusa-url.com/admin/notifications' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Invite + - Notification responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/AdminListInvitesRes' + $ref: '#/components/schemas/AdminNotificationsListRes' '400': $ref: '#/components/responses/400_error' '401': @@ -5197,74 +5403,24 @@ paths: $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: + /notifications/{id}/resend: post: - operationId: PostInvitesInviteResend - summary: Resend an Invite - description: Resends an Invite by triggering the 'invite' created event again + 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: invite_id + name: id required: true - description: The ID of the Invite + description: The ID of the Notification schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' x-codegen: method: resend x-codeSamples: @@ -5274,26 +5430,27 @@ paths: import Medusa from "@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 + 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/invites/{invite_id}/resend' \ + curl --location --request POST 'https://medusa-url.com/admin/notifications/{id}/resend' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] tags: - - Invite + - Notification responses: '200': description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminNotificationsRes' '400': $ref: '#/components/responses/400_error' '401': @@ -5609,163 +5766,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /notifications: - get: - operationId: GetNotifications - summary: List Notifications - description: Retrieves a list of Notifications. - 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 @@ -6476,6 +6476,238 @@ paths: $ref: '#/components/responses/not_found_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' /orders/{id}/shipping-methods: post: operationId: PostOrdersOrderShippingMethods @@ -8454,238 +8686,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /payment-collections/{id}: - delete: - operationId: DeletePaymentCollectionsPaymentCollection - summary: Del a PaymentCollection - description: Deletes a Payment Collection - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The ID of the Payment Collection to delete. - schema: - type: string - x-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 @@ -9789,534 +9789,6 @@ paths: $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 @@ -11761,6 +11233,534 @@ paths: $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' /publishable-api-keys/{id}/sales-channels/batch: post: operationId: PostPublishableApiKeySalesChannelsChannelsBatch @@ -13722,196 +13722,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /returns/{id}/cancel: - post: - operationId: PostReturnsReturnCancel - summary: Cancel a Return - description: Registers a Return as canceled. - 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 @@ -14586,6 +14396,196 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /returns/{id}/cancel: + post: + operationId: PostReturnsReturnCancel + summary: Cancel a Return + description: Registers a Return as canceled. + 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' /shipping-options: post: operationId: PostShippingOptions @@ -15589,323 +15589,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /store/currencies/{code}: - post: - operationId: PostStoreCurrenciesCode - summary: Add a Currency Code - description: Adds a Currency Code to the available currencies. - 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 @@ -16971,6 +16654,323 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /store/currencies/{code}: + post: + operationId: PostStoreCurrenciesCode + summary: Add a Currency Code + description: Adds a Currency Code to the available currencies. + 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' /uploads/protected: post: operationId: PostUploadsProtected @@ -18431,12 +18431,12 @@ components: payment_session: description: The selected payment session in the cart. nullable: true - $ref: '#/components/schemas/PaymentSession' + type: object payment_sessions: description: The payment sessions created on the cart. type: array items: - $ref: '#/components/schemas/PaymentSession' + type: object payment_id: description: The payment's ID if available nullable: true @@ -18580,7 +18580,7 @@ components: claim_item: description: A claim item object. Available if the relation `claim_item` is expanded. nullable: true - $ref: '#/components/schemas/ClaimItem' + type: object url: description: The URL of the image type: string @@ -18921,7 +18921,7 @@ components: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: '#/components/schemas/Region' + type: object Currency: title: Currency description: Currency @@ -19037,12 +19037,12 @@ components: description: The customers that belong to the customer group. Available if the relation `customers` is expanded. type: array items: - $ref: '#/components/schemas/Customer' + 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: '#/components/schemas/PriceList' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -19487,7 +19487,7 @@ components: 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' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -19561,7 +19561,7 @@ components: parent_discount: description: Available if the relation `parent_discount` is expanded. nullable: true - $ref: '#/components/schemas/Discount' + type: object starts_at: description: The time at which the discount can be used. type: string @@ -19717,7 +19717,7 @@ components: fulfillment: description: A fulfillment object. Available if the relation `fulfillment` is expanded. nullable: true - $ref: '#/components/schemas/Fulfillment' + type: object item: description: Available if the relation `item` is expanded. nullable: true @@ -20190,7 +20190,7 @@ components: item: description: Available if the relation `item` is expanded. nullable: true - $ref: '#/components/schemas/LineItem' + type: object description: description: The line item's adjustment description type: string @@ -20252,7 +20252,7 @@ components: item: description: Available if the relation `item` is expanded. nullable: true - $ref: '#/components/schemas/LineItem' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -20531,7 +20531,7 @@ components: price_list: description: Available if the relation `price_list` is expanded. nullable: true - $ref: '#/components/schemas/PriceList' + type: object variant_id: description: The id of the Product Variant contained in the Line Item. nullable: true @@ -20540,7 +20540,7 @@ components: variant: description: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. nullable: true - $ref: '#/components/schemas/ProductVariant' + type: object region_id: description: The region's ID nullable: true @@ -20549,7 +20549,7 @@ components: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: '#/components/schemas/Region' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -20697,12 +20697,12 @@ components: parent_notification: description: Available if the relation `parent_notification` is expanded. nullable: true - $ref: '#/components/schemas/Notification' + type: object 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' + type: object provider_id: description: The id of the Notification Provider that handles the Notification. nullable: true @@ -20942,7 +20942,7 @@ components: order_edit: description: Available if the relation `order_edit` is expanded. nullable: true - $ref: '#/components/schemas/OrderEdit' + type: object original_line_item_id: description: The ID of the original line item in the order nullable: true @@ -21698,7 +21698,7 @@ components: description: Available if the relation `category_children` are expanded. type: array items: - $ref: '#/components/schemas/ProductCategory' + type: object parent_category_id: description: The ID of the parent category. nullable: true @@ -21707,12 +21707,12 @@ components: parent_category: description: A product category object. Available if the relation `parent_category` is expanded. nullable: true - $ref: '#/components/schemas/ProductCategory' + type: object products: description: Products associated with category. Available if the relation `products` is expanded. type: array items: - $ref: '#/components/schemas/Product' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -21756,7 +21756,7 @@ components: description: The Products contained in the Product Collection. Available if the relation `products` is expanded. type: array items: - $ref: '#/components/schemas/Product' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -21805,7 +21805,7 @@ components: option: description: Available if the relation `option` is expanded. nullable: true - $ref: '#/components/schemas/ProductOption' + type: object variant_id: description: The ID of the Product Variant that the Product Option Value is defined for. type: string @@ -21813,7 +21813,7 @@ components: variant: description: Available if the relation `variant` is expanded. nullable: true - $ref: '#/components/schemas/ProductVariant' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -21866,7 +21866,7 @@ components: product: description: A product object. Available if the relation `product` is expanded. nullable: true - $ref: '#/components/schemas/Product' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -22072,7 +22072,7 @@ components: variant: description: A ProductVariant object. Available if the relation `variant` is expanded. nullable: true - $ref: '#/components/schemas/ProductVariant' + type: object required_quantity: description: The quantity of an inventory item required for one quantity of the variant. type: integer @@ -22133,7 +22133,7 @@ components: product: description: A product object. Available if the relation `product` is expanded. nullable: true - $ref: '#/components/schemas/Product' + 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 @@ -22709,7 +22709,7 @@ components: return_order: description: Available if the relation `return_order` is expanded. nullable: true - $ref: '#/components/schemas/Return' + type: object item: description: Available if the relation `item` is expanded. nullable: true @@ -22792,10 +22792,10 @@ components: parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. nullable: true - $ref: '#/components/schemas/ReturnReason' + type: object return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/ReturnReason' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -22955,7 +22955,7 @@ components: 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' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -23055,7 +23055,7 @@ components: shipping_method: description: Available if the relation `shipping_method` is expanded. nullable: true - $ref: '#/components/schemas/ShippingMethod' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -23193,7 +23193,7 @@ components: shipping_option: description: Available if the relation `shipping_option` is expanded. nullable: true - $ref: '#/components/schemas/ShippingOption' + 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 @@ -23245,7 +23245,7 @@ components: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: '#/components/schemas/Region' + 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 @@ -23347,12 +23347,12 @@ components: 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' + 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: - $ref: '#/components/schemas/ShippingOption' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -23771,7 +23771,7 @@ components: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: '#/components/schemas/Region' + type: object products: description: The products that belong to this tax rate. Available if the relation `products` is expanded. type: array @@ -23848,7 +23848,7 @@ components: fulfillment: description: Available if the relation `fulfillment` is expanded. nullable: true - $ref: '#/components/schemas/Fulfillment' + type: object idempotency_key: description: Randomly generated key used to continue the completion of a process in case of failure. nullable: true @@ -24566,6 +24566,89 @@ components: includes_tax: type: boolean description: '[EXPERIMENTAL] Tax included in prices of currency.' + AdminPostCustomersReq: + type: object + required: + - email + - first_name + - last_name + - password + properties: + email: + type: string + description: The customer's email. + format: email + first_name: + type: string + description: The customer's first name. + last_name: + type: string + description: The customer's last name. + password: + type: string + description: The customer's password. + format: password + phone: + type: string + description: The customer's phone number. + metadata: + description: An optional set of key-value pairs to hold additional information. + type: object + 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 AdminPostCustomerGroupsGroupCustomersBatchReq: type: object required: @@ -24653,89 +24736,6 @@ components: 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: @@ -25390,6 +25390,71 @@ components: metadata: description: An optional set of key-value pairs to hold additional information. type: object + AdminPostInvitesInviteAcceptReq: + type: object + required: + - token + - user + properties: + token: + description: The invite token provided by the admin. + type: string + user: + description: The User to create. + type: object + required: + - first_name + - last_name + - password + properties: + first_name: + type: string + description: the first name of the User + last_name: + type: string + description: the last name of the User + password: + description: The desired password for the User + type: string + format: password + AdminPostInvitesReq: + type: object + required: + - user + - role + properties: + user: + description: The email for the user to be created. + type: string + format: email + role: + description: The role of the user to be created. + type: string + enum: + - admin + - member + - developer + 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' AdminPostInventoryItemsItemLocationLevelsReq: type: object required: @@ -25518,71 +25583,24 @@ components: 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: + AdminNotificationsListRes: 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: + notifications: type: array items: - $ref: '#/components/schemas/Invite' + $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 AdminPostNotesReq: type: object required: @@ -25642,24 +25660,6 @@ components: 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: @@ -25749,6 +25749,34 @@ components: internal_note: description: An optional note to create or update for the order edit. type: string + 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 AdminPostOrdersOrderShippingMethodsReq: type: object required: @@ -26278,34 +26306,6 @@ components: 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: @@ -26631,111 +26631,6 @@ components: 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: @@ -27540,6 +27435,111 @@ components: value: description: The value to give for the Product Option. type: string + 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 AdminPostPublishableApiKeySalesChannelsBatchReq: type: object required: @@ -27895,55 +27895,6 @@ components: 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: @@ -28067,6 +28018,55 @@ components: is_disabled: type: boolean description: Indication of if the sales channel is active. + 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 AdminPostShippingOptionsReq: type: object required: @@ -28335,54 +28335,6 @@ components: 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: @@ -28563,6 +28515,54 @@ components: description: The IDs of the types of products associated with this tax rate items: type: string + 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 AdminDeleteUploadsReq: type: object required: 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/FulfillmentItem.yaml b/docs/api/admin/components/schemas/FulfillmentItem.yaml index b5c18ab5a0..ad05c5637e 100644 --- a/docs/api/admin/components/schemas/FulfillmentItem.yaml +++ b/docs/api/admin/components/schemas/FulfillmentItem.yaml @@ -19,7 +19,7 @@ properties: fulfillment: description: A fulfillment object. Available if the relation `fulfillment` is expanded. nullable: true - $ref: ./Fulfillment.yaml + type: object item: description: Available if the relation `item` is expanded. nullable: true diff --git a/docs/api/admin/components/schemas/LineItemAdjustment.yaml b/docs/api/admin/components/schemas/LineItemAdjustment.yaml index c09a889751..fe1b9049e8 100644 --- a/docs/api/admin/components/schemas/LineItemAdjustment.yaml +++ b/docs/api/admin/components/schemas/LineItemAdjustment.yaml @@ -20,7 +20,7 @@ properties: item: description: Available if the relation `item` is expanded. nullable: true - $ref: ./LineItem.yaml + type: object description: description: The line item's adjustment description type: string diff --git a/docs/api/admin/components/schemas/LineItemTaxLine.yaml b/docs/api/admin/components/schemas/LineItemTaxLine.yaml index d54058d667..ec316b7cb7 100644 --- a/docs/api/admin/components/schemas/LineItemTaxLine.yaml +++ b/docs/api/admin/components/schemas/LineItemTaxLine.yaml @@ -35,7 +35,7 @@ properties: item: description: Available if the relation `item` is expanded. nullable: true - $ref: ./LineItem.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/MoneyAmount.yaml b/docs/api/admin/components/schemas/MoneyAmount.yaml index b133bf20c9..f2b78adabf 100644 --- a/docs/api/admin/components/schemas/MoneyAmount.yaml +++ b/docs/api/admin/components/schemas/MoneyAmount.yaml @@ -62,7 +62,7 @@ properties: price_list: description: Available if the relation `price_list` is expanded. nullable: true - $ref: ./PriceList.yaml + type: object variant_id: description: The id of the Product Variant contained in the Line Item. nullable: true @@ -73,7 +73,7 @@ properties: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. nullable: true - $ref: ./ProductVariant.yaml + type: object region_id: description: The region's ID nullable: true @@ -82,7 +82,7 @@ properties: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: ./Region.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/Notification.yaml b/docs/api/admin/components/schemas/Notification.yaml index 35831578b7..13eca79f77 100644 --- a/docs/api/admin/components/schemas/Notification.yaml +++ b/docs/api/admin/components/schemas/Notification.yaml @@ -64,14 +64,14 @@ properties: parent_notification: description: Available if the relation `parent_notification` is expanded. nullable: true - $ref: ./Notification.yaml + type: object resends: description: >- The resends that have been completed after the original Notification. Available if the relation `resends` is expanded. type: array items: - $ref: ./Notification.yaml + type: object provider_id: description: The id of the Notification Provider that handles the Notification. nullable: true diff --git a/docs/api/admin/components/schemas/OrderItemChange.yaml b/docs/api/admin/components/schemas/OrderItemChange.yaml index 8a079488f0..31a0435da5 100644 --- a/docs/api/admin/components/schemas/OrderItemChange.yaml +++ b/docs/api/admin/components/schemas/OrderItemChange.yaml @@ -29,7 +29,7 @@ properties: order_edit: description: Available if the relation `order_edit` is expanded. nullable: true - $ref: ./OrderEdit.yaml + type: object original_line_item_id: description: The ID of the original line item in the order nullable: true diff --git a/docs/api/admin/components/schemas/ProductCategory.yaml b/docs/api/admin/components/schemas/ProductCategory.yaml index c084d5c8e5..9d15054cd5 100644 --- a/docs/api/admin/components/schemas/ProductCategory.yaml +++ b/docs/api/admin/components/schemas/ProductCategory.yaml @@ -48,7 +48,7 @@ properties: description: Available if the relation `category_children` are expanded. type: array items: - $ref: ./ProductCategory.yaml + type: object parent_category_id: description: The ID of the parent category. nullable: true @@ -59,14 +59,14 @@ properties: A product category object. Available if the relation `parent_category` is expanded. nullable: true - $ref: ./ProductCategory.yaml + type: object products: description: >- Products associated with category. Available if the relation `products` is expanded. type: array items: - $ref: ./Product.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/ProductCollection.yaml b/docs/api/admin/components/schemas/ProductCollection.yaml index 583d648214..f53db55c2d 100644 --- a/docs/api/admin/components/schemas/ProductCollection.yaml +++ b/docs/api/admin/components/schemas/ProductCollection.yaml @@ -31,7 +31,7 @@ properties: relation `products` is expanded. type: array items: - $ref: ./Product.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/ProductOption.yaml b/docs/api/admin/components/schemas/ProductOption.yaml index 545886429c..3de3f509d9 100644 --- a/docs/api/admin/components/schemas/ProductOption.yaml +++ b/docs/api/admin/components/schemas/ProductOption.yaml @@ -35,7 +35,7 @@ properties: product: description: A product object. Available if the relation `product` is expanded. nullable: true - $ref: ./Product.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/ProductOptionValue.yaml b/docs/api/admin/components/schemas/ProductOptionValue.yaml index a983ec50b1..b247b13506 100644 --- a/docs/api/admin/components/schemas/ProductOptionValue.yaml +++ b/docs/api/admin/components/schemas/ProductOptionValue.yaml @@ -31,7 +31,7 @@ properties: option: description: Available if the relation `option` is expanded. nullable: true - $ref: ./ProductOption.yaml + type: object variant_id: description: >- The ID of the Product Variant that the Product Option Value is defined @@ -41,7 +41,7 @@ properties: variant: description: Available if the relation `variant` is expanded. nullable: true - $ref: ./ProductVariant.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/ProductVariant.yaml b/docs/api/admin/components/schemas/ProductVariant.yaml index 2995f2f1bf..7f9d451c41 100644 --- a/docs/api/admin/components/schemas/ProductVariant.yaml +++ b/docs/api/admin/components/schemas/ProductVariant.yaml @@ -45,7 +45,7 @@ properties: product: description: A product object. Available if the relation `product` is expanded. nullable: true - $ref: ./Product.yaml + type: object prices: description: >- The Money Amounts defined for the Product Variant. Each Money Amount diff --git a/docs/api/admin/components/schemas/ProductVariantInventoryItem.yaml b/docs/api/admin/components/schemas/ProductVariantInventoryItem.yaml index 3809f33d7c..d2f658ecfb 100644 --- a/docs/api/admin/components/schemas/ProductVariantInventoryItem.yaml +++ b/docs/api/admin/components/schemas/ProductVariantInventoryItem.yaml @@ -25,7 +25,7 @@ properties: variant: description: A ProductVariant object. Available if the relation `variant` is expanded. nullable: true - $ref: ./ProductVariant.yaml + type: object required_quantity: description: >- The quantity of an inventory item required for one quantity of the diff --git a/docs/api/admin/components/schemas/ReturnItem.yaml b/docs/api/admin/components/schemas/ReturnItem.yaml index f4d009098f..f2e6e78b7a 100644 --- a/docs/api/admin/components/schemas/ReturnItem.yaml +++ b/docs/api/admin/components/schemas/ReturnItem.yaml @@ -25,7 +25,7 @@ properties: return_order: description: Available if the relation `return_order` is expanded. nullable: true - $ref: ./Return.yaml + type: object item: description: Available if the relation `item` is expanded. nullable: true diff --git a/docs/api/admin/components/schemas/ReturnReason.yaml b/docs/api/admin/components/schemas/ReturnReason.yaml index c287143aee..37715c1fe9 100644 --- a/docs/api/admin/components/schemas/ReturnReason.yaml +++ b/docs/api/admin/components/schemas/ReturnReason.yaml @@ -39,10 +39,10 @@ properties: parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. nullable: true - $ref: ./ReturnReason.yaml + type: object return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: ./ReturnReason.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/SalesChannelLocation.yaml b/docs/api/admin/components/schemas/SalesChannelLocation.yaml index 9fd8efcabf..27ec4fd84b 100644 --- a/docs/api/admin/components/schemas/SalesChannelLocation.yaml +++ b/docs/api/admin/components/schemas/SalesChannelLocation.yaml @@ -25,7 +25,7 @@ properties: The sales channel the location is associated with. Available if the relation `sales_channel` is expanded. nullable: true - $ref: ./SalesChannel.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/ShippingMethodTaxLine.yaml b/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml index 5de5ab3d7e..d251624dca 100644 --- a/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml +++ b/docs/api/admin/components/schemas/ShippingMethodTaxLine.yaml @@ -35,7 +35,7 @@ properties: shipping_method: description: Available if the relation `shipping_method` is expanded. nullable: true - $ref: ./ShippingMethod.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/ShippingOption.yaml b/docs/api/admin/components/schemas/ShippingOption.yaml index 194f56631b..a8eebad545 100644 --- a/docs/api/admin/components/schemas/ShippingOption.yaml +++ b/docs/api/admin/components/schemas/ShippingOption.yaml @@ -40,7 +40,7 @@ properties: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: ./Region.yaml + type: object profile_id: description: >- The ID of the Shipping Profile that the shipping option belongs to. diff --git a/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml b/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml index 965a4ab138..57d045827c 100644 --- a/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml +++ b/docs/api/admin/components/schemas/ShippingOptionRequirement.yaml @@ -23,7 +23,7 @@ properties: shipping_option: description: Available if the relation `shipping_option` is expanded. nullable: true - $ref: ./ShippingOption.yaml + type: object type: description: >- The type of the requirement, this defines how the value will be compared diff --git a/docs/api/admin/components/schemas/ShippingProfile.yaml b/docs/api/admin/components/schemas/ShippingProfile.yaml index cfb05ba1a6..15ffd42c84 100644 --- a/docs/api/admin/components/schemas/ShippingProfile.yaml +++ b/docs/api/admin/components/schemas/ShippingProfile.yaml @@ -38,7 +38,7 @@ properties: Available if the relation `products` is expanded. type: array items: - $ref: ./Product.yaml + type: object shipping_options: description: >- The Shipping Options that can be used to fulfill the Products in the @@ -46,7 +46,7 @@ properties: expanded. type: array items: - $ref: ./ShippingOption.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/TaxRate.yaml b/docs/api/admin/components/schemas/TaxRate.yaml index 84093518d8..deb3f4d02e 100644 --- a/docs/api/admin/components/schemas/TaxRate.yaml +++ b/docs/api/admin/components/schemas/TaxRate.yaml @@ -38,7 +38,7 @@ properties: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: ./Region.yaml + type: object products: description: >- The products that belong to this tax rate. Available if the relation diff --git a/docs/api/admin/components/schemas/TrackingLink.yaml b/docs/api/admin/components/schemas/TrackingLink.yaml index 0bfd92b516..eb8ccde118 100644 --- a/docs/api/admin/components/schemas/TrackingLink.yaml +++ b/docs/api/admin/components/schemas/TrackingLink.yaml @@ -35,7 +35,7 @@ properties: fulfillment: description: Available if the relation `fulfillment` is expanded. nullable: true - $ref: ./Fulfillment.yaml + type: object idempotency_key: description: >- Randomly generated key used to continue the completion of a process in diff --git a/docs/api/admin/openapi.yaml b/docs/api/admin/openapi.yaml index df9e611bb6..eb6c23a7f1 100644 --- a/docs/api/admin/openapi.yaml +++ b/docs/api/admin/openapi.yaml @@ -197,6 +197,10 @@ paths: $ref: paths/currencies.yaml /currencies/{code}: $ref: paths/currencies_{code}.yaml + /customers: + $ref: paths/customers.yaml + /customers/{id}: + $ref: paths/customers_{id}.yaml /customer-groups/{id}/customers/batch: $ref: paths/customer-groups_{id}_customers_batch.yaml /customer-groups: @@ -205,10 +209,6 @@ paths: $ref: paths/customer-groups_{id}.yaml /customer-groups/{id}/customers: $ref: paths/customer-groups_{id}_customers.yaml - /customers: - $ref: paths/customers.yaml - /customers/{id}: - $ref: paths/customers_{id}.yaml /discounts/{id}/regions/{region_id}: $ref: paths/discounts_{id}_regions_{region_id}.yaml /discounts/{discount_id}/conditions/{condition_id}/batch: @@ -243,14 +243,6 @@ paths: $ref: paths/gift-cards.yaml /gift-cards/{id}: $ref: paths/gift-cards_{id}.yaml - /inventory-items/{id}/location-levels: - $ref: paths/inventory-items_{id}_location-levels.yaml - /inventory-items/{id}: - $ref: paths/inventory-items_{id}.yaml - /inventory-items/{id}/location-levels/{location_id}: - $ref: paths/inventory-items_{id}_location-levels_{location_id}.yaml - /inventory-items: - $ref: paths/inventory-items.yaml /invites/accept: $ref: paths/invites_accept.yaml /invites: @@ -259,14 +251,22 @@ paths: $ref: paths/invites_{invite_id}.yaml /invites/{invite_id}/resend: $ref: paths/invites_{invite_id}_resend.yaml - /notes: - $ref: paths/notes.yaml - /notes/{id}: - $ref: paths/notes_{id}.yaml + /inventory-items/{id}/location-levels: + $ref: paths/inventory-items_{id}_location-levels.yaml + /inventory-items/{id}: + $ref: paths/inventory-items_{id}.yaml + /inventory-items/{id}/location-levels/{location_id}: + $ref: paths/inventory-items_{id}_location-levels_{location_id}.yaml + /inventory-items: + $ref: paths/inventory-items.yaml /notifications: $ref: paths/notifications.yaml /notifications/{id}/resend: $ref: paths/notifications_{id}_resend.yaml + /notes: + $ref: paths/notes.yaml + /notes/{id}: + $ref: paths/notes_{id}.yaml /order-edits/{id}/items: $ref: paths/order-edits_{id}_items.yaml /order-edits/{id}/cancel: @@ -283,6 +283,10 @@ paths: $ref: paths/order-edits_{id}.yaml /order-edits/{id}/request: $ref: paths/order-edits_{id}_request.yaml + /payment-collections/{id}: + $ref: paths/payment-collections_{id}.yaml + /payment-collections/{id}/authorize: + $ref: paths/payment-collections_{id}_authorize.yaml /orders/{id}/shipping-methods: $ref: paths/orders_{id}_shipping-methods.yaml /orders/{id}/archive: @@ -337,10 +341,6 @@ paths: $ref: paths/orders_{id}_return.yaml /order/{id}/claims/{claim_id}: $ref: paths/order_{id}_claims_{claim_id}.yaml - /payment-collections/{id}: - $ref: paths/payment-collections_{id}.yaml - /payment-collections/{id}/authorize: - $ref: paths/payment-collections_{id}_authorize.yaml /payments/{id}/capture: $ref: paths/payments_{id}_capture.yaml /payments/{id}: @@ -359,12 +359,6 @@ paths: $ref: paths/price-lists_{id}_variants_{variant_id}_prices.yaml /price-lists/{id}/products: $ref: paths/price-lists_{id}_products.yaml - /product-categories/{id}/products/batch: - $ref: paths/product-categories_{id}_products_batch.yaml - /product-categories: - $ref: paths/product-categories.yaml - /product-categories/{id}: - $ref: paths/product-categories_{id}.yaml /product-tags: $ref: paths/product-tags.yaml /product-types: @@ -387,6 +381,12 @@ paths: $ref: paths/products_types.yaml /products/{id}/metadata: $ref: paths/products_{id}_metadata.yaml + /product-categories/{id}/products/batch: + $ref: paths/product-categories_{id}_products_batch.yaml + /product-categories: + $ref: paths/product-categories.yaml + /product-categories/{id}: + $ref: paths/product-categories_{id}.yaml /publishable-api-keys/{id}/sales-channels/batch: $ref: paths/publishable-api-keys_{id}_sales-channels_batch.yaml /publishable-api-keys: @@ -425,12 +425,6 @@ paths: $ref: paths/return-reasons.yaml /return-reasons/{id}: $ref: paths/return-reasons_{id}.yaml - /returns/{id}/cancel: - $ref: paths/returns_{id}_cancel.yaml - /returns: - $ref: paths/returns.yaml - /returns/{id}/receive: - $ref: paths/returns_{id}_receive.yaml /sales-channels/{id}/products/batch: $ref: paths/sales-channels_{id}_products_batch.yaml /sales-channels/{id}/stock-locations: @@ -439,6 +433,12 @@ paths: $ref: paths/sales-channels.yaml /sales-channels/{id}: $ref: paths/sales-channels_{id}.yaml + /returns/{id}/cancel: + $ref: paths/returns_{id}_cancel.yaml + /returns: + $ref: paths/returns.yaml + /returns/{id}/receive: + $ref: paths/returns_{id}_receive.yaml /shipping-options: $ref: paths/shipping-options.yaml /shipping-options/{id}: @@ -451,14 +451,6 @@ paths: $ref: paths/stock-locations.yaml /stock-locations/{id}: $ref: paths/stock-locations_{id}.yaml - /store/currencies/{code}: - $ref: paths/store_currencies_{code}.yaml - /store: - $ref: paths/store.yaml - /store/payment-providers: - $ref: paths/store_payment-providers.yaml - /store/tax-providers: - $ref: paths/store_tax-providers.yaml /swaps/{id}: $ref: paths/swaps_{id}.yaml /swaps: @@ -473,6 +465,14 @@ paths: $ref: paths/tax-rates.yaml /tax-rates/{id}: $ref: paths/tax-rates_{id}.yaml + /store/currencies/{code}: + $ref: paths/store_currencies_{code}.yaml + /store: + $ref: paths/store.yaml + /store/payment-providers: + $ref: paths/store_payment-providers.yaml + /store/tax-providers: + $ref: paths/store_tax-providers.yaml /uploads/protected: $ref: paths/uploads_protected.yaml /uploads: diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index d3f1d52678..6e5cd0fcc5 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -1170,6 +1170,551 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/gift-cards/{code}': + get: + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated 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' '/collections/{id}': get: operationId: GetCollectionsCollection @@ -2160,551 +2705,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/gift-cards/{code}': - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated 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 @@ -3131,307 +3131,6 @@ paths: $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 @@ -4215,6 +3914,307 @@ paths: $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' /returns: post: operationId: PostReturns @@ -12148,6 +12148,45 @@ components: data: type: object description: The data to update the payment session with. + 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 StoreCollectionsListRes: type: object properties: @@ -12308,45 +12347,6 @@ components: 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: @@ -12401,27 +12401,6 @@ components: 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: @@ -12491,6 +12470,27 @@ components: properties: return_reason: $ref: '#/components/schemas/ReturnReason' + 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 StorePostReturnsReq: type: object required: diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index a415da6ed5..1b5126c08a 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -262,6 +262,151 @@ paths: $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' /carts/{id}/shipping-methods: post: operationId: PostCartsCartShippingMethod @@ -998,16 +1143,16 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /collections/{id}: + /gift-cards/{code}: get: - operationId: GetCollectionsCollection - summary: Get a Collection - description: Retrieves a Product Collection. + operationId: GetGiftCardsCode + summary: Get Gift Card by Code + description: Retrieves a Gift Card by its associated unique code. parameters: - in: path - name: id + name: code required: true - description: The id of the Product Collection + description: The unique Gift Card code. schema: type: string x-codegen: @@ -1018,121 +1163,23 @@ paths: 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); + 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/collections/{id}' + curl --location --request GET 'https://medusa-url.com/store/gift-cards/{code}' tags: - - Collection + - Gift Card 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' + $ref: '#/components/schemas/StoreGiftCardsRes' '400': $ref: '#/components/responses/400_error' '404': @@ -1882,53 +1929,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /gift-cards/{code}: - get: - operationId: GetGiftCardsCode - summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated 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 @@ -4867,12 +4867,12 @@ components: payment_session: description: The selected payment session in the cart. nullable: true - $ref: '#/components/schemas/PaymentSession' + type: object payment_sessions: description: The payment sessions created on the cart. type: array items: - $ref: '#/components/schemas/PaymentSession' + type: object payment_id: description: The payment's ID if available nullable: true @@ -5016,7 +5016,7 @@ components: claim_item: description: A claim item object. Available if the relation `claim_item` is expanded. nullable: true - $ref: '#/components/schemas/ClaimItem' + type: object url: description: The URL of the image type: string @@ -5357,7 +5357,7 @@ components: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: '#/components/schemas/Region' + type: object Currency: title: Currency description: Currency @@ -5473,12 +5473,12 @@ components: description: The customers that belong to the customer group. Available if the relation `customers` is expanded. type: array items: - $ref: '#/components/schemas/Customer' + 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: '#/components/schemas/PriceList' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -5923,7 +5923,7 @@ components: 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' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -5997,7 +5997,7 @@ components: parent_discount: description: Available if the relation `parent_discount` is expanded. nullable: true - $ref: '#/components/schemas/Discount' + type: object starts_at: description: The time at which the discount can be used. type: string @@ -6153,7 +6153,7 @@ components: fulfillment: description: A fulfillment object. Available if the relation `fulfillment` is expanded. nullable: true - $ref: '#/components/schemas/Fulfillment' + type: object item: description: Available if the relation `item` is expanded. nullable: true @@ -6626,7 +6626,7 @@ components: item: description: Available if the relation `item` is expanded. nullable: true - $ref: '#/components/schemas/LineItem' + type: object description: description: The line item's adjustment description type: string @@ -6688,7 +6688,7 @@ components: item: description: Available if the relation `item` is expanded. nullable: true - $ref: '#/components/schemas/LineItem' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -6967,7 +6967,7 @@ components: price_list: description: Available if the relation `price_list` is expanded. nullable: true - $ref: '#/components/schemas/PriceList' + type: object variant_id: description: The id of the Product Variant contained in the Line Item. nullable: true @@ -6976,7 +6976,7 @@ components: variant: description: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. nullable: true - $ref: '#/components/schemas/ProductVariant' + type: object region_id: description: The region's ID nullable: true @@ -6985,7 +6985,7 @@ components: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: '#/components/schemas/Region' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -7133,12 +7133,12 @@ components: parent_notification: description: Available if the relation `parent_notification` is expanded. nullable: true - $ref: '#/components/schemas/Notification' + type: object 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' + type: object provider_id: description: The id of the Notification Provider that handles the Notification. nullable: true @@ -7378,7 +7378,7 @@ components: order_edit: description: Available if the relation `order_edit` is expanded. nullable: true - $ref: '#/components/schemas/OrderEdit' + type: object original_line_item_id: description: The ID of the original line item in the order nullable: true @@ -8134,7 +8134,7 @@ components: description: Available if the relation `category_children` are expanded. type: array items: - $ref: '#/components/schemas/ProductCategory' + type: object parent_category_id: description: The ID of the parent category. nullable: true @@ -8143,12 +8143,12 @@ components: parent_category: description: A product category object. Available if the relation `parent_category` is expanded. nullable: true - $ref: '#/components/schemas/ProductCategory' + type: object products: description: Products associated with category. Available if the relation `products` is expanded. type: array items: - $ref: '#/components/schemas/Product' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -8192,7 +8192,7 @@ components: description: The Products contained in the Product Collection. Available if the relation `products` is expanded. type: array items: - $ref: '#/components/schemas/Product' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -8241,7 +8241,7 @@ components: option: description: Available if the relation `option` is expanded. nullable: true - $ref: '#/components/schemas/ProductOption' + type: object variant_id: description: The ID of the Product Variant that the Product Option Value is defined for. type: string @@ -8249,7 +8249,7 @@ components: variant: description: Available if the relation `variant` is expanded. nullable: true - $ref: '#/components/schemas/ProductVariant' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -8302,7 +8302,7 @@ components: product: description: A product object. Available if the relation `product` is expanded. nullable: true - $ref: '#/components/schemas/Product' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -8508,7 +8508,7 @@ components: variant: description: A ProductVariant object. Available if the relation `variant` is expanded. nullable: true - $ref: '#/components/schemas/ProductVariant' + type: object required_quantity: description: The quantity of an inventory item required for one quantity of the variant. type: integer @@ -8569,7 +8569,7 @@ components: product: description: A product object. Available if the relation `product` is expanded. nullable: true - $ref: '#/components/schemas/Product' + 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 @@ -9145,7 +9145,7 @@ components: return_order: description: Available if the relation `return_order` is expanded. nullable: true - $ref: '#/components/schemas/Return' + type: object item: description: Available if the relation `item` is expanded. nullable: true @@ -9228,10 +9228,10 @@ components: parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. nullable: true - $ref: '#/components/schemas/ReturnReason' + type: object return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: '#/components/schemas/ReturnReason' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -9391,7 +9391,7 @@ components: 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' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -9491,7 +9491,7 @@ components: shipping_method: description: Available if the relation `shipping_method` is expanded. nullable: true - $ref: '#/components/schemas/ShippingMethod' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -9629,7 +9629,7 @@ components: shipping_option: description: Available if the relation `shipping_option` is expanded. nullable: true - $ref: '#/components/schemas/ShippingOption' + 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 @@ -9681,7 +9681,7 @@ components: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: '#/components/schemas/Region' + 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 @@ -9783,12 +9783,12 @@ components: 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' + 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: - $ref: '#/components/schemas/ShippingOption' + type: object created_at: description: The date with timezone at which the resource was created. type: string @@ -10207,7 +10207,7 @@ components: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: '#/components/schemas/Region' + type: object products: description: The products that belong to this tax rate. Available if the relation `products` is expanded. type: array @@ -10284,7 +10284,7 @@ components: fulfillment: description: Available if the relation `fulfillment` is expanded. nullable: true - $ref: '#/components/schemas/Fulfillment' + type: object idempotency_key: description: Randomly generated key used to continue the completion of a process in case of failure. nullable: true @@ -10798,6 +10798,27 @@ components: exists: type: boolean description: Whether email exists or not. + 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' StorePostCartsCartShippingMethodReq: type: object required: @@ -10964,27 +10985,11 @@ components: data: type: object description: The data to update the payment session with. - StoreCollectionsListRes: + StoreGiftCardsRes: 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' + gift_card: + $ref: '#/components/schemas/GiftCard' StorePostCustomersCustomerAddressesReq: type: object required: @@ -11120,11 +11125,6 @@ components: metadata: description: Metadata about the customer. type: object - StoreGiftCardsRes: - type: object - properties: - gift_card: - $ref: '#/components/schemas/GiftCard' StorePostOrderEditsOrderEditDecline: type: object properties: 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/FulfillmentItem.yaml b/docs/api/store/components/schemas/FulfillmentItem.yaml index b5c18ab5a0..ad05c5637e 100644 --- a/docs/api/store/components/schemas/FulfillmentItem.yaml +++ b/docs/api/store/components/schemas/FulfillmentItem.yaml @@ -19,7 +19,7 @@ properties: fulfillment: description: A fulfillment object. Available if the relation `fulfillment` is expanded. nullable: true - $ref: ./Fulfillment.yaml + type: object item: description: Available if the relation `item` is expanded. nullable: true diff --git a/docs/api/store/components/schemas/LineItemAdjustment.yaml b/docs/api/store/components/schemas/LineItemAdjustment.yaml index c09a889751..fe1b9049e8 100644 --- a/docs/api/store/components/schemas/LineItemAdjustment.yaml +++ b/docs/api/store/components/schemas/LineItemAdjustment.yaml @@ -20,7 +20,7 @@ properties: item: description: Available if the relation `item` is expanded. nullable: true - $ref: ./LineItem.yaml + type: object description: description: The line item's adjustment description type: string diff --git a/docs/api/store/components/schemas/LineItemTaxLine.yaml b/docs/api/store/components/schemas/LineItemTaxLine.yaml index d54058d667..ec316b7cb7 100644 --- a/docs/api/store/components/schemas/LineItemTaxLine.yaml +++ b/docs/api/store/components/schemas/LineItemTaxLine.yaml @@ -35,7 +35,7 @@ properties: item: description: Available if the relation `item` is expanded. nullable: true - $ref: ./LineItem.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/MoneyAmount.yaml b/docs/api/store/components/schemas/MoneyAmount.yaml index b133bf20c9..f2b78adabf 100644 --- a/docs/api/store/components/schemas/MoneyAmount.yaml +++ b/docs/api/store/components/schemas/MoneyAmount.yaml @@ -62,7 +62,7 @@ properties: price_list: description: Available if the relation `price_list` is expanded. nullable: true - $ref: ./PriceList.yaml + type: object variant_id: description: The id of the Product Variant contained in the Line Item. nullable: true @@ -73,7 +73,7 @@ properties: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. nullable: true - $ref: ./ProductVariant.yaml + type: object region_id: description: The region's ID nullable: true @@ -82,7 +82,7 @@ properties: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: ./Region.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/Notification.yaml b/docs/api/store/components/schemas/Notification.yaml index 35831578b7..13eca79f77 100644 --- a/docs/api/store/components/schemas/Notification.yaml +++ b/docs/api/store/components/schemas/Notification.yaml @@ -64,14 +64,14 @@ properties: parent_notification: description: Available if the relation `parent_notification` is expanded. nullable: true - $ref: ./Notification.yaml + type: object resends: description: >- The resends that have been completed after the original Notification. Available if the relation `resends` is expanded. type: array items: - $ref: ./Notification.yaml + type: object provider_id: description: The id of the Notification Provider that handles the Notification. nullable: true diff --git a/docs/api/store/components/schemas/OrderItemChange.yaml b/docs/api/store/components/schemas/OrderItemChange.yaml index 8a079488f0..31a0435da5 100644 --- a/docs/api/store/components/schemas/OrderItemChange.yaml +++ b/docs/api/store/components/schemas/OrderItemChange.yaml @@ -29,7 +29,7 @@ properties: order_edit: description: Available if the relation `order_edit` is expanded. nullable: true - $ref: ./OrderEdit.yaml + type: object original_line_item_id: description: The ID of the original line item in the order nullable: true diff --git a/docs/api/store/components/schemas/ProductCategory.yaml b/docs/api/store/components/schemas/ProductCategory.yaml index c084d5c8e5..9d15054cd5 100644 --- a/docs/api/store/components/schemas/ProductCategory.yaml +++ b/docs/api/store/components/schemas/ProductCategory.yaml @@ -48,7 +48,7 @@ properties: description: Available if the relation `category_children` are expanded. type: array items: - $ref: ./ProductCategory.yaml + type: object parent_category_id: description: The ID of the parent category. nullable: true @@ -59,14 +59,14 @@ properties: A product category object. Available if the relation `parent_category` is expanded. nullable: true - $ref: ./ProductCategory.yaml + type: object products: description: >- Products associated with category. Available if the relation `products` is expanded. type: array items: - $ref: ./Product.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/ProductCollection.yaml b/docs/api/store/components/schemas/ProductCollection.yaml index 583d648214..f53db55c2d 100644 --- a/docs/api/store/components/schemas/ProductCollection.yaml +++ b/docs/api/store/components/schemas/ProductCollection.yaml @@ -31,7 +31,7 @@ properties: relation `products` is expanded. type: array items: - $ref: ./Product.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/ProductOption.yaml b/docs/api/store/components/schemas/ProductOption.yaml index 545886429c..3de3f509d9 100644 --- a/docs/api/store/components/schemas/ProductOption.yaml +++ b/docs/api/store/components/schemas/ProductOption.yaml @@ -35,7 +35,7 @@ properties: product: description: A product object. Available if the relation `product` is expanded. nullable: true - $ref: ./Product.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/ProductOptionValue.yaml b/docs/api/store/components/schemas/ProductOptionValue.yaml index a983ec50b1..b247b13506 100644 --- a/docs/api/store/components/schemas/ProductOptionValue.yaml +++ b/docs/api/store/components/schemas/ProductOptionValue.yaml @@ -31,7 +31,7 @@ properties: option: description: Available if the relation `option` is expanded. nullable: true - $ref: ./ProductOption.yaml + type: object variant_id: description: >- The ID of the Product Variant that the Product Option Value is defined @@ -41,7 +41,7 @@ properties: variant: description: Available if the relation `variant` is expanded. nullable: true - $ref: ./ProductVariant.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/ProductVariant.yaml b/docs/api/store/components/schemas/ProductVariant.yaml index 2995f2f1bf..7f9d451c41 100644 --- a/docs/api/store/components/schemas/ProductVariant.yaml +++ b/docs/api/store/components/schemas/ProductVariant.yaml @@ -45,7 +45,7 @@ properties: product: description: A product object. Available if the relation `product` is expanded. nullable: true - $ref: ./Product.yaml + type: object prices: description: >- The Money Amounts defined for the Product Variant. Each Money Amount diff --git a/docs/api/store/components/schemas/ProductVariantInventoryItem.yaml b/docs/api/store/components/schemas/ProductVariantInventoryItem.yaml index 3809f33d7c..d2f658ecfb 100644 --- a/docs/api/store/components/schemas/ProductVariantInventoryItem.yaml +++ b/docs/api/store/components/schemas/ProductVariantInventoryItem.yaml @@ -25,7 +25,7 @@ properties: variant: description: A ProductVariant object. Available if the relation `variant` is expanded. nullable: true - $ref: ./ProductVariant.yaml + type: object required_quantity: description: >- The quantity of an inventory item required for one quantity of the diff --git a/docs/api/store/components/schemas/ReturnItem.yaml b/docs/api/store/components/schemas/ReturnItem.yaml index f4d009098f..f2e6e78b7a 100644 --- a/docs/api/store/components/schemas/ReturnItem.yaml +++ b/docs/api/store/components/schemas/ReturnItem.yaml @@ -25,7 +25,7 @@ properties: return_order: description: Available if the relation `return_order` is expanded. nullable: true - $ref: ./Return.yaml + type: object item: description: Available if the relation `item` is expanded. nullable: true diff --git a/docs/api/store/components/schemas/ReturnReason.yaml b/docs/api/store/components/schemas/ReturnReason.yaml index c287143aee..37715c1fe9 100644 --- a/docs/api/store/components/schemas/ReturnReason.yaml +++ b/docs/api/store/components/schemas/ReturnReason.yaml @@ -39,10 +39,10 @@ properties: parent_return_reason: description: Available if the relation `parent_return_reason` is expanded. nullable: true - $ref: ./ReturnReason.yaml + type: object return_reason_children: description: Available if the relation `return_reason_children` is expanded. - $ref: ./ReturnReason.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/SalesChannelLocation.yaml b/docs/api/store/components/schemas/SalesChannelLocation.yaml index 9fd8efcabf..27ec4fd84b 100644 --- a/docs/api/store/components/schemas/SalesChannelLocation.yaml +++ b/docs/api/store/components/schemas/SalesChannelLocation.yaml @@ -25,7 +25,7 @@ properties: The sales channel the location is associated with. Available if the relation `sales_channel` is expanded. nullable: true - $ref: ./SalesChannel.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/ShippingMethodTaxLine.yaml b/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml index 5de5ab3d7e..d251624dca 100644 --- a/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml +++ b/docs/api/store/components/schemas/ShippingMethodTaxLine.yaml @@ -35,7 +35,7 @@ properties: shipping_method: description: Available if the relation `shipping_method` is expanded. nullable: true - $ref: ./ShippingMethod.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/ShippingOption.yaml b/docs/api/store/components/schemas/ShippingOption.yaml index 194f56631b..a8eebad545 100644 --- a/docs/api/store/components/schemas/ShippingOption.yaml +++ b/docs/api/store/components/schemas/ShippingOption.yaml @@ -40,7 +40,7 @@ properties: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: ./Region.yaml + type: object profile_id: description: >- The ID of the Shipping Profile that the shipping option belongs to. diff --git a/docs/api/store/components/schemas/ShippingOptionRequirement.yaml b/docs/api/store/components/schemas/ShippingOptionRequirement.yaml index 965a4ab138..57d045827c 100644 --- a/docs/api/store/components/schemas/ShippingOptionRequirement.yaml +++ b/docs/api/store/components/schemas/ShippingOptionRequirement.yaml @@ -23,7 +23,7 @@ properties: shipping_option: description: Available if the relation `shipping_option` is expanded. nullable: true - $ref: ./ShippingOption.yaml + type: object type: description: >- The type of the requirement, this defines how the value will be compared diff --git a/docs/api/store/components/schemas/ShippingProfile.yaml b/docs/api/store/components/schemas/ShippingProfile.yaml index cfb05ba1a6..15ffd42c84 100644 --- a/docs/api/store/components/schemas/ShippingProfile.yaml +++ b/docs/api/store/components/schemas/ShippingProfile.yaml @@ -38,7 +38,7 @@ properties: Available if the relation `products` is expanded. type: array items: - $ref: ./Product.yaml + type: object shipping_options: description: >- The Shipping Options that can be used to fulfill the Products in the @@ -46,7 +46,7 @@ properties: expanded. type: array items: - $ref: ./ShippingOption.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/TaxRate.yaml b/docs/api/store/components/schemas/TaxRate.yaml index 84093518d8..deb3f4d02e 100644 --- a/docs/api/store/components/schemas/TaxRate.yaml +++ b/docs/api/store/components/schemas/TaxRate.yaml @@ -38,7 +38,7 @@ properties: region: description: A region object. Available if the relation `region` is expanded. nullable: true - $ref: ./Region.yaml + type: object products: description: >- The products that belong to this tax rate. Available if the relation diff --git a/docs/api/store/components/schemas/TrackingLink.yaml b/docs/api/store/components/schemas/TrackingLink.yaml index 0bfd92b516..eb8ccde118 100644 --- a/docs/api/store/components/schemas/TrackingLink.yaml +++ b/docs/api/store/components/schemas/TrackingLink.yaml @@ -35,7 +35,7 @@ properties: fulfillment: description: Available if the relation `fulfillment` is expanded. nullable: true - $ref: ./Fulfillment.yaml + type: object idempotency_key: description: >- Randomly generated key used to continue the completion of a process in diff --git a/docs/api/store/openapi.yaml b/docs/api/store/openapi.yaml index 4a0067f12f..e6aeacdd02 100644 --- a/docs/api/store/openapi.yaml +++ b/docs/api/store/openapi.yaml @@ -137,6 +137,10 @@ paths: $ref: paths/auth.yaml /auth/{email}: $ref: paths/auth_{email}.yaml + /collections/{id}: + $ref: paths/collections_{id}.yaml + /collections: + $ref: paths/collections.yaml /carts/{id}/shipping-methods: $ref: paths/carts_{id}_shipping-methods.yaml /carts/{id}/taxes: @@ -159,10 +163,8 @@ paths: $ref: paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml /carts/{id}/payment-session: $ref: paths/carts_{id}_payment-session.yaml - /collections/{id}: - $ref: paths/collections_{id}.yaml - /collections: - $ref: paths/collections.yaml + /gift-cards/{code}: + $ref: paths/gift-cards_{code}.yaml /customers/me/addresses: $ref: paths/customers_me_addresses.yaml /customers: @@ -179,8 +181,6 @@ paths: $ref: paths/customers_password-token.yaml /customers/password-reset: $ref: paths/customers_password-reset.yaml - /gift-cards/{code}: - $ref: paths/gift-cards_{code}.yaml /order-edits/{id}/complete: $ref: paths/order-edits_{id}_complete.yaml /order-edits/{id}/decline: